Seattle-area consultant and co-owner at Binomial LLC, game and open source developer, graphics programmer, lossless data and texture compression specialist, and recovering OpenGL addict. Worked previously at Digital Illusions, Microsoft Ensemble Studios, Valve, Boss Fight Entertainment, and Unity Technologies.
Wednesday, May 7, 2014
Replay Divergence Hell
We've had a handful of traces in vogl that don't replay correctly hanging around in our regression test suite. One g-truc sample (gl-320-fbo-blit) was randomly failing -- turns out it wasn't clearing the backbuffer every frame. It was rendering a checkerboard of quads, so half the pixels in the backbuffer were not being written. Sometimes it would play back seemingly correctly (black pixels where quads weren't being rendered), and sometimes we would see random-looking bits in there.
Anyhow, I'm now trying to figure out why the g-truc sample gl-330-blend-rtt diverges when replayed with vogl. It's also randomly failing. Beyond Compare's image comparison mode can be pretty helpful in cases like this.
Update: OK, I found the problem. The sample uses a FBO with 3 texture attachments, but it was only clearing the first one in display(). The fix is simple:
for (int i = 0; i < 3; i++) glClearBufferfv(GL_COLOR, i, &glm::vec4(1.0f));