diff options
author | Paul Berry <stereotype441@gmail.com> | 2011-08-09 08:41:27 -0700 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2011-08-11 13:22:11 -0700 |
commit | 9d059906dc155129729e2138b192d51139045181 (patch) | |
tree | 5113bb9d28d683b94353020a0cafa5dcf55a10be /tests/all.tests | |
parent | 8a3e129ccfe2313a3ae6c4b4855bb8082c78585d (diff) |
Add tests for gl_ClipDistance and gl_ClipVertex.
This patch is a preparation for work I'm about to do to add
gl_ClipDistance support to Mesa, and future work that I hope to do to
fix bugs in gl_ClipVertex in Mesa. It adds a thorough set of tests
for the following behaviors of gl_ClipDistance and gl_ClipVertex:
For gl_ClipVertex:
- It behaves properly when equal to gl_Position.
- It behaves properly when not equal to gl_Position.
- It falls back to gl_Position when it is not set.
- Its homogeneous coordinate is respected.
- The homogeneous coordinate is respected when falling back to gl_Position.
For gl_ClipDistance:
- It works when all 6 clip planes are enabled.
- Its behavior is properly affected by clip plane enable flags.
- It can be explicitly or implicitly sized in the vertex shader.
- It can be sized up to gl_MaxClipDistances but no higher.
- In the fragment shader, it contains properly interpolated values.
For the interaction between the two:
- It is an error to assign to both gl_ClipDistance and gl_ClipVertex.
In addition, this patch renames a few of the existing clipping tests
so that their names more clearly reflect what they're testing.
All of these tests have been validated on the proprietary nVidia
driver for Linux, except the following:
- fs-clip-distance-interpolated: this fails with the error message
"gl_ClipDistance is not accessible in this profile". Based on a
google search for this error message, I suspect this is an nVidia
driver bug. If I replace the fragment shader's reference to
gl_ClipDistance with a reference to a user-defined vertex shader
output that contains the same data, the test passes.
- vs-clip-based-on-position and
vs-clip-based-on-position-homogeneity: these tests fail--no
clipping occurs. But they pass if I add the line "gl_ClipVertex =
gl_Position;" to the end of the vertex shader. The GLSL 1.30 spec
clearly states that if neither gl_ClipVertex nor gl_ClipDistance is
statically written by the vertex shader, then gl_Position should be
used for clipping, so I conclude that this is an nVidia driver bug.
- mixing-clip-distance-and-clip-vertex-disallowed: the nVidia driver
fails to detect this error condition, in spite of clear language in
the GLSL 1.30 spec. I conclude that this is an nVidia driver bug.
Diffstat (limited to 'tests/all.tests')
-rw-r--r-- | tests/all.tests | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/all.tests b/tests/all.tests index 0de2e30ba..de64e7ec5 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -765,6 +765,10 @@ spec['glsl-1.30']['execution'] = Group() add_shader_test_dir(spec['glsl-1.30']['execution'], os.path.join(os.path.dirname(__file__), 'spec', 'glsl-1.30', 'execution'), recursive=True) +spec['glsl-1.30']['linker'] = Group() +spec['glsl-1.30']['linker']['clipping'] = Group() +add_plain_test(spec['glsl-1.30']['linker']['clipping'], 'clip-distance-not-sizeable-above-max') +add_plain_test(spec['glsl-1.30']['linker']['clipping'], 'mixing-clip-distance-and-clip-vertex-disallowed') # Group AMD_conservative_depth spec['AMD_conservative_depth'] = Group() |