Move shader description generation to it's own method.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent 06d7bd9c74
commit bbb4762b77

@ -379,6 +379,7 @@ public:
static inline void setupCausticsSecondTex(uint stage);*/
virtual bool setupMaterial(CMaterial& mat);
void generateShaderDesc(CShaderDesc &desc, CMaterial &mat);
bool setupProgram(CMaterial& mat);
void setupUniforms(CMaterial& mat);
void releaseProgram();

@ -148,11 +148,8 @@ namespace NL3D
static IProgramObject *p;
bool CDriverGL3::setupProgram( CMaterial &mat )
void CDriverGL3::generateShaderDesc( CShaderDesc &desc, CMaterial &mat )
{
#ifdef GLSL
CShaderDesc desc;
desc.setShaderType( mat.getShader() );
desc.setVBFlags( _CurrentVertexBufferHard->VB->getVertexFormat() );
@ -171,6 +168,16 @@ namespace NL3D
desc.setAlphaTest( mat.getAlphaTest() );
desc.setAlphaTestThreshold( mat.getAlphaTestThreshold() );
}
bool CDriverGL3::setupProgram( CMaterial &mat )
{
#ifdef GLSL
CShaderDesc desc;
generateShaderDesc( desc, mat );
p = shaderCache.findShader( desc );

Loading…
Cancel
Save