Combined information for specific vertex and pixel shaders. More...

#include <OGLShaderProgram.h>

Inheritance diagram for Urho3D::ShaderProgram:
[legend]
Collaboration diagram for Urho3D::ShaderProgram:
[legend]

Public Member Functions

 ShaderProgram (Graphics *graphics, ShaderVariation *vertexShader, ShaderVariation *pixelShader)
 Construct.
 
 ~ShaderProgram ()
 Destruct.
 
 ShaderProgram (Graphics *graphics, ShaderVariation *vertexShader, ShaderVariation *pixelShader)
 Construct.
 
 ~ShaderProgram ()
 Destruct.
 
virtual void OnDeviceLost ()
 Mark the GPU resource destroyed on context destruction.
 
virtual void Release ()
 Release shader program.
 
bool Link ()
 Link the shaders and examine the uniforms and samplers used. Return true if successful.
 
ShaderVariationGetVertexShader () const
 Return the vertex shader.
 
ShaderVariationGetPixelShader () const
 Return the pixel shader.
 
bool HasParameter (StringHash param) const
 Return whether uses a shader parameter.
 
bool HasTextureUnit (TextureUnit unit) const
 Return whether uses a texture unit.
 
const ShaderParameterGetParameter (StringHash param) const
 Return the info for a shader parameter, or null if does not exist.
 
const StringGetLinkerOutput () const
 Return linker output.
 
const SharedPtr< ConstantBuffer > * GetConstantBuffers () const
 Return all constant buffers.
 
bool NeedParameterUpdate (ShaderParameterGroup group, const void *source)
 Check whether a shader parameter group needs update. Does not actually check whether parameters exist in the shaders.
 
void ClearParameterSource (ShaderParameterGroup group)
 Clear a parameter source. Affects only the current shader program if appropriate.
 
- Public Member Functions inherited from Urho3D::RefCounted
 RefCounted ()
 Construct. Allocate the reference count structure and set an initial self weak reference.
 
virtual ~RefCounted ()
 Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
 
void AddRef ()
 Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
 
void ReleaseRef ()
 Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
 
int Refs () const
 Return reference count.
 
int WeakRefs () const
 Return weak reference count.
 
RefCountRefCountPtr ()
 Return pointer to the reference count structure.
 
- Public Member Functions inherited from Urho3D::GPUObject
 GPUObject (Graphics *graphics)
 Construct with graphics subsystem pointer.
 
virtual ~GPUObject ()
 Destruct. Remove from the graphics subsystem.
 
void ClearDataLost ()
 Clear the data lost flag. No-op on D3D11.
 
GraphicsGetGraphics () const
 Return the graphics subsystem.
 
void * GetGPUObject () const
 Return Direct3D object.
 
bool IsDataLost () const
 Return whether data is lost due to device loss. Always false on D3D11.
 
bool HasPendingData () const
 Return whether has pending data assigned while device was lost. Always false on D3D11.
 
 GPUObject (Graphics *graphics)
 Construct with graphics subsystem pointer.
 
virtual ~GPUObject ()
 Destruct. Remove from the Graphics.
 
virtual void OnDeviceReset ()
 Recreate the GPU resource and restore data if applicable.
 
void ClearDataLost ()
 Clear the data lost flag.
 
GraphicsGetGraphics () const
 Return the graphics subsystem.
 
unsigned GetGPUObject () const
 Return the object's OpenGL handle.
 
bool IsDataLost () const
 Return whether data is lost due to context loss.
 
bool HasPendingData () const
 Return whether has pending data assigned while context was lost.
 

Static Public Member Functions

static void ClearParameterSources ()
 Clear all parameter sources from all shader programs by incrementing the global parameter source framenumber.
 
static void ClearGlobalParameterSource (ShaderParameterGroup group)
 Clear a global parameter source when constant buffers change.
 

Public Attributes

HashMap< StringHash,
ShaderParameter
parameters_
 Combined parameters from the vertex and pixel shader.
 
SharedPtr< ConstantBuffervsConstantBuffers_ [MAX_SHADER_PARAMETER_GROUPS]
 Vertex shader constant buffers.
 
SharedPtr< ConstantBufferpsConstantBuffers_ [MAX_SHADER_PARAMETER_GROUPS]
 Pixel shader constant buffers.
 

Private Attributes

WeakPtr< ShaderVariationvertexShader_
 Vertex shader.
 
WeakPtr< ShaderVariationpixelShader_
 Pixel shader.
 
HashMap< StringHash,
ShaderParameter
shaderParameters_
 Shader parameters.
 
bool useTextureUnit_ [MAX_TEXTURE_UNITS]
 Texture unit use.
 
SharedPtr< ConstantBufferconstantBuffers_ [MAX_SHADER_PARAMETER_GROUPS *2]
 Constant buffers by binding index.
 
const void * parameterSources_ [MAX_SHADER_PARAMETER_GROUPS]
 Remembered shader parameter sources for individual uniform mode.
 
String linkerOutput_
 Shader link error string.
 
unsigned frameNumber_
 Shader parameter source framenumber.
 

Static Private Attributes

static unsigned globalFrameNumber = 0
 Global shader parameter source framenumber.
 
static const void * globalParameterSources [MAX_SHADER_PARAMETER_GROUPS]
 Remembered global shader parameter sources for constant buffer mode.
 

Additional Inherited Members

- Protected Attributes inherited from Urho3D::GPUObject
WeakPtr< Graphicsgraphics_
 Graphics subsystem.
 
void * object_
 Direct3D object.
 
unsigned object_
 Object handle.
 
bool dataLost_
 Data lost flag.
 
bool dataPending_
 Data pending flag.
 

Detailed Description

Combined information for specific vertex and pixel shaders.

Linked shader program on the GPU.


The documentation for this class was generated from the following files:
  • /home/travis/build/urho3d/Urho3D/Source/Urho3D/Graphics/Direct3D11/D3D11ShaderProgram.h
  • /home/travis/build/urho3d/Urho3D/Source/Urho3D/Graphics/OpenGL/OGLShaderProgram.h
  • /home/travis/build/urho3d/Urho3D/Source/Urho3D/Graphics/OpenGL/OGLShaderProgram.cpp