mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
Add IMaterialRendererServices::startUseProgram/stopUseProgram
This makes it possible to set high-level shader constants (which are attached to shader programs) to be set outside of OnSetConstants. IShaderConstantSetCallBack::OnCreate has it set automatically now so it works the same as OnSetConstants. D3D9 and burnings both work different, so there hadn't been a problem with those. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6469 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -41,6 +41,20 @@ public:
|
||||
//! Return an index constant for the vertex shader based on a name.
|
||||
virtual s32 getVertexShaderConstantID(const c8* name) = 0;
|
||||
|
||||
//! Call when you set shader constants outside of IShaderConstantSetCallBack
|
||||
/** Only for high-level shader functions, aka those using an index instead of
|
||||
an register. Shader constants are attached to shader programs, so if you want
|
||||
to set them you have to make sure the correct shader program is in use.
|
||||
IShaderConstantSetCallBack functions like OnSetConstants do that for you,
|
||||
but if you want to set shader constants outside of those (usually for performance
|
||||
reasons) call startUseProgram() before doing so and stopUseProgram() afterwards.
|
||||
Note: Currently only necessary in OpenGL, but no real calling costs on other drivers.
|
||||
*/
|
||||
virtual void startUseProgram() {}
|
||||
|
||||
//! Call this when you are done setting shader constants outside of OnCreate or OnSetConstants
|
||||
virtual void stopUseProgram() {}
|
||||
|
||||
//! Sets a constant for the vertex shader based on a name.
|
||||
/** This can be used if you used a high level shader language like GLSL
|
||||
or HLSL to create a shader. Example: If you created a shader which has
|
||||
|
Reference in New Issue
Block a user