Skip to content
Snippets Groups Projects
Commit 78883cc0 authored by Thomas Galland's avatar Thomas Galland Committed by Kitware Robot
Browse files

Merge topic 'fixPopUpWindowBug2'


2040ca5c Sanitize some OpenGL rendering classes
52db68e9 Fix pop up layout with tone mapping crash

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Tested-by: default avatarbuildbot <buildbot@kitware.com>
Reviewed-by: default avatarLucas Givord <lucas.givord@kitware.com>
Reviewed-by: default avatarLucas Gandel <lucas.gandel@kitware.com>
Reviewed-by: default avatarSankhesh Jhaveri <sankhesh.jhaveri@kitware.com>
Merge-request: !10697
parents 2ca8847c 2040ca5c
No related merge requests found
......@@ -324,6 +324,12 @@ void vtkOpenGLFXAAFilter::ApplyFilter()
}
vtkShaderProgram* program = this->QHelper->Program;
if (!program)
{
vtkWarningMacro(
"Unable to retrieve shader program from internal vtkOpenGLQuadHelper instance.");
return;
}
program->SetUniformi("Input", this->Input->GetTextureUnit());
float invTexSize[2] = { 1.f / static_cast<float>(this->Viewport[2]),
1.f / static_cast<float>(this->Viewport[3]) };
......
......@@ -50,6 +50,15 @@ void vtkOpenGLFXAAPass::Render(const vtkRenderState* s)
this->FXAAFilter->Execute(r);
}
//------------------------------------------------------------------------------
void vtkOpenGLFXAAPass::ReleaseGraphicsResources(vtkWindow* w)
{
assert("pre: w_exists" && w != nullptr);
this->FXAAFilter->ReleaseGraphicsResources();
this->Superclass::ReleaseGraphicsResources(w);
}
//------------------------------------------------------------------------------
void vtkOpenGLFXAAPass::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -41,6 +41,13 @@ public:
*/
void Render(const vtkRenderState* s) override;
/**
* Release graphics resources and ask components to release their own
* resources.
* \pre w_exists: w!=0
*/
void ReleaseGraphicsResources(vtkWindow* w) override;
vtkGetObjectMacro(FXAAOptions, vtkFXAAOptions);
virtual void SetFXAAOptions(vtkFXAAOptions*);
......
......@@ -96,6 +96,10 @@ void vtkOpenGLQuadHelper::ReleaseGraphicsResources(vtkWindow*)
{
this->VAO->ReleaseGraphicsResources();
}
// Owner is shader cache. When the render window releases it's graphic ressources,
// OpenGL state is deleted, so the cache is deleted as well.
this->Program = nullptr;
}
//------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment