[Bug 111170] comparison between same depths from glClearDepthf and fragment depth will fail
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Jul 19 05:57:58 UTC 2019
https://bugs.freedesktop.org/show_bug.cgi?id=111170
Bug ID: 111170
Summary: comparison between same depths from glClearDepthf and
fragment depth will fail
Product: Mesa
Version: 19.1
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/DRI/i965
Assignee: intel-3d-bugs at lists.freedesktop.org
Reporter: xing.xu at intel.com
QA Contact: intel-3d-bugs at lists.freedesktop.org
Created attachment 144822
--> https://bugs.freedesktop.org/attachment.cgi?id=144822&action=edit
test case binary
****************************************
Issue analyze:
Take case “MaskedScissoredClearTest.Test/ES2_OpenGL_clear_cd” as an example.
Summary of this case:
1), Preset the depth buffer with value 0.5f, name it Zb, buffer depth
kClearDepth = 0.5f;
glClearDepthf(kClearDepth);
2), Draw quad with depth of 0.0f, name it Zf, fragment depth
drawQuad(depthTestProgram, essl1_shaders::PositionAttrib(), maskDepth ? 1.0f :
0.0f);
In theory, the depth 0.5f of glClearDepthf equals(GL_EQUAL) the depth of
drawQuad 0.0f. There is an equation between these two depths:
Zb = 0.5 x Zf + 0.5
On NVidia’s platform, we observed what we expected. On Intel platform, didn’t.
I also did below tests with different buffer depth and different depth func
(GL_GREATER and GL_LESS), you can easily see the relationship between Zf (0.0)
and Zb(0.5) on Intel platform(You may also refer to attachment
zbzf_testdata.png):
Zb Zf > (GL_GREATER) < (GL_LESS)
0.5 0.0 √ x
0.499 0.0 √ x
0.501 0.0 x √
****************************************
Reproduce steps (You may try the attached binary to reproduce):
1. Download angle source and install deps:
(https://github.com/google/angle/blob/master/doc/DevSetup.md)
git clone https://chromium.googlesource.com/angle/angle
cd angle
python scripts/bootstrap.py
gclient sync
git checkout master
./build/install-build-deps.sh
gn gen out/Release
2. Edit code(To enable the skipped test case)
--- a/src/tests/gl_tests/ClearTest.cpp
+++ b/src/tests/gl_tests/ClearTest.cpp
@@ -1248,7 +1248,7 @@ void
MaskedScissoredClearTestBase::MaskedScissoredColorDepthStencilClear(
&maskColor, &maskDepth,
&maskStencil, &scissor);
// clearDepth && !maskDepth fails on Intel Ubuntu 19.04 Mesa 19.0.2 GL.
http://anglebug.com/3614
- ANGLE_SKIP_TEST_IF(IsLinux() && IsIntel() && IsDesktopOpenGL() &&
clearDepth && !maskDepth);
+ // ANGLE_SKIP_TEST_IF(IsLinux() && IsIntel() && IsDesktopOpenGL() &&
clearDepth && !maskDepth);
3. Build
ninja -C out/Release
4. Run test case
./out/Release/angle_end2end_tests
--gtest_filter=MaskedScissoredClearTest.Test/ES2_OpenGL_clear_cd
I have reproduced this issue on below platform:
Mesa 19.1.1/Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated
Graphics Controller (rev 06)/Ubuntu 18.04
I can not reproduce this on:
OpenGL version string: 4.6.0 NVIDIA 430.26/GeForce GTX 1060/Ubuntu 18.04.
Windows 10/Intel UHD 630/
****************************************
The failed logs on Intel:
[----------] 1 test from MaskedScissoredClearTest
[ RUN ] MaskedScissoredClearTest.Test/ES2_OpenGL_clear_cd
../../src/tests/gl_tests/ClearTest.cpp:1355: Failure
The difference between (expectedCenterColorRGB.R) and pixel[0] is 51, which
exceeds 1, where
(expectedCenterColorRGB.R) evaluates to 0,
pixel[0] evaluates to 51, and
1 evaluates to 1.
../../src/tests/gl_tests/ClearTest.cpp:1355: Failure
The difference between (expectedCenterColorRGB.G) and pixel[1] is 102, which
exceeds 1, where
(expectedCenterColorRGB.G) evaluates to 0,
pixel[1] evaluates to 102, and
1 evaluates to 1.
…
…
...
1 evaluates to 1.
[ FAILED ] MaskedScissoredClearTest.Test/ES2_OpenGL_clear_cd, where
GetParam() = (ES2_OpenGL, 1, 1, 0, false) (38 ms)
[----------] 1 test from MaskedScissoredClearTest (38 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (38 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] MaskedScissoredClearTest.Test/ES2_OpenGL_clear_cd, where
GetParam() = (ES2_OpenGL, 1, 1, 0, false)
1 FAILED TEST
****************************************
The pass logs on NV:
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from MaskedScissoredClearTest
[ RUN ] MaskedScissoredClearTest.Test/ES2_OpenGL_clear_cd
[ OK ] MaskedScissoredClearTest.Test/ES2_OpenGL_clear_cd (90 ms)
[----------] 1 test from MaskedScissoredClearTest (90 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (90 ms total)
[ PASSED ] 1 test.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20190719/4b537e20/attachment.html>
More information about the intel-3d-bugs
mailing list