mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028180: Visualization, TKOpenGl - Performance of Shaded presentation dropped due to FFP disabled by default
FFP state management (light sources, matrices, clipping planes) has been moved to OpenGl_ShaderManager for consistency with Programmable Pipeline. OpenGl_Context::BindProgram() does not re-bind already active Program. OpenGl_PrimitiveArray::Render() does not reset active Program at the end. OpenGl_Context::ApplyModelViewMatrix() now checks if matrix differs from already set one before modifying state in Shader Manager. This allows avoing redundant state changes, matrix uploads onto GPU and re-computation of inversed matrices. NCollection_Mat4 has been extended with equality check operators for proper comparison. OpenGl_ShaderManager - the tracking Material state has been added. Removed unreachable states OPENGL_NS_RESMAT, OPENGL_NS_TEXTURE and OPENGL_NS_WHITEBACK. Fixed resetting FFP material state after displaying GL_COLOR_ARRAY vertices; the Material state within Shader Manager is now invalidated within OpenGl_VertexBuffer::unbindFixedColor(). OpenGl_Workspace::ApplyAspectFace() - fixed invalidating Material State when only Highlighting style is changing.
This commit is contained in:
@@ -477,32 +477,6 @@ Standard_Boolean OpenGl_ShaderProgram::ApplyVariables(const Handle(OpenGl_Contex
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : ActiveState
|
||||
// purpose : Returns index of last modification for specified state type
|
||||
// =======================================================================
|
||||
Standard_Size OpenGl_ShaderProgram::ActiveState (const OpenGl_UniformStateType theType) const
|
||||
{
|
||||
if (theType < MaxStateTypes)
|
||||
{
|
||||
return myCurrentState[theType];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : UpdateState
|
||||
// purpose : Updates index of last modification for specified state type
|
||||
// =======================================================================
|
||||
void OpenGl_ShaderProgram::UpdateState (const OpenGl_UniformStateType theType,
|
||||
const Standard_Size theIndex)
|
||||
{
|
||||
if (theType < MaxStateTypes)
|
||||
{
|
||||
myCurrentState[theType] = theIndex;
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetUniformLocation
|
||||
// purpose : Returns location (index) of the specific uniform variable
|
||||
|
Reference in New Issue
Block a user