Commit c6a224e7 authored by Francois Bertel's avatar Francois Bertel
Browse files

ENH:Make TestGenericVertexAttributesGLSLDepthPeelingPass fail when there is a...

ENH:Make TestGenericVertexAttributesGLSLDepthPeelingPass fail when there is a driver bug. An example of this case is the current nVidia driver on gaia (81.76, very old, 2006) for a Quadro NVS 285 for which there is an unexpected link error: (0) : error C9999: symbol @TMP1 already in table.
parent 485853b9
......@@ -134,3 +134,7 @@ FOREACH (exe
TARGET_LINK_LIBRARIES(${exe} "-framework GLUT")
ENDIF (APPLE)
ENDFOREACH (exe)
IF(VTK_USE_GLSL_SHADERS AND VTK_USE_DISPLAY)
set_tests_properties(TestGenericVertexAttributesGLSLDepthPeelingPass PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR:.*vtkOpenGLProperty.*Couldn't build the shader program. At this point , it can be an error in a shader or a driver bug.")
ENDIF(VTK_USE_GLSL_SHADERS AND VTK_USE_DISPLAY)
......@@ -44,7 +44,7 @@
#include <assert.h>
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkCxxRevisionMacro(vtkOpenGLProperty, "1.53");
vtkCxxRevisionMacro(vtkOpenGLProperty, "1.54");
vtkStandardNewMacro(vtkOpenGLProperty);
#endif
......@@ -288,23 +288,58 @@ void vtkOpenGLProperty::Render(vtkActor *anActor,
}
}
if(supportShaders && prog!=0)
if(this->CurrentShaderProgram2!=0)
{
prog->Build();
prog->Use();
if(!prog->IsValid())
this->CurrentShaderProgram2->Build();
if(this->CurrentShaderProgram2->GetLastBuildStatus()
!=VTK_SHADER_PROGRAM2_LINK_SUCCEEDED)
{
vtkErrorMacro(<<prog->GetLastValidateLog());
vtkErrorMacro("Couldn't build the shader program. At this point , it can be an error in a shader or a driver bug.");
this->CurrentShaderProgram2=0;
if(this->PropProgram!=0)
{
this->PropProgram->ReleaseGraphicsResources();
this->UseDefaultMainVS=false;
this->UseDefaultMainFS=false;
this->PropProgram->Delete();
this->PropProgram=0;
}
else
{
prog->ReleaseGraphicsResources();
if(this->Shader2Collection!=0)
{
prog->GetShaders()->RemoveCollection(this->Shader2Collection);
}
if(this->UseDefaultMainVS)
{
prog->GetShaders()->RemoveItem(this->DefaultMainVS);
this->UseDefaultMainVS=false;
}
if(this->UseDefaultMainFS)
{
prog->GetShaders()->RemoveItem(this->DefaultMainFS);
this->UseDefaultMainFS=false;
}
if(this->UseDefaultPropVS)
{
prog->GetShaders()->RemoveItem(this->DefaultPropVS);
this->UseDefaultPropVS=false;
}
if(this->UseDefaultPropFS)
{
prog->GetShaders()->RemoveItem(this->DefaultPropFS);
this->UseDefaultPropFS=false;
}
}
}
}
else
{
if(this->PropProgram!=0)
else
{
this->PropProgram->Use();
if(!this->PropProgram->IsValid())
this->CurrentShaderProgram2->Use();
if(!this->CurrentShaderProgram2->IsValid())
{
vtkErrorMacro(<<this->PropProgram->GetLastValidateLog());
vtkErrorMacro(<<this->CurrentShaderProgram2->GetLastValidateLog());
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment