Fix attribute mapping in enhanced layouts tests for input arrays
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 2 Oct 2017 11:10:20 +0000 (13:10 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 31 Oct 2017 09:12:53 +0000 (05:12 -0400)
commitd6144a989937b2829a9fc9813de994c4f514ebae
treefc999aa149045bcdd9677bf18d3aa6492a1d0535
parent221e522b4a0bbb55cc295bb7d5ebedb796a5ecf0
Fix attribute mapping in enhanced layouts tests for input arrays

Some tests in KHR-GL45.enhanced_layouts.varying_* (specifically
KHR-GL45.enhanced_layouts.varying_array_{locations,components})
use input arrays on the vertex shader, however, the code
that uploads vertex data for these (and other test cases) doesn't
account for arrays at all.

Also, the tests in this category that call
TextureTestBase::prepareAttributes to do the VAO setup seem to
provide inconsistent values for variable.m_descriptor.m_offset,
which also leads to incorrect vertex attribute mappings.
Specifically, in the 'component' variants of these tests
(such as varying_array_components), two different input variables
have m_offset = 0, which has the consequence that we end up
computing a vertex buffer with a size that's only big enough to
fit one of the inputs and we overwrite the data for the first
input with the data for the second input when we setup the VAO,
however, the 'location' variants (such as varying_array_locations),
see different offsets for different input variables, which leads to
a different VAO setup.

Components: OpenGL
VK-GL-CTS issue: 739

Affects:
KHR-GL45.enhanced_layouts.varying_*
KHR-GL46.enhanced_layouts.varying_*

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