Urho3D
|
Vertex or pixel shader on the GPU. More...
#include <D3D9ShaderVariation.h>
Public Member Functions | |
ShaderVariation (Shader *owner, ShaderType type) | |
Construct. | |
virtual | ~ShaderVariation () |
Destruct. | |
bool | Create () |
Create the shader program. Return true if successful. | |
virtual void | Release () |
Release shader. | |
void | SetName (const String &name) |
Set name. | |
void | SetByteCode (const SharedArrayPtr< unsigned char > &byteCode) |
Set bytecode. | |
void | AddParameter (StringHash param, const ShaderParameter &definition) |
Add a parameter. | |
void | AddTextureUnit (TextureUnit unit) |
Add a texture unit. | |
void | ClearParameters () |
Clear parameters and texture unit use flags. | |
void | OptimizeParameters () |
Optimize the parameter map for optimal query speed. | |
ShaderType | GetShaderType () const |
Return shader type. | |
const String & | GetName () const |
Return full shader name. | |
Shader * | GetOwner () const |
Return parent shader resource. | |
bool | IsCreated () const |
Return whether created successfully. | |
bool | IsFailed () const |
Return whether compile failed. | |
bool | HasParameter (StringHash param) const |
Return whether uses a parameter. | |
bool | HasTextureUnit (TextureUnit unit) const |
Return whether uses a texture unit (only for pixel shaders.) | |
const HashMap< StringHash, ShaderParameter > & | GetParameters () const |
Return all parameter definitions. | |
![]() | |
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. | |
RefCount * | RefCountPtr () |
Return pointer to the reference count structure. | |
![]() | |
GPUObject (Graphics *graphics) | |
Construct with graphics subsystem pointer. | |
virtual | ~GPUObject () |
Destruct. Remove from the graphics subsystem. | |
virtual void | OnDeviceLost () |
Release default pool resources. | |
virtual void | OnDeviceReset () |
Recreate default pool resources. | |
void | ClearDataLost () |
Clear the data lost flag. | |
Graphics * | GetGraphics () const |
Return the graphics subsystem. | |
void * | GetGPUObject () const |
Return Direct3D object. | |
bool | IsDataLost () const |
Return whether data is lost due to device loss. | |
bool | HasPendingData () const |
Return whether has pending data assigned while device was lost. |
Private Attributes | |
WeakPtr< Shader > | owner_ |
Parent shader resource. | |
ShaderType | shaderType_ |
Shader type. | |
String | name_ |
Full shader name. | |
SharedArrayPtr< unsigned char > | byteCode_ |
Shader bytecode. | |
bool | failed_ |
Compile failed flag. | |
HashMap< StringHash, ShaderParameter > | parameters_ |
Shader parameters. | |
bool | useTextureUnit_ [MAX_TEXTURE_UNITS] |
Texture unit use flags. |
Additional Inherited Members | |
![]() | |
WeakPtr< Graphics > | graphics_ |
Graphics subsystem. | |
void * | object_ |
Direct3D object. | |
bool | dataLost_ |
Data lost flag. | |
bool | dataPending_ |
Data pending flag. |
Vertex or pixel shader on the GPU.