Set up the shader programs in setupMaterial call.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent 709c54e485
commit 43ad0189c6

@ -482,7 +482,10 @@ bool CDriverGL3::setupMaterial(CMaterial& mat)
disableUserTextureMatrix(); disableUserTextureMatrix();
} }
return true; // 5. Set up the program
// =====================
bool programOK = setupProgram( mat );
return programOK;
} }
// *************************************************************************** // ***************************************************************************

@ -36,9 +36,6 @@ bool CDriverGL3::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines)
if ( !setupMaterial(mat) || _LastIB._Values == NULL ) if ( !setupMaterial(mat) || _LastIB._Values == NULL )
return false; return false;
if( !setupProgram( mat ) )
return false;
if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true;
// render primitives. // render primitives.
//============================== //==============================
@ -88,9 +85,6 @@ bool CDriverGL3::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris
if ( !setupMaterial(mat) || _LastIB._Values == NULL ) if ( !setupMaterial(mat) || _LastIB._Values == NULL )
return false; return false;
if( !setupProgram( mat ) )
return false;
if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true;
// render primitives. // render primitives.
@ -179,9 +173,6 @@ bool CDriverGL3::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPo
if ( !setupMaterial(mat) ) if ( !setupMaterial(mat) )
return false; return false;
if( !setupProgram( mat ) )
return false;
if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true;
// render primitives. // render primitives.
//============================== //==============================
@ -222,9 +213,6 @@ bool CDriverGL3::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLin
if ( !setupMaterial(mat) ) if ( !setupMaterial(mat) )
return false; return false;
if( !setupProgram( mat ) )
return false;
if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true;
// render primitives. // render primitives.
//============================== //==============================
@ -265,9 +253,6 @@ bool CDriverGL3::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 nu
if ( !setupMaterial(mat) ) if ( !setupMaterial(mat) )
return false; return false;
if( !setupProgram( mat ) )
return false;
if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true;
// render primitives. // render primitives.
//============================== //==============================
@ -311,9 +296,6 @@ bool CDriverGL3::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQua
if ( !setupMaterial(mat) ) if ( !setupMaterial(mat) )
return false; return false;
if( !setupProgram( mat ) )
return false;
if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true;
const uint32 QUAD_BATCH_SIZE = 2048; const uint32 QUAD_BATCH_SIZE = 2048;

Loading…
Cancel
Save