Caffe2 - C++ API
A deep learning, cross platform ML framework
Data Structures | Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Static Protected Attributes
GLFilter Class Reference
Inheritance diagram for GLFilter:
GLAdd GLConcat GLConvolution GLMul GLNormPlanarYUV GLPadImage GLPool GLPRelu GLReduce GLResizeNearest GLScale GLSigmoid GLSoftmaxReduce GLSoftmaxScale GLStylizer GLSub

Data Structures

struct  binding
struct  texture_attachment

Public Types

typedef std::vector< std::pair< std::string, std::string > > replacements_t

Public Member Functions

 GLFilter (const std::string kernel_name, const std::string vertex_shader, const std::string fragment_shader, const std::vector< binding * > uniforms, const std::vector< binding * > uniform_blocks={}, const std::vector< binding * > attributes={}, const replacements_t &replacements={})
 Copyright (c) 2016-present, Facebook, Inc. More...
void throwRuntimeError (std::function< void(std::stringstream &errmsg)> error_formatter) const
void checkGLError (std::function< void(std::stringstream &errmsg)> error_formatter) const
template<typename T >
void attach_uniform_buffer (const binding *block, GLuint bindingPoint, std::function< void(T *, size_t)> loader)
void run (const std::vector< texture_attachment > &input, const std::vector< const GLTexture * > &output, std::function< void(void)> uniforms_initializer, int width, int height)
void releaseBuffers ()
void deleteProgram ()
void deleteBindings ()

Static Public Attributes

static const char * vertex_shader

Protected Attributes

const std::string kernel_name
GLuint program = 0
GLuint frameBuffer = 0
GLuint uniformBlock [kMaxUniformBlocks] = {0}
GLint blockSize [kMaxUniformBlocks] = {0}
bool frame_buffer_initialized = false

Static Protected Attributes

static constexpr int kMaxUniformBlocks = 12
static constexpr bool check_opengl_errors = true

Detailed Description

Definition at line 31 of file GLFilter.h.

Constructor & Destructor Documentation

GLFilter::GLFilter ( const std::string  _kernel_name,
const std::string  _vertex_shader,
const std::string  _fragment_shader,
const std::vector< binding * >  uniforms,
const std::vector< binding * >  uniform_blocks = {},
const std::vector< binding * >  attributes = {},
const replacements_t &  _replacements = {} 

Copyright (c) 2016-present, Facebook, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition at line 21 of file

Field Documentation

const char * GLFilter::vertex_shader
Initial value:
= R"GLSL(#version 300 es
layout(location = 0) in vec4 a_position;
layout(location = 1) in vec2 a_texCoord;
out vec2 v_texCoord;
void main()
gl_Position = a_position;
v_texCoord = a_texCoord;

Definition at line 106 of file GLFilter.h.

The documentation for this class was generated from the following files: