![]() |
VR-Forces Developer's Guide
|
A convenience class to represent an OpenGL Shader Program.
Public Member Functions | |
| DtGlProgram (const std::string &name, const DtShaderVector &shaders, bool multiview=false) | |
| DtGlProgram (const std::string &name, unsigned int programId) | |
| DtGlProgram (const std::string &name, const std::string &programBinary, bool multiview) | |
| virtual | ~DtGlProgram () |
| virtual void | bind () |
| virtual void | unbind () |
| virtual bool | isValid () const |
| virtual unsigned int | id () const |
| virtual int | uboSize (const std::string &name) const |
| virtual int | uboBinding (const std::string &name) const |
| virtual int | ssboBinding (const std::string &name) const |
| virtual int | bufferBinding (const std::string &name, bool ubo) const |
| virtual int | uniformOffset (const std::string &uniformName) const |
| virtual int | uniformLocation (const std::string &uniformName) const |
| virtual const DtGlUbo * | ubo (const std::string &uboName) const |
| virtual bool | saveProgramBinary (const std::string &fileNameFullPath) const |
| virtual unsigned int | releaseHandle (void) |
| virtual void | runComputeShader (unsigned int workSizeX, unsigned int workSizeY, bool bind) |
| virtual void | runComputeShader (unsigned int workSizeX, unsigned int workSizeY, unsigned int workSizeZ, bool bind) |
| virtual void | runComputeShader (const DtGlTexture *renderTexture, bool bind) |
Static Public Member Functions | |
| static void | printGLSLInfoLog (unsigned int shader) |
Protected Member Functions | |
| virtual void | introspect (void) const |
| virtual bool | createProgram (const std::string &name, const VectorUnsignedInts &shaders) |
Protected Attributes | |
| unsigned | myProgramID |
| bool | myIsValid |
| bool | myMutableIntrospected |
| std::unordered_map < std::string, DtGlUbo * > | myMutableUbos |
| const bool | myOwns |
| const bool | myIsMultiview |
Private Member Functions | |
| DtGlProgram ()=delete | |
| DtGlProgram (const DtGlProgram &)=delete | |
| DtGlProgram & | operator= (const DtGlProgram &)=delete |
| makVrv::DtGlProgram::DtGlProgram | ( | const std::string & | name, |
| const DtShaderVector & | shaders, | ||
| bool | multiview = false |
||
| ) |
create a shader with a given name, from a list of input shaders
create a container DtGlProgram This constructed object does not own the gl program
| makVrv::DtGlProgram::DtGlProgram | ( | const std::string & | name, |
| const std::string & | programBinary, | ||
| bool | multiview | ||
| ) |
Takes binary source.
|
virtual |
destroy the shader
|
privatedelete |
private default constructor. not allowed
|
privatedelete |
prevent copy-construction
|
privatedelete |
prevent assignment
|
virtual |
make this shader the currently bound shader for use in OpenGL
|
virtual |
unbind the shader and use the default program of 0
|
virtual |
A valid shader program is one that has valid shaders and they link together without error.
the OpenGL id of the internal shader program
|
virtual |
get the size of the ubo if it exists, 0 otherwise
|
virtual |
get the binding of the ubo specified in the shader, -1 otherwise
|
virtual |
get the binding of the ssbo specified in the shader, -1 otherwise
same as above 2, but takes buffer type
|
virtual |
get the offset a constant within an UBO if it exists, -1 otherwise
|
virtual |
get the uniform location if it exists, -1 otherwise
|
virtual |
get UBO details by name
|
virtual |
save the program binary
release and return the handle so that the program can be deleted externally
|
virtual |
run a compute shader. workSizeX grid size in x dimension workSizeY grid size in y dimension bind whether to bind the program or not
|
virtual |
run a compute shader. workSizeX grid size in x dimension workSizeY grid size in y dimension workSizeZ grid size in z dimension bind whether to bind the program or not
|
virtual |
run a compute shader. renderTexture is the texture into which the compute shader will compute results to. work group size is implicit in the texture size bind whether to bind the program or not
print info of shader or program
|
protectedvirtual |
do program introspection
|
protectedvirtual |
internal
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |