Improve existing cull distance tests
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 8 Jun 2021 15:20:24 +0000 (17:20 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 29 Jun 2021 07:19:16 +0000 (07:19 +0000)
commit3acb786e3a3cf7d1cf5cbc90125196632fe27a7b
tree6fbe808b31a74815fe465bed3dc19c82c6a5b3c2
parentffc2eb70689f8d8a9078cfed75a97ef57cb2ce54
Improve existing cull distance tests

Previously the tests were just writing a constant value to
gl_CullDistance[i] in the vertex shader and copying that value in
the rest of the geometry stages.

This commit does the following:

- The last shader writting to gl_CullDistance assigns 0 if
gl_Position.y < 0 and 0.5f otherwise. That way we can test the
interpolation of gl_CullDistance in the fragment shader.

- In case there are multiple geometry shaders, all except the last one
write a different value to gl_CullDistance[i] and checks the value
written by the previous shader stage. Therefore we check the values
are properly propagated between stages and they are overwritten as
well.

Components: Vulkan
VK-GL-CTS issue: 2961

Affected tests:

    dEQP-VK.clipping.*.clip_cull_distance*

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Change-Id: I213cc0469e72d82a8eda814e770aac2b825286fc
external/vulkancts/modules/vulkan/clipping/vktClippingTests.cpp