Commit 666d6f94 authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri 💬 Committed by Kitware Robot
Browse files

Merge topic 'clear_shader_api'

d1bc40f6

 Clear all custom shader code in clear shader API
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Ken Martin's avatarKen Martin <ken.martin@kitware.com>
Merge-request: !3645
parents a35517e8 d1bc40f6
......@@ -265,6 +265,21 @@ void vtkOpenGLPolyDataMapper::ClearShaderReplacement(
void vtkOpenGLPolyDataMapper::ClearAllShaderReplacements(
vtkShader::Type shaderType)
{
// First clear all shader code
if ((shaderType == vtkShader::Vertex) && this->VertexShaderCode)
{
this->SetVertexShaderCode(nullptr);
}
else if ((shaderType == vtkShader::Fragment) && this->FragmentShaderCode)
{
this->SetFragmentShaderCode(nullptr);
}
else if ((shaderType == vtkShader::Geometry) && this->GeometryShaderCode)
{
this->SetGeometryShaderCode(nullptr);
}
// Now clear custom tag replacements
std::map<const vtkShader::ReplacementSpec,
vtkShader::ReplacementValue>::iterator rIter;
for (rIter = this->UserShaderReplacements.begin();
......@@ -284,6 +299,9 @@ void vtkOpenGLPolyDataMapper::ClearAllShaderReplacements(
//-----------------------------------------------------------------------------
void vtkOpenGLPolyDataMapper::ClearAllShaderReplacements()
{
this->SetVertexShaderCode(nullptr);
this->SetFragmentShaderCode(nullptr);
this->SetGeometryShaderCode(nullptr);
this->UserShaderReplacements.clear();
}
......
......@@ -3052,6 +3052,17 @@ void vtkOpenGLGPUVolumeRayCastMapper::ClearShaderReplacement(
void vtkOpenGLGPUVolumeRayCastMapper::ClearAllShaderReplacements(
vtkShader::Type shaderType)
{
// First clear all shader code
if ((shaderType == vtkShader::Vertex) && this->VertexShaderCode)
{
this->SetVertexShaderCode(nullptr);
}
else if ((shaderType == vtkShader::Fragment) && this->FragmentShaderCode)
{
this->SetFragmentShaderCode(nullptr);
}
// Now clear custom tag replacements
std::map<const vtkShader::ReplacementSpec,
vtkShader::ReplacementValue>::iterator rIter;
for (rIter = this->UserShaderReplacements.begin();
......@@ -3071,6 +3082,8 @@ void vtkOpenGLGPUVolumeRayCastMapper::ClearAllShaderReplacements(
//-----------------------------------------------------------------------------
void vtkOpenGLGPUVolumeRayCastMapper::ClearAllShaderReplacements()
{
this->SetVertexShaderCode(nullptr);
this->SetFragmentShaderCode(nullptr);
this->UserShaderReplacements.clear();
}
......
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