Image rendering with multisamples fails in VTK master
After !6989 (merged) (as found with git bisect), image rendering fails on my linux system (with amdgpu drivers) unless I turn multisamples off. For example, here are two screenshots for TestCheckerboardWidget. Note that the test doesn't actually fail, since the saved regression image is correct, even though the image displayed on the screen is incorrect (very weird!).
The problem seems to be the MSAA code in vtkOpenGLRenderWindow.cxx
. I can make the problem go away by commenting out the copiedColor
line in the Frame()
method:
if (this->ResolveQuad->Program && this->ResolveQuad->Program->GetCompiled())
{
this->GetState()->vtkglDisable(GL_DEPTH_TEST);
this->GetState()->vtkglDisable(GL_BLEND);
auto tex = this->RenderFramebuffer->GetColorAttachmentAsTextureObject(0);
tex->Activate();
this->ResolveQuad->Program->SetUniformi("samplecount", this->MultiSamples);
this->ResolveQuad->Program->SetUniformi("tex", tex->GetTextureUnit());
this->ResolveQuad->Render();
tex->Deactivate();
//copiedColor = true;
this->GetState()->vtkglEnable(GL_DEPTH_TEST);
this->GetState()->vtkglEnable(GL_BLEND);
}
Oddly enough, this copiedColor
line does not appear in the otherwise identical code block in the StereoMidpoint()
method!