Fix maximum location for varying location limit test
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 23 Nov 2017 08:30:35 +0000 (09:30 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 28 Nov 2017 10:29:33 +0000 (05:29 -0500)
commit43ff714ddd948a771a6690e474ce1ee9bcf9aec5
treee8c6112221651cdc56f12302395bc35526d68ced
parent6771075fd68d50de48ab391503e8e4743bb3b702
Fix maximum location for varying location limit test

The varying location limit tests for enhanced layouts produces
shader code where it attempts to use a location that is 1 slot
beyond the limit available for each shader stage and expects
linker errors as a result.

However, the functions it uses to compute the maximum location
slot available in a shader stage also consider the stage it will
be linked to to cap that limit (which is required to produce valid
shader code in other tests that also use these functions).

This affects scenarios where, for example, one stage allows up to
32 output locations but the stage it is linked to only accepts
up to 16 inputs. In such scenario, these functions will return
a limit of 16 for the stage that can output 32 so the shader code
produced can link.

However, the varying location limit test intends to produce an
invalid location by adding 1 to the maximum location slot for that
stage (so it wants to produce 32 + 1 = 33 in the case above), so
in this particular case we want the connecting stage to be
ignored.

Add a boolean flag to these functions so we can select between both
behaviors when computing the maximum location for a given stage
and make the varying location limit test force the behavior where
the maximum location in the connecting shader stages is ignored.

Components: OpenGL
VK-GL-CTS issue: 863

Affects:
KHR-GL45.enhanced_layouts.varying_location_limit
KHR-GL46.enhanced_layouts.varying_location_limit
KHR-GL45.enhanced_layouts.varying_locations
KHR-GL46.enhanced_layouts.varying_locations
KHR-GL45.enhanced_layouts.varying_array_locations
KHR-GL46.enhanced_layouts.varying_array_locations
KHR-GL45.enhanced_layouts.varying_components
KHR-GL46.enhanced_layouts.varying_components
KHR-GL45.enhanced_layouts.varying_array_components
KHR-GL46.enhanced_layouts.varying_array_components

Change-Id: If766582bf494942abdad3e1dde5e1ed8149f4333
external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.cpp
external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.hpp