osmesa/test: Clear the stencil bits in the depth test.
Since the depth buffer starts out as a malloc, and we weren't clearing it, you could get undefined values in your top 8 bits. This should fix intermittent failures of the depth test. (Sadly, valgrind wasn't catching this, presumably because the 32-bit value there *is* written, just some bits are left undef) Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1243>
This commit is contained in:
@@ -186,7 +186,7 @@ TEST(OSMesaRenderTest, depth)
|
||||
ASSERT_EQ(depth_cpp, 4);
|
||||
|
||||
glClearDepth(1.0);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
glFinish();
|
||||
EXPECT_EQ(depth[w * 0 + 0], 0x00ffffff);
|
||||
EXPECT_EQ(depth[w * 0 + 1], 0x00ffffff);
|
||||
|
Reference in New Issue
Block a user