platform/upstream/VK-GL-CTS.git
4 years agoExplicitly use -A Win32 platform in CMake Visual Studio 2019 builds
Slawomir Cygan [Fri, 23 Aug 2019 12:33:19 +0000 (14:33 +0200)]
Explicitly use -A Win32 platform in CMake Visual Studio 2019 builds

There is a new CMake switch "-A" for selecting a platform in
Visual Studion CMake generators.

It was set only for 64-bit builds (to x64), however it seems it does not
default to Win32 - so it must be set also for 32-bit builds.

Components: Framework

VK-GL-CTS Issue: 1950

Change-Id: I4d0e9f1a9c8dd0f3060e138f613c8e5326b6fc9f
(cherry picked from commit a653debe1b4bc8a6d0c94c774aad4f3fcdda1595)

4 years agoAdd support for building with Visual Studio 2019
Slawomir Cygan [Tue, 9 Jul 2019 10:19:26 +0000 (12:19 +0200)]
Add support for building with Visual Studio 2019

Components: Framework

Change-Id: I52c92750e9e2874b86fd7bceea0070ad609909c1
(cherry picked from commit cab8ce57b1400c6909a555973cb8393e1036e610)

4 years agoHandle gcc 7 warnings
Caio Marcelo de Oliveira Filho [Thu, 22 Feb 2018 01:54:57 +0000 (17:54 -0800)]
Handle gcc 7 warnings

- "-Wimplicit-fallthrough" warns on case conditions that
  fallthrough. GCC does have a way to accept conditions that have a
  comment about falling through inside the cases, but the codebase has
  other cases where a single comment explains the fallthrough for the
  whole switch. This warning is being ignored. It was not possible to
  use "-Wno-error=WARNING" because older GCCs fail -- but they do
  accept "-Wno-WARNING" where WARNING is unknown (since at least gcc
  4.6.4).

- "-Wint-in-bool-context" warns (among other things) about result of
  multiplication being used in boolean context. Code was changed to
  use de::max() instead.

- "-Wmaybe-uninitialized" warned about some attributes of a struct not
  being initialized depending on the case. Code was changed to
  initialize the struct in question.

Components: Framework, Vulkan

Change-Id: Iabb26f01e047353c6e2a704ab27b673e85b185be
(cherry picked from commit f1ee9253e64f7434cdba7c8ac048c0e9baccc133)

4 years agoFix GCC 7 implicit fallthrough warnings
Mika Väinölä [Tue, 20 Mar 2018 11:40:57 +0000 (13:40 +0200)]
Fix GCC 7 implicit fallthrough warnings

GCC 7 with -Wextra or -Wimplicit-fallthrough enabled warns when
a switch case falls through. For cases where this is intentional
the warning can be suppressed with a comment. Breaks and returns
were also added for cases which end in DE_FATAL.

Removing a fallthrough in vktSparseResourcesShaderIntrinsics.cpp
resulted in new test cases.

Affects: *

New tests:
dEQP-VK.sparse_resources.shader_intrinsics.3d_sparse_fetch.*

Components: Framework, Vulkan, OpenGL

VK-GL-CTS issue: 1067

Change-Id: I0306f96cf3a50e85144b4dd22a9a88cd908607d3
(cherry picked from commit 884a93c6b9bc5dc8a7fea9392b37b8fd5ea04d7b)

4 years agoAdd glu::BufferOffsetAsPointer utility
Jesse Hall [Tue, 27 Mar 2018 23:49:03 +0000 (16:49 -0700)]
Add glu::BufferOffsetAsPointer utility

Clang 6.x adds a warning that doing arithmetic involving a NULL
pointer is a GNU extension. This affects the common GL pattern
    (deUint8*)DE_NULL + offset
used to pass an offset into a bound buffer object as a client pointer
parameter.

This change replaces that pattern with a call to a new utility
function glu::BufferOffsetAsPointer(), which will hopefully be
warning-free on all compilers.

Change-Id: I8be939297b02c44091441c71ae75e45ceab30639
Components: Framework, OpenGL, AOSP
(cherry picked from commit 05d98991304fce712732124e5e12fb670ee5a799)

4 years agoFix expected errors for some DSA functions
Piers Daniell [Mon, 23 Mar 2020 22:43:24 +0000 (16:43 -0600)]
Fix expected errors for some DSA functions

The OpenGL spec was fixed recently to correct some errors
for some DSA functions in
https://github.com/KhronosGroup/OpenGL-Registry/pull/300

This CL updates the CTS to match.

Affects:

KHR-GL46.direct_state_access.textures_buffer_errors
KHR-GL46.direct_state_access.textures_buffer_range_errors
KHR-GL46.direct_state_access.textures_parameter_setup_errors

Components: OpenGL

VK-GL-CTS issue: 2275

Change-Id: I783c4ca1924cbf6aa3af82d7ac5f49db4a94978b

4 years agoUse maximum conformant sample count configuration
Peter Deayton [Fri, 7 Jun 2019 19:42:35 +0000 (12:42 -0700)]
Use maximum conformant sample count configuration

Some multisample configurations may not support the maximum renderbuffer
size.
Use GL_NV_internalformat_sample_query when available to find the
maximum conformant sample count for a given format and use that count
for further testing.

Affects:

KHR-GL46.direct_state_access.renderbuffers_storage_multisample

Components: OpenGL

VK-GL-CTS issue: 1822

Change-Id: I348fda6c6b1ee89905d3e4c307e56669e2b205d0

4 years agoFix build when .git is a gitlink file
Chad Versace [Fri, 3 Nov 2017 16:36:30 +0000 (09:36 -0700)]
Fix build when .git is a gitlink file

If ${CMAKE_SOURCE_DIR}/.git exists, then
framework/qphelper/CMakeLists.txt uses the git revision as the dEQP
revision. The CMake rules update the revision when the files
${CMAKE_SOURCE_DIR}/.git/HEAD and ${CMAKE_SOURCE_DIR}/.git/index
change.

However, Git does not require that .git be a directory. If
git-submodules or git-worktrees are used, then .git may be a gitlink
file instead and the real git directory is elsewhere.

Fix the build by using `git rev-parse --git-dir` to find the real git dir
and `git rev-parse HEAD` to query the commit sha1.

This bumps the CMake requirement from 2.8 to 2.8.2. But that should be
safe since 2.8.2 was released in 2010.

Components: Framework
Change-Id: I811630e5afada8e6aed611b0ef6c51e39be2200b
(cherry picked from commit b5cd0ad3079ea00f0d4b243280430a36594eaae4)

5 years agogl4cComputeShaderTests: correct conversion
Andres Gomez [Thu, 23 May 2019 16:34:13 +0000 (18:34 +0200)]
gl4cComputeShaderTests: correct conversion

Bug 13124 - gl45 conformance: Fix GL45-CTS.compute_shader.max to work with giant numbers
and
Bug 13582 - Checking values from glGet* incorrectly
didn't complete the job of avoiding conversion problems.

Now, we make sure that the comparison is done in the type that won't
cause a problem.

Components: OpenGL

VK-GL-CTS public issue: 149

Affects:

KHR-GLES31.core.compute_shader.dispatch-indirect
KHR-GLES31.core.compute_shader.max
KHR-GL43.compute_shader.dispatch-indirect
KHR-GL43.compute_shader.max

Change-Id: I69047d95ca4418a84f138ac9bfa7818fea45cc64

5 years agox11_egl: use correct cmake variable name for GLES1 include path
Tapani Pälli [Tue, 22 Jan 2019 12:00:23 +0000 (14:00 +0200)]
x11_egl: use correct cmake variable name for GLES1 include path

This commit reverts most of 7b4a66f99 that included a hack to search
for include directory next to the library path. This was invalid since
used variable name PKG_GLES1_INCLUDE_DIRS is false, correct name is
GLES1_INCLUDE_DIRS which is properly set by the PKG_CHECK_MODULES call.

This change has been succesfully tested on Fedora and Ubuntu distros by
setting up a custom PKG_CONFIG_PATH.

VK-GL-CTS issue: 1573

Change-Id: I158d816d28f5bbf30288f6226bd5c9e30cf85285
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
5 years agoGL_ARB_enhanced_layouts: use separable programs
Andres Gomez [Wed, 27 Feb 2019 13:03:56 +0000 (15:03 +0200)]
GL_ARB_enhanced_layouts: use separable programs

Currently we are testing bogus inputs without a matching counterpart
in the output interface of the previous shader. This is needed since,
otherwise, having a matching output would mean that we would have to
introduce the same error we are trying to test in the input interface
and that could lead to a misleading linking error.

However, not having an output counterpart can also lead to a
misleading linking error.

In other tests we have avoided this by not making a static use of the
tested input. However, when checking for the limit on the number of
input locations that can be used in a specific interface, this
strategy cannot be used since non statically used variable do not
count against this limit.

From page 48 (page 52 of the PDF) of the GLSL 4.60 v.5 spec:

  " There is an implementation-dependent limit on the number of
    locations that can be used, and if this is exceeded it will cause
    a link-time error. (Declared input variables that are not
    statically used do not count against this limit.)"

Therefore, the strategy used for this test is to build individual
separable programs for each stage.

From the ARB_separate_shader_objects spec v.25:

  " With separable program objects, interfaces between shader stages
    may involve the outputs from one program object and the inputs
    from a second program object.  For such interfaces, it is not
    possible to detect mismatches at link time, because the programs
    are linked separately.  When each such program is linked, all
    inputs or outputs interfacing with another program stage are
    treated as active.  The linker will generate an executable that
    assumes the presence of a compatible program on the other side of
    the interface.  If a mismatch between programs occurs, no GL error
    will be generated, but some or all of the inputs on the interface
    will be undefined."

Components: OpenGL

VK-GL-CTS issue: 1628

Affects:

KHR-GL44.enhanced_layouts.varying_location_limit

Change-Id: If120f3f2d397be0b53c60033768db60eb6fed968

5 years agoGL_ARB_enhanced_layouts: no structs as VS inputs
Andres Gomez [Thu, 3 Jan 2019 12:17:18 +0000 (14:17 +0200)]
GL_ARB_enhanced_layouts: no structs as VS inputs

From page 48 (page 52 of the PDF) of the GLSL 4.60 v.5 spec:

  " It is a compile-time error to declare a vertex shader input with,
    or that contains, any of the following types:

      * A boolean type

      * An opaque type

      * A structure"

Components: OpenGL

VK-GL-CTS issue: 1614

Affects:

KHR-GL44.enhanced_layouts.varying_structure_member_location

Change-Id: Ied52fd09639de179db480b6a627b65208a54250a

5 years agoGL_ARB_enhanced_layouts: remove dead code
Andres Gomez [Wed, 23 Jan 2019 16:28:59 +0000 (18:28 +0200)]
GL_ARB_enhanced_layouts: remove dead code

Additionally, make us of the new debugging macro to ease checking that
we are testing just the correct and only cause for a failure report.

Components: OpenGL

VK-GL-CTS issue: 1617

Affects:

KHR-GL44.enhanced_layouts.xfb_duplicated_stride

Change-Id: I2bb03db22743ae12d17c3da1654d082236d2e2e6

5 years agoGL_ARB_enhanced_layouts: fix interstage interfaces
Andres Gomez [Wed, 9 Jan 2019 15:38:12 +0000 (17:38 +0200)]
GL_ARB_enhanced_layouts: fix interstage interfaces

Multiple test were reporting misleading fails due to out-in interface
mismatching.

Additionally, removed dead code paths.

Finally, make us of the new debugging macro to ease checking that we
are testing just the correct and only cause for a failure report.

Components: OpenGL

VK-GL-CTS issue: 1608

Affects:

KHR-GL44.enhanced_layouts.xfb_block_member_buffer
KHR-GL44.enhanced_layouts.xfb_capture_unsized_array
KHR-GL44.enhanced_layouts.xfb_exceed_buffer_limit
KHR-GL44.enhanced_layouts.xfb_exceed_offset_limit
KHR-GL44.enhanced_layouts.xfb_invalid_offset_alignment
KHR-GL44.enhanced_layouts.xfb_multiple_vertex_streams
KHR-GL44.enhanced_layouts.xfb_output_overlapping
KHR-GL44.enhanced_layouts.xfb_too_small_stride

Change-Id: I0fb8f851b7cbec4c8cb4ee9fbad544c32e130a99

5 years agoGL_ARB_enhanced_layouts: fix interstage interfaces
Andres Gomez [Wed, 23 Jan 2019 15:56:33 +0000 (17:56 +0200)]
GL_ARB_enhanced_layouts: fix interstage interfaces

This test was reporting a misleading fail due to out-in interface
mismatching.

Additionally, in the past another "fail" status was "corrected" by
excluding all non-positive cases making it, actually, not a negative
test. Now, while fixing the problems in the interface matching, we
re-introduce the negative cases back.

Also, removed dead code paths.

Finally, make us of the new debugging macro to ease checking that
we are testing just the correct and only cause for a failure report.

Components: OpenGL

VK-GL-CTS issue: 1607

Affects:

KHR-GL44.enhanced_layouts.xfb_variable_stride

Change-Id: If6564a9feb9831d101b0d5073ec3d241a4a8ac81

5 years agoGL_ARB_enhanced_layouts: use centroid and sample
Andres Gomez [Mon, 7 Jan 2019 23:18:40 +0000 (01:18 +0200)]
GL_ARB_enhanced_layouts: use centroid and sample

When checking for aliasing using mixed auxiliary storages, the tests
checking the usage of centroid and sample were only for the fragment
shader inputs. These qualifiers, although ignored, can also be used in
the rest of the stages.

Components: OpenGL

VK-GL-CTS issue: 1613

Affects:

KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_auxiliary_storage

Change-Id: I4ec1609a63a225ccd8c2ed7b82eb5477a04b6cba

5 years agoGL_ARB_enhanced_layouts: mind double types
Andres Gomez [Mon, 7 Jan 2019 23:00:49 +0000 (01:00 +0200)]
GL_ARB_enhanced_layouts: mind double types

The special conditions when using the component qualifier with doubles
were not taken into account.

Additionally, the test was reporting a misleading fail due to
non-coherent usage of the "flat" interpolation qualifier. This is now
fixed.

Finally, the generator has been simplified using the refactored code.

Components: OpenGL

VK-GL-CTS issue: 1611

Affects:

KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_auxiliary_storage

Change-Id: I4380ba720f4ea2b2326484d6c8b3e8fc58b1b5e5

5 years agoGL_ARB_enhanced_layouts: mind double types
Andres Gomez [Mon, 18 Feb 2019 14:49:28 +0000 (16:49 +0200)]
GL_ARB_enhanced_layouts: mind double types

The special conditions when using the component qualifier with doubles
were not taken into account.

Additionally, the generator has been simplified using the refactored
code.

Components: OpenGL

VK-GL-CTS issue: 1616

Affects:

KHR-GL44.enhanced_layouts.input_component_aliasing
KHR-GL44.enhanced_layouts.output_component_aliasing
KHR-GL44.enhanced_layouts.varying_component_of_invalid_type
KHR-GL44.enhanced_layouts.varying_component_without_location
KHR-GL44.enhanced_layouts.varying_exceeding_components

Change-Id: I33c9735a8ef02cf5257f6783cf7856911e4af9d8

5 years agoGL_ARB_enhanced_layouts: use component 0 for mat
Andres Gomez [Thu, 20 Dec 2018 15:29:13 +0000 (17:29 +0200)]
GL_ARB_enhanced_layouts: use component 0 for mat

When checking types that won't support the component qualifier, in the
case of matrixes, just use the universally accepted value in case the
keyword would be accepted: 0.

Otherwise, we won't be sure whether the test is passing because the
reported failure is the expected one: that matrix won't accept the
component qualifier.

Components: OpenGL

VK-GL-CTS issue: 1615

Affects:

KHR-GL44.enhanced_layouts.varying_component_of_invalid_type

Change-Id: I5e53ecdcb4e73f9ca528f3232bfa9405782db43e

5 years agoGL_ARB_enhanced_layouts: mind double types
Andres Gomez [Mon, 7 Jan 2019 17:46:16 +0000 (19:46 +0200)]
GL_ARB_enhanced_layouts: mind double types

The special conditions when using the component qualifier with doubles
were not taken into account.

The tests generator is now simplified using the refactored code.

Components: OpenGL

VK-GL-CTS issue: 1610

Affects:

KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_interpolation

Change-Id: I44763cf9e9e3b11fe17519ab307b28cc5485706d

5 years agoGL_ARB_enhanced_layouts: mind aliasing bit width
Andres Gomez [Fri, 4 Jan 2019 12:46:27 +0000 (14:46 +0200)]
GL_ARB_enhanced_layouts: mind aliasing bit width

Currently, when location aliasing was happening, we were only checking
if the underlying numerical type was the same to allow it.

From page 67 (page 71 of the PDF) of the GLSL 4.60 v.5 spec:

  " Further, when location aliasing, the aliases sharing the location
    must have the same underlying numerical type and bit
    width (floating-point or integer, 32-bit versus 64-bit, etc.)"

Additionally, we were repeating two times the same tests. For example
we would check if, with float and int, they would be allowed if float
was in the component 1 and int in component 3 two times. The test
generation has been now simplified.

Components: OpenGL

VK-GL-CTS issue: 1609

Affects:

KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_types

Change-Id: I33652ac447c0a536bebc8175f34abee45ad1cd2e

5 years agoFix context creation in robust_buffer_access_behavior test
Slawomir Cygan [Fri, 1 Mar 2019 14:45:39 +0000 (15:45 +0100)]
Fix context creation in robust_buffer_access_behavior test

Move the context creation routine to iterate() method of
tests cases, to avoid overlapping many contexts where
all tests case constructors are fired at once.

Components: OpenGL

VK-GL-CTS Issue: 1629

Affects:
    KHR-GL4*.robust_buffer_access_behavior.*

Change-Id: I28658b41891437ef60a5bfd5d0a19b80342e9f1f

5 years agoGL_ARB_enhanced_layouts: fix arrays in {G,TC,TE}S
Andres Gomez [Thu, 3 Jan 2019 09:21:48 +0000 (11:21 +0200)]
GL_ARB_enhanced_layouts: fix arrays in {G,TC,TE}S

Several negative tests were reporting a misleading fail due to
mismatching output array dimensions in the TCS, TES and GS interfaces.

Components: OpenGL

VK-GL-CTS issue: 1606

Affects:

KHR-GL44.enhanced_layouts.output_component_aliasing
KHR-GL44.enhanced_layouts.varying_block_automatic_member_locations
KHR-GL44.enhanced_layouts.varying_component_of_invalid_type
KHR-GL44.enhanced_layouts.varying_component_without_location
KHR-GL44.enhanced_layouts.varying_exceeding_components
KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_auxiliary_storage
KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_interpolation
KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_types
KHR-GL44.enhanced_layouts.varying_location_limit
KHR-GL44.enhanced_layouts.varying_structure_member_location

Change-Id: I7450cdd41b72b8aca0c6e4638332eaa56a1ed954

5 years agoGL_ARB_enhanced_layouts: no static use of inputs
Andres Gomez [Thu, 3 Jan 2019 10:07:02 +0000 (12:07 +0200)]
GL_ARB_enhanced_layouts: no static use of inputs

Currently we are testing bogus inputs without a matching counterpart
in the output interface of the previous shader. This is needed since,
otherwise, having a matching output would mean that we would have to
introduce the same error we are trying to test in the input
interface and that could lead to a misleading linking error.

However, not having an output counterpart can also lead to a
misleading linking error. We workaround this by not making a static
use of the tested input.

From page 47 (page 53 of the PDF) of the GLSL 4.60 v.5 spec:

  " Only the input variables that are statically read need to be
    written by the previous stage; it is allowed to have superfluous
    declarations of input variables."

Additionally, make us of the new debugging macro to ease checking that
we are testing just the correct and only cause for a failure report.

Components: OpenGL

VK-GL-CTS issue: 1605

Affects:

KHR-GL44.enhanced_layouts.varying_block_automatic_member_locations
KHR-GL44.enhanced_layouts.varying_block_member_locations
KHR-GL44.enhanced_layouts.varying_component_of_invalid_type
KHR-GL44.enhanced_layouts.varying_component_without_location
KHR-GL44.enhanced_layouts.varying_exceeding_components
KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_auxiliary_storage
KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_interpolation
KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_types
KHR-GL44.enhanced_layouts.varying_structure_member_location
KHR-GL44.enhanced_layouts.xfb_input

Change-Id: I7dc136b34747f40b25b7cc2b6e3f35f029f701f7

5 years agoGL_ARB_enhanced_layouts: add missing out varyings
Andres Gomez [Fri, 28 Dec 2018 18:52:13 +0000 (20:52 +0200)]
GL_ARB_enhanced_layouts: add missing out varyings

The test was "passing" due to a different error than the one expected
by the test: there were missing output varyings to be able to match
the tested inputs.

Components: OpenGL

VK-GL-CTS issue: 1604

Affects:

KHR-GL44.enhanced_layouts.input_component_aliasing

Change-Id: I038bdc3a08ed1d458c8b0988227307c5f0f3f104

5 years agoGL_ARB_enhanced_layouts: correct usage of "flat"
Andres Gomez [Thu, 20 Dec 2018 14:31:14 +0000 (16:31 +0200)]
GL_ARB_enhanced_layouts: correct usage of "flat"

Multiple negative tests were failing due to errors in the usage of the
flat interpolation qualifier. Therefore, the tests were "passing"
while the expected error was a different one than the one reported by
the test.

Additionally, make us of the new debugging macro to ease checking that
we are testing just the correct and only cause for a failure report.

Components: OpenGL

VK-GL-CTS issue: 1603

Affects:

KHR-GL44.enhanced_layouts.input_component_aliasing
KHR-GL44.enhanced_layouts.output_component_aliasing
KHR-GL44.enhanced_layouts.varying_component_of_invalid_type
KHR-GL44.enhanced_layouts.varying_component_without_location
KHR-GL44.enhanced_layouts.varying_exceeding_components
KHR-GL44.enhanced_layouts.varying_location_aliasing_with_mixed_types
KHR-GL44.enhanced_layouts.varying_location_limit

Change-Id: I63f2b11acadfb0b3e42b7e0f176421eaff4da482

5 years agoGL_ARB_enhanced_layouts: no def in untested stage
Andres Gomez [Thu, 3 Jan 2019 13:19:17 +0000 (15:19 +0200)]
GL_ARB_enhanced_layouts: no def in untested stage

Currently we are trying to match the definition of the output block
with the input block. In a negative test this has the problem that we
cannot actually match without adding the same error we are trying to
test in both interfaces. Therefore, as it is right now, even if the
tested error wouldn't happen, a misleading linking error will happen.

We avoid this by removing the input definition when testing
outputs (no need to have them at all) and, in the reverse situation,
additionally, by not doing static use of the defined input variable.

Additionally, this simplifies the test a lot.

Finally, added a debugging macro to ease checking that we are testing
just the correct and only cause for a failure report.

Components: OpenGL

VK-GL-CTS issue: 1602

Affects:

KHR-GL44.enhanced_layouts.varying_block_member_locations

Change-Id: Ia2c0ba705e975817999aaa16c1ce129d616540f6

5 years agoCreate context with CONTEXT_ROBUST for robust buffer access tests
asokolow [Wed, 6 Feb 2019 09:12:28 +0000 (10:12 +0100)]
Create context with CONTEXT_ROBUST for robust buffer access tests

These tests exercise functionality that is not available in default
context provided by the framework. New context, with CONTEXT_ROBUST
(WGL|GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB) flag is created for these
tests.

Component: OpenGL

VK-GL-CTS Issue: 1588

Affects:
KHR-GL4*.robust_buffer_access_behavior.*

Change-Id: Ie698a6a434426bf147a705cc487b4fbe560a79c7

5 years agoFix deleting texture in DSA test
asokolow [Tue, 22 Jan 2019 06:29:33 +0000 (07:29 +0100)]
Fix deleting texture in DSA test

Components: OpenGL

VK-GL-CTS Issue: 1571

Affects:
KHR-GL45.direct_state_access.framebuffers_get_attachment_parameters

Change-Id: Ic15929f20f983e154263a79f9163b04c80b808d9

5 years agoFix GL errors expected for glClearNamedBufferData and glClearNamedBufferSubData
asokolow [Thu, 20 Sep 2018 09:56:25 +0000 (11:56 +0200)]
Fix GL errors expected for glClearNamedBufferData and glClearNamedBufferSubData

The spec says:

"An INVALID_VALUE error is generated if type is not one of the types in
table 8.2.
An INVALID_VALUE error is generated if format is not one of the formats
in table 8.3."

However, the test was expecting INVALID_ENUM

Components: OpenGL

VK-GL-CTS Issue: 1572

Change-Id: Ibcb338061584af48026b291c4372303c083102ea
Affects: KHR-GL45.direct_state_access.buffers_errors

5 years agoTerminate EGL display after use
Yogesh Gole [Wed, 17 Oct 2018 11:21:19 +0000 (16:51 +0530)]
Terminate EGL display after use

Previously function getDefaultEglConfigList destroyed native
display but did not terminate the EGL display. It may happen
that next create call will allocate native display at same
address as previous and as per spec multiple calls made to
eglGetPlatformDisplayEXT with the same <platform> and
<native_display> will return the same EGLDisplay handle. But
returned EGLDisplay will have references to stale data.

To fix this destroy the EGL Display along with native display.

Affects: CTS-Configs.*

Components: OpenGL and Framework

VK-GL-CTS Issue: 1426

Change-Id: I8e4c7d693d26bd9be6d7f892d0b5162d9b2b245c
(cherry picked from commit 90b601fa8d5c6ca10aca7b3ebb50c02400cb0049)

5 years agoUse non-arrayed varying name for TCS blocks
Piers Daniell [Tue, 2 Oct 2018 17:51:25 +0000 (11:51 -0600)]
Use non-arrayed varying name for TCS blocks

This is a partial revert of CL 2625 to restore naming the
value member of the BLOCK_INOUT interface block as
"BLOCK_INOUT.value" rather than "BLOCK_INOUT[0].value".

Affects:

KHR-GL46.tessellation_shader.single.xfb_captures_data_from_correct_stage

Components: OpenGL

VK-GL-CTS issue: 1388

Change-Id: I9ef6453ec5465a0fa5561220cc9d7bfe54298416

5 years agoUpdate KC CTS
Alexander Galazin [Tue, 9 Oct 2018 09:01:22 +0000 (11:01 +0200)]
Update KC CTS

Components: Framework

VK-GL-CTS issue: 1404

Change-Id: Ia7b13ef1b8618b92cab3d4ebe6f593dbf1512fdc

5 years agoAdd screenLayout to AndroidManifest configChanges
Robert Tray [Fri, 14 Sep 2018 22:32:57 +0000 (16:32 -0600)]
Add screenLayout to AndroidManifest configChanges

Specify that dEQP will handle screenLayout config changes in the
manifest so the Android framework doesn't try to stop and restart dEQP.
dEQP can't handle a restart and just exits.

Update the minSdkVersion and targetSdkVersion to match what is
used for Khronos Vulkan dEQP manifest.  Android P will launch the
DeprecatedTargetSdkVersionDialog if the sdk version is not recent
enough.

Test: deqp

Cherry-pick from https://android-review.googlesource.com/c/platform/external/deqp/+/757202
VK-GL-CTS Issue: 1357
Affects: OpenGL/OpenGL ES Android build

Change-Id: Ia9befb1d65752ece3ea5778ba1301a134559334a

5 years agoUpdate KC CTS
Alexander Galazin [Fri, 14 Sep 2018 14:50:45 +0000 (16:50 +0200)]
Update KC CTS

Components: Framework

Change-Id: I227ab78c00577ee6ea8e90292b01d7abe3ddd2e6

5 years agoScale texture sizes to fit within available memory
James Helferty [Tue, 31 Jul 2018 19:12:08 +0000 (15:12 -0400)]
Scale texture sizes to fit within available memory

The change makes use of platform-specific information to scale the
dimensions of textures used by the advanced shader image load store
tests so they fit inside available memory.

Affects:

KHR-GL*.shader_image_load_store.advanced-copyImage
KHR-GL*.shader_image_load_store.advanced-memory-order
KHR-GL*.shader_image_load_store.advanced-sso-perSample
KHR-GL*.shader_image_load_store.advanced-sso-simple
KHR-GL*.shader_image_load_store.advanced-sso-subroutine
KHR-GL*.shader_image_load_store.advanced-sync-imageAccess2

Components: OpenGL

VK-GL-CTS issue: 1314

Change-Id: I06e7e4629b0e00f0ca5c152df56c09bbdcc05247

5 years agoFree framebuffer objects after use.
James Helferty [Tue, 14 Aug 2018 20:56:59 +0000 (16:56 -0400)]
Free framebuffer objects after use.

Avoid leaking framebuffer objects in verifyLookupTextureData methods.

Affects:

KHR-GL4*.sparse_texture_clamp_tests.SparseTextureClampLookupColor
KHR-GL4*.sparse_texture_clamp_tests.SparseTextureClampLookupResidency

Components: OpenGL

VK-GL-CTS issue: 1312

Change-Id: I12aedd34fa80dbd9061ac174ce622a976019396d

5 years agoDo not expect TCS shader with XFB variables to fail linkging in GL
asokolow [Tue, 12 Jun 2018 08:59:10 +0000 (10:59 +0200)]
Do not expect TCS shader with XFB variables to fail linkging in GL

The test tries to link shader with XFB variables in TCS, without TES stage.
The test expects the shader to fail linking, but this behavior does not
seem to be mandated by GL spec.

According to GL 4.6 spec (
https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf - page 387)
- It is not forbidden to use TransformFeedbackVaryings with Tessellation Control
Shader and the spec does not mandate linking failure, even without NV_gpu_shader5
extension.

Test seems to derive this behavior from OGL ES spec where XFB is not allowed
within TCS shader.

Components: OpenGL

VK-GL-CTS Issue: 1221

Affects:
KHR-GL45.tessellation_shader.single.xfb_captures_data_from_correct_stage

Change-Id: Ie7c4209e0a36d48e56df04030ed095741bda155a

5 years agobufSize of glGetInternalformativ does not follow spec
Pierre Tsai [Thu, 2 Aug 2018 15:13:14 +0000 (11:13 -0400)]
bufSize of glGetInternalformativ does not follow spec

In the specification section 22.3 Internal Format Queries
(glspec46.core.pdf page 564), it is written:
No more than bufSize integers will be written into params.

The confusion may come from the man page where in one point it is said:
"No more than bufSize basic machine units will be written to this
memory." But the above description is still a number of integers.

Affects:

KHR-GL46.sparse_texture_tests.SparseDSATextureCommitment
KHR-GL46.sparse_texture_tests.SparseTextureAllocation
KHR-GL46.sparse_texture_tests.SparseTextureCommitment
KHR-GL46.sparse_texture_tests.TextureParameterQueries
KHR-GL46.sparse_texture_tests.InternalFormatQueries

Components: OpenGL

VK-GL-CTS issue: 1296

Change-Id: I05ea0cbe54539f6f8711278cb7b08ad7e5862aa9

5 years agoFix resource leaks in arrays_of_arrays
Mark Adams [Fri, 3 Aug 2018 21:47:39 +0000 (17:47 -0400)]
Fix resource leaks in arrays_of_arrays

The compute shader variants of the subroutine tests weren't freeing
the programs and not resetting all state. This resulted in leaked
memory on each test iteration.

VK-GL-CTS issue: 1298

Components: OpenGL

Affects:
KHR-GL*.arrays_of_arrays_gl.Subroutine*

Change-Id: Ia2152476c12f2141698dadd1b208090b28756ce3

5 years agoDon't used a fragment output in the shader storage buffer object test
Dave Airlie [Mon, 30 Apr 2018 04:51:38 +0000 (05:51 +0100)]
Don't used a fragment output in the shader storage buffer object test

This test doesn't require a fragment shader output, and if we are
on a system which has only 8 combined shader output resources,
this stops the test from executing.

Components: OpenGL
VK-GL-CTS Issue: 985
Affects:
KHR-GL45.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std430-vec

Change-Id: Ib0883e09d84022c1dac5bc2f22787c0e91efba1c

5 years agoTextureBarrier required for texture_view.coherency
Neil Monday [Mon, 9 Jul 2018 13:38:16 +0000 (09:38 -0400)]
TextureBarrier required for texture_view.coherency

The third paragraph in section 9.3.1 gives conditions when
texture/framebuffer texture reads/writes are undefined. I
think that this test requires a TextureBarrier as described
in the last bullet point.

Affects:

KHR-GL46.texture_view.coherency

Components: OpenGL

VK-GL-CTS issue: 1183

Change-Id: I231ffd5acd089ebc1a9e0265c2f4a97f2a5c525c

5 years agoInterface mismatch in KHR-GL45.enhanced_layouts.xfb_block_stride
asokolow [Fri, 30 Mar 2018 09:30:41 +0000 (11:30 +0200)]
Interface mismatch in KHR-GL45.enhanced_layouts.xfb_block_stride

There is an interface mismatch between Vertex and Geometry shaders
used in this test. VS is lacking an output variable that GS is reading.

VK-GL-CTS Issue: 1223

Components: OpenGL

Affects: KHR-GL45.enhanced_layouts.xfb_block_stride

Change-Id: I597f5dd8b553a0a47fe00eebb701822e9ef8f678

5 years agoFormat mismatch between bound texture and image layout specifier
asokolow [Tue, 12 Jun 2018 08:59:10 +0000 (10:59 +0200)]
Format mismatch between bound texture and image layout specifier

According to GL 4.6 spec
(https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf - page 291)
- Any image variable used for shader loads or atomic memory operations must be
declared with a format layout qualifier matching the format of its associated
image unit.

Currently test binds the texture as GL_RGAB32UI but shader expects it to be
rgba32f. According to table 8.26 this leads to format mismatch.

Components: OpenGL

VK-GL-CTS Issue: 1222

Affected:
KHR-GL45.shader_atomic_counter_ops_tests.*

Change-Id: Ib55594371b234919b912753a4d2da1f426b55a82

5 years agoMax compiler threads only specifies a suggestion
Neil Monday [Wed, 27 Jun 2018 20:29:07 +0000 (16:29 -0400)]
Max compiler threads only specifies a suggestion

In this test, it is expected that calling MaxShaderCompilerThreadsKHR()
with a count of 0 will compile non-parallel. However, the extension
purposefully says this is only a  "request" for non-parallel compiling
or linking.

This change will remove this specific test.

Affects:

parallel_shader_compile.compilation_completion_non_parallel

Components: OpenGL

VK-GL-CTS issue: 1226

Change-Id: I49214b3b32b4991ee7b96aad3853e24075c0f137

6 years agoExclude texture_view.view_classes
Alexander Galazin [Fri, 1 Jun 2018 10:30:10 +0000 (12:30 +0200)]
Exclude texture_view.view_classes

Exclude KHR-GL*.texture_view.view_classes tests
as per approved waiver VK-GL-CTS 1190

Components: OpenGL

Affects: mustpass

VK-GL-CTS issue 1141, 1190

Change-Id: I593e122b7af7cd4cd96e98400c0a876321803f78

6 years agoSparse Texture tests not following spec
Your Name [Fri, 13 Apr 2018 20:06:03 +0000 (16:06 -0400)]
Sparse Texture tests not following spec

CTS is testing texture types that are incompatible
with Sparse Textures.

Affects:

KHR-GL46.sparse_texture_tests.SparseDSATextureCommitment
KHR-GL46.sparse_texture_tests.SparseTextureAllocation
KHR-GL46.sparse_texture_tests.SparseTextureCommitment
KHR-GL46.sparse_texture_tests.TextureParameterQueries
KHR-GL46.sparse_texture_tests.InternalFormatQueries

1.If 1D/1D array are not clear in the spec, then CTS should delete test
1D/1D array

2.GL_TEXTURE_2D shoule set depth = 1

3.sparse texture should create width/height/depth less than page size

4.Target GL_TEXTURE_BUFFER, GL_RENDERBUFFER,
GL_TEXTURE_2D_MULTISAMPLE,GL_TEXTURE_2D_MULTISAMPLE_ARRAY are not in
the spec, so all of them sohuld be delete.

Components: OpenGL

VK-GL-CTS issue: 1121

Change-Id: I144886ae57769be85f430127d8d4211f9554a1b2

6 years agoWrong shaders in glcParallelShaderCompileTests.cpp
Rahul Jain [Mon, 21 May 2018 11:48:01 +0000 (17:18 +0530)]
Wrong shaders in glcParallelShaderCompileTests.cpp

In glcParallelShaderCompileTests.cpp:50
it is written as
"int main() {\n"

which is invalid as per spec.

As per spec GLSL 4.60, section 6.1 last paragraph:
It is a compile-time or link-time error to declare or define a function
main with any other parameters or return type.

in glcParallelShaderCompileTests.cpp:55

it is written as "out ver4 fragColor;\n"
it should be "out vec4 fragColor;\n"

there is no data type as "ver4"

Affects:
KHR-GL46.parallel_shader_compile.compilation_completion_parallel

Components: OpenGL

VK-GL-CTS issue: 1182

Change-Id: I2f213eeaf28039c1f36b7772257090d81e1f013e

6 years agoFixes wrong MIN_MAP_BUFFER_ALIGNMENT limit
Rahul Jain [Tue, 8 May 2018 11:16:49 +0000 (16:46 +0530)]
Fixes wrong MIN_MAP_BUFFER_ALIGNMENT limit

As per GL spec 4.6 P:632, Table 23.55,
It is given that MIN_MAP_BUFFER_ALIGNMENT should be aleast 64 or higher
Currently CTS test is limiting to 64 as maximum.

Affects:

KHR-GL46.limits.min_map_buffer_alignment
KHR-GL46.map_buffer_alignment.query
KHR-GL46.map_buffer_alignment.functional

Components: OpenGL

VK-GL-CTS issue: 1158

Change-Id: I6e4feea6e91bbf0e030b0dfcdbc49c716ffd8145

6 years agoThis change fixes an issue in BindBufferOffsetEXT
BMiles [Mon, 19 Mar 2018 18:46:26 +0000 (14:46 -0400)]
This change fixes an issue in BindBufferOffsetEXT

Change hard coded 0 to i for iterating in a loop
The test needs to be iterating through the indices of the buffer.

Affects: KHR-GL4*.transform_feedback.capture_vertex_separate_test

Components: OpenGL

VK-GL-CTS issue: 1108

Change-Id: I0654bf453c05fddad2e10c9843b9130619f4844a

6 years agoFix glTransformFeedbackBufferRange defintion
asokolow [Mon, 12 Mar 2018 07:45:11 +0000 (08:45 +0100)]
Fix glTransformFeedbackBufferRange defintion

There is a mismatch between TransformFeedbackBufferRange
definitions in test and OpenGL spec.

The last parameter type is GLsizeiptr accoding
to spec (and XML registry).

Components: OpenGL

VK-GL-CTS Issue: 1093

Affects:
KHR-GL45.direct_state_access.xfb_buffers

Change-Id: Iaf688016234de106b642593d9808d88c7d765edd

6 years agoMove khr_debug tests to NoContext
Michael Chock [Thu, 8 Mar 2018 19:41:05 +0000 (11:41 -0800)]
Move khr_debug tests to NoContext

As implemented, the KHR-GL4*.khr_debug.* tests can terminate the EGL
display used by other tests. As recommended, move these tests to the
KHR-NoContext.* group.

Since the test names are already changing, fix the spelling of
'receiving' in one test case.

Components: OpenGL

VK-GL-CTS Issue: 1062

Renamed tests:
KHR-GL4*.khr_debug.* -> KHR-NoContext.gl43.khr_debug.*

Change-Id: I766131f77206cad1cb34955426a81cf10b50e159

6 years agoFixes for sparse texture clamp tests.
Michael Chock [Tue, 27 Feb 2018 23:22:46 +0000 (15:22 -0800)]
Fixes for sparse texture clamp tests.

When initializing the test texture, bind to an image unit, setting the
layered parameter to GL_TRUE instead of GL_FALSE. For array textures,
the compute shader used indexes all layers of the textures. For
non-array textures, the parameter has no effect.

For cube map array textures, copy vertex array data to a higher-scoped
memory location, such that the draw call is not invoked with a dangling
pointer.

Swap the Z and W coordinates of the texture size calculated by shaders,
such that Z is the number of cube faces, and W is the number of layers
(which is how the coordinates were otherwise already being used).

Set up texture coordinates for KHR-GL46.sparse_texture_clamp_tests.*
such that the fragment shader correctly computes layer and face indices,
given the corrected texture size and existing shader generation logic.

Components: OpenGL

VK-GL-CTS issue: 1042

Affects:
KHR-GL46.sparse_texture_clamp_tests.*
KHR-GL46.sparse_texture2_tests.*

Change-Id: Ifd33b34b33494ad35f0eb48a9b4aa0ade3bb2d04

6 years agoSparseTextureAlloc check for GL_NV_deep_texture3D
Liam Middlebrook [Fri, 19 Jan 2018 23:04:34 +0000 (15:04 -0800)]
SparseTextureAlloc check for GL_NV_deep_texture3D

When running the
SparseTextureAllocationTestCase::verifyTexStorageInvalidValueErrors test
we need to check if the GL_NV_deep_texture3D extension is supported. If
so we can't compare the depth of the texture against the
GL_MAX_3D_TEXTURE_SIZE attribute that is intended for symmetric texture
limits. Instead we need to check against GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV
provided the texture width and height are within the acceptable ranges
for a deep texture.

Components: OpenGL

VK-GL-CTS issue: 959

Change-Id: I0e404d6851724b0624d0802603a12aea3af220e5
Reviewed-by: ewerness
6 years agoFix ClearOpsBufferStorageTestCase on ppc64le
Liam Middlebrook [Wed, 17 Jan 2018 05:17:38 +0000 (21:17 -0800)]
Fix ClearOpsBufferStorageTestCase on ppc64le

The check for the modified ClearOpsBufferStorageTestCase output currently checks
if the value present in the mapped buffer from GL is equivalent to the
calculated value under the following scheme:

    (data_rgba8 & (0xFF << (n_current_byte * 8))) >> (n_current_byte * 8)

The C++ Working Draft Standard N4140 [1] Section 5.8
states the following:

    The behavior is undefined if the right operand is negative or greater than
    or equal to the length in bits of the promoted left operand.

Similar language is also stated in the C Working Draft Standard N1256 [2]

    If the value of the right operand is negative or is greater than or equal to
    the width of the promoted left operand, the behavior is undefined.

This change removes the undefined behavior that is being used to set
`expected_value`.

Additionally this change makes the literal 0xFF into 0xFFu since all of the
other components surrounding it are unsigned.

References:

[1] https://timsong-cpp.github.io/cppwp/n4140/draft.pdf
[2] http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf

Components: OpenGL
VK-GL-CTS issue: 955
Change-Id: I8f1a25b184379c966355e6d0dec81b1416049279
Reviewed-By: pdaniell
6 years agoFix XCreateWindow BadMatch with depth 32 visuals
Robert Morell [Wed, 10 Jan 2018 21:31:33 +0000 (13:31 -0800)]
Fix XCreateWindow BadMatch with depth 32 visuals

For the common case of a depth 24 root window, when creating a window
with a visual of depth 32, attempting to use a depth of CopyFromParent
will result in a BadMatch error.

Fix this by passing the visual's depth to XCreateWindow explicitly --
fortunately the VisualInfo structure was already queried.

Components: Framework

VK-GL-CTS issue: 938

Change-Id: I54b142b6105c7f328e76d7ea0f9b01e635380e4e

6 years agoFix checks for maximum number of samples
Iago Toral Quiroga [Fri, 12 Jan 2018 09:11:42 +0000 (10:11 +0100)]
Fix checks for maximum number of samples

Some tests query MAX_SAMPLES and/or MAX_INTEGER_SAMPLES, then
attempt to create FBOs passing MAX_SAMPLES+1 samples and
expecting an error to be reported.

There are a couple of bugs in these tests:

1. One uses GL_RGB10_A2UI which is an integer format and should
   use MAX_INTEGER_SAMPLES instead of MAX_SAMPLES (this is actually
   what the comment above the call says it is doing).

2. Formats can actually support more samples than
   MAX_SAMPLES. As stated for the SAMPLES internal format query:

   "The maximum value in SAMPLES is guaranteed to be at least
    the lowest of the following:
    (...)
    * The value of MAX_SAMPLES"

   The key aspect here is "at least", which means that the
   maximum number reported in SAMPLES can be larger than any
   of the values in the list, which includes MAX_SAMPLES.

As a consequence of 2), it is possible for these tests to fail
because MAX_SAMPLES+1 is a valid number of samples for the target
internal format and not an invalid number like the test intended.

This patch modifies the affected tests to query SAMPLES for the
internal formats used in the checks so we have the actual maximum
number of sample counts supported for each one, that way we ensure
that SAMPLES+1 is always an invalid number of samples.

Components: OpenGL

Vk-GL-CTS issue: 944

Affects:
KHR-GL45.direct_state_access.renderbuffers_storage_multisample_errors
KHR-GL46.direct_state_access.renderbuffers_storage_multisample_errors
KHR-GL45.direct_state_access.textures_storage_errors
KHR-GL46.direct_state_access.textures_storage_errors

Change-Id: Ic294fe866a3d574fe0321821713d3258027db73b

6 years agoLoosen color target tolerances for some tests
Michael Chock [Tue, 16 Jan 2018 22:57:49 +0000 (14:57 -0800)]
Loosen color target tolerances for some tests

Some tests verify the results of glReadPixels within two bits of
tolerance. However, some pixel formats (e.g., RGB 565) cannot support
such precision. Loosen hard-coded tolerances, such that tests can pass
with 5-bit color channels.

Additionally change the types of some variables from GLubyte to int. Log
messages constructed through stream operators would treat such values as
characters, rather than numeric quantities.

Components: OpenGL

VK-GL-CTS issue: 950

Affects:
KHR-GL46.indirect_parameters_tests.MultiDrawArraysIndirectCount
KHR-GL46.indirect_parameters_tests.MultiDrawElementsIndirectCount
KHR-GL46.shader_atomic_counter_ops_tests.*
KHR-GL46.shader_viewport_layer_array.*

Change-Id: I7da30842004caf1698d83128678c1bda82fff787

6 years agoRemove use of unsupported SURFACETYPE_OFFSCREEN_GENERIC
Piers Daniell [Thu, 21 Dec 2017 23:50:14 +0000 (16:50 -0700)]
Remove use of unsupported SURFACETYPE_OFFSCREEN_GENERIC

The khr_debug tests were for some reason trying overriding the surface
type to SURFACETYPE_OFFSCREEN_GENERIC, which isn't supported by WGL.

This change just leaves the surface type as is.

Affects:
KHR-GL46.khr_debug.*

Components: OpenGL

VK-GL-CTS Issue: 922

Change-Id: Ib72e346ed716d19629dcbcfa423b9fc4f63d1835

6 years agoImplementations can use more samples than requested
Iago Toral Quiroga [Wed, 10 Jan 2018 11:16:04 +0000 (12:16 +0100)]
Implementations can use more samples than requested

KHR-GL45.copy_image.samples_mismatch tests that
implementations produce an error when attempting to
copy between images with different sample counts,
however, it relies on the hardware always allocating
exactly the number of samples requested, which may
not happen, since according to the spec for
glTexImage*Multisample:

   "samples represents a request for a desired minimum
    number of samples. Since different implementations
    may support different sample counts for multi-
    sampled textures, the actual number of samples
    allocated for the texture image is implementation
    dependent."

Since the test doesn't account for this, it can end
up expecting an error for the case where it requested
two textures with different sample counts but the
implementation ended up rounding one of them up to the
same number of samples used by the other one, in which
case the Copy operation will not produce an error any
more.

This patch fixes this by checking the actual sample
counts allocated for each texture and adjusting the
test expectation based on that.

Components: OpenGL

VK-GL-CTS issue: 932

Affects:
KHR-GL45.copy_image.samples_mismatch
KHR-GL46.copy_image.samples_mismatch

Change-Id: Idc1ce3026cbaae09cc65dc5194dd26f9bcddea0f

6 years agoRemove read value check against uncommitted pages
Piers Daniell [Thu, 21 Dec 2017 19:49:09 +0000 (12:49 -0700)]
Remove read value check against uncommitted pages

Reading from uncommitted pages produces undefined results so checks that
the result is zero in invalid. Only data read from committed pages has
undefined results. The PixelUnpackBufferStorageTestCase subtest was the
only subtest that was checking reads from uncommitted pages. All the
other subtest already did not do this.

Affects:
KHR-GL46.sparse_buffer_tests.BufferStorageTest

Components: OpenGL

VK-GL-CTS Issue: 921

Change-Id: Ie7e61553cbad2454af03f39b7cdbd1ae8ab66d93

6 years agoAdd some missing GL_TEXTURE_SPARSE state setting
Piers Daniell [Wed, 20 Dec 2017 22:27:34 +0000 (15:27 -0700)]
Add some missing GL_TEXTURE_SPARSE state setting

Some parts of the SparseTextureAllocation test were not setting the
GL_TEXTURE_SPARSE_ARB state on the texture object before
negative-testing sparse texture behavior. This meant that these parts of
the test ran as non-sparse texture. In many cases this issue was masked,
except for the case where the implementation didn't support
GL_ARB_sparse_texture2. In this case it expected a glTexStorage call
with width/height/depth not a multiple of the page size to fail. It
wouldn't fail because the texture was actually non-sparse.

Another problematic part of the test was with the
GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB negative testing.
The test implemented did not fully the test spec or the OpenGL
spec. The correct negative testing of
GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB requires all the
conditions of GL_TEXTURE_SPARSE_ARB set, the correct target
*and* a width/depth that doesn't follow the requirement. The
test tried to test *or* of those conditions and was just wrong.
In addition it tried to use verifyTexStorageInvalidValueErrors()
to verify invalid texture targets, which would never pass.

Affects:
KHR-GL45.sparse_texture_tests.SparseTextureAllocation
KHR-GL46.sparse_texture_tests.SparseTextureAllocation

Components: OpenGL

VK-GL-CTS issue: 917

Change-Id: If25edd0aae382b7305b87ac0a810259e9ee67523

6 years agoFix typo in log message for ClearOpsBufferStorage
Liam Middlebrook [Wed, 17 Jan 2018 06:22:22 +0000 (22:22 -0800)]
Fix typo in log message for ClearOpsBufferStorage

A copy-paste error led for the ClearOpsBufferStorageCase inside of
SparseBufferTests to output that the
    "Unmodified buffer object region has invalid contents"
for cases referring to invalid contents for the modified buffer region.

Components: OpenGL
VK-GL-CTS issue: 956
Change-Id: I562ff6fa984977ee08ca0f2783a046b1bac235bd
Reviewed-By: pdaniell
6 years agoValidate instancing cases properly
Iago Toral Quiroga [Tue, 19 Dec 2017 12:30:14 +0000 (13:30 +0100)]
Validate instancing cases properly

The vertex attrib 64bit limits test case executes
both regular and instanced draw calls and has a
validation function that takes a boolean parameter
that informs it about whether isntancing has been
used so it can verify that all instances executed
properly. However, this function is always called
with false as parameter, indicating no instancing,
even for instanced scenarios, which means that the
validation function is only validating the first
instance even for instanced cases.

Components: OpenGL
VK-GL-CTS issue: 916

Affects:
KHR-GL45.vertex_attrib_64bit.limits_test
KHR-GL46.vertex_attrib_64bit.limits_test

Change-Id: Ibaf2c8fc0b6599a17f7bdbc7c4914b42d38d5e2a

6 years agoUpdate gl.xml revision
Alexander Galazin [Wed, 10 Jan 2018 10:34:00 +0000 (11:34 +0100)]
Update gl.xml revision

Change-Id: I7cb16bd139e801df2d2090ad5dd5d6267a6d19f9
Component: Framework

6 years agoDon't delare arrays as static
Ian Romanick [Fri, 15 Dec 2017 00:18:34 +0000 (16:18 -0800)]
Don't delare arrays as static

m_texture_1D and friends may have different values on each invocation of
gl4cts::GetTextureSubImage::Errors::testTwoDimmensionalTextureErrors()
on a full CTS run.  However, the rules for 'static const' initializers
may prevent the values from being updated after the first run.

I discovered this while trying to track down failures in
KHR-GL46.get_texture_sub_image.errors_test that only started occuring
with the 3rd visual tested in a full CTS run.  Running the test by
itself or testing that visual by itself via glcts would not reproduce
the error.  I added some extra debug logging to the driver, and I found
that testOneDimmensionalTextureErrors() and
testTwoDimmensionalTextureErrors() were using different names for the
GL_TEXTURE_1D texture.  I then discovered that the targets of the
textures used from testTwoDimmensionalTextureErrors() were {
GL_TEXTURE_2D, GL_TEXTURE_RECTANGE, GL_TEXTURE_2D } instead of {
GL_TEXTURE_1D, GL_TEXTURE_1D_ARRAY, GL_TEXTURE_2D }

See also https://bugs.freedesktop.org/show_bug.cgi?id=104154

Components: OpenGL

VK-GL-CTS issue: 912

Affects:
KHR-GL46.get_texture_sub_image.errors_test

Change-Id: I3ce061d9de75df46ff69a7eea4b88f6d17164f30

6 years agoFix (likely) typo in glGetTextureSubImage height calculation
Ian Romanick [Thu, 14 Dec 2017 23:56:59 +0000 (15:56 -0800)]
Fix (likely) typo in glGetTextureSubImage height calculation

The old code used "test_textures[i].id == GL_TEXTURE_1D", but
test_texturess::id contains the texture ID, not the texture target.  As
a result, the GL_TEXTURE_1D test always got the error that it expected,
but it got it for the wrong reason.

Components: OpenGL

VK-GL-CTS issue: 912

Affects:
KHR-GL46.get_texture_sub_image.errors_test

Change-Id: I4d3de1ccbd3b0cc554af23ceae16d590c82e81d4

6 years agogl_spirv: fix layout for uniform blocks on state queries test
Alejandro Piñeiro [Fri, 15 Dec 2017 13:37:36 +0000 (14:37 +0100)]
gl_spirv: fix layout for uniform blocks on state queries test

The shader for spirv_modules_state_queries_test was using location for
a uniform block. Although glslang is not raising an error, that is
wrong (See section 4.4.5 of the 4.50 GLSL spec).

Additionally, we should provide a way to identify the uniform block
without using a name, so we should specify the binding (see Issue 21
at ARB_gl_spirv spec).

Modules: OpenGL

VK-GL-CTS issue: 913

Affects:
KHR-GL45.gl_spirv.spirv_modules_state_queries_test
KHR-GL46.gl_spirv.spirv_modules_state_queries_test

Change-Id: I95cb03506bccf76b4188e879960813a060c662aa

6 years agoRemove GL_RGB9_E5 from SparseTexture2Allocation
James Helferty [Fri, 8 Dec 2017 21:44:32 +0000 (16:44 -0500)]
Remove GL_RGB9_E5 from SparseTexture2Allocation

SparseTexture2Allocation tests multisample textures; since GL_RGB9_E5
is not required to be supported as a multisample texture format, it
shouldn't be included in this test.

Components: OpenGL
VK-GL-CTS issue: 892

Affects:
KHR-GL4x.sparse_texture2_tests.SparseTexture2Allocation

Change-Id: I58fa72c26d8cc0c2060b8176aeec4f7d3e43787f

6 years agoUpdate gl_spirv tests fallback binaries
Alejandro Piñeiro [Wed, 13 Dec 2017 11:43:12 +0000 (12:43 +0100)]
Update gl_spirv tests fallback binaries

ARB_gl_spirv tests include off-line fallback binaries in the case of
glslang/spirv-tools not being available. During the review process of
those tests, it was agreed to remove the noise function test, but the
binaries were not updated.

Modules: OpenGL

VK-GL-CTS issue: 897

Affects:
KHR-GL45.gl_spirv.spirv_glsl_to_spirv_builtin_functions_test
KHR-GL45.gl_spirv.spirv_glsl_to_spirv_builtin_functions_test

Change-Id: I8be837a286a3c013568101d5aa1ae3d6fd4eca8f

6 years agoAvoid redundant shader creation for clamp tests
James Helferty [Wed, 6 Dec 2017 20:07:29 +0000 (15:07 -0500)]
Avoid redundant shader creation for clamp tests

Avoid redundant work involving creation of shaders. By rearranging the
order in which we iterate loops, we can avoid a signficant amount of
shader string manipulation and redundant shader creation. (This should
reduce the run time for this test without impacting coverage.)

Component: OpenGL
VK-GL-CTS issue: 889

Affects:
KHR-GL4x.sparse_texture_clamp_tests.SparseTextureClampLookupResidency
KHR-GL4x.sparse_texture_clamp_tests.SparseTextureClampLookupColor

Change-Id: If0cb11827c45da6b13d81115d4a8a9143d31e8c6

6 years agoFix expectation for state queries SPIR-V test
Alejandro Piñeiro [Fri, 8 Dec 2017 07:47:03 +0000 (08:47 +0100)]
Fix expectation for state queries SPIR-V test

The test removes the names for several variables of the shader, and
then it expect a length of 1 for all of them when doing a state
query. But on the case of TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH it
should return a 0.

From spec:
   "If pname is TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, the length of
   the longest output variable name specified to be used for transform
   feedback, including a null terminator, is returned. If no outputs
   are used for transform feedback, zero is returned. If no name
   reflection information is available, one is returned."

In this shader, transform feedback is not activated, so instead of
applying the last sentence, it should apply the sentence "If no
outputs are used for transform feedback, zero is returned".

Modules: OpenGL

VK-GL-CTS issue: 886

Affects:
KHR-GL45.gl_spirv.spirv_modules_state_queries_test
KHR-GL46.gl_spirv.spirv_modules_state_queries_test

Change-Id: I02ad02ee252e6703411ced4f14a7d753b3ef3eda

6 years agoUpdate KC CTS reference
Alexander Galazin [Fri, 8 Dec 2017 10:54:49 +0000 (11:54 +0100)]
Update KC CTS reference

Component: OpenGL

Change-Id: I112d7af5b25398407444f31ca6b37cae836ec820

6 years agoUse less nesting in many arrays of arrays tests.
Kenneth Graunke [Thu, 30 Nov 2017 08:13:35 +0000 (00:13 -0800)]
Use less nesting in many arrays of arrays tests.

Testing 8 levels of array-of-array nesting is very thorough, but a bit
overkill.  It creates a huge amount of register pressure which tends to
slow down compilers, causing the test to take an unreasonable amount of
time to run.  This patch reduces it to 4 levels in many subtests, which
should still be a reasonable amount of testing while running in much
less time.

This cuts the runtime of KHR-GL46.arrays_of_arrays_gl.* by 33 minutes
(43 -> 10) on my laptop's discrete GPU.  With the Intel Mesa driver,
it cuts it by 17 minutes (23 -> 6).

Some tests still exercise 8 levels of nesting, so there's still some
coverage of that scenario.

Components: OpenGL
VK-GL-CTS issue: 878

Affects:
- KHR-GL4*.arrays_of_arrays_gl.InteractionFunctionCalls1
- KHR-GL4*.arrays_of_arrays_gl.InteractionFunctionCalls2
- KHR-GL4*.arrays_of_arrays_gl.InteractionArgumentAliasing1
- KHR-GL4*.arrays_of_arrays_gl.InteractionArgumentAliasing2
- KHR-GL4*.arrays_of_arrays_gl.InteractionArgumentAliasing3
- KHR-GL4*.arrays_of_arrays_gl.InteractionArgumentAliasing4
- KHR-GL4*.arrays_of_arrays_gl.InteractionArgumentAliasing5
- KHR-GL4*.arrays_of_arrays_gl.InteractionArgumentAliasing6
- KHR-GL4*.arrays_of_arrays_gl.SubroutineFunctionCalls1
- KHR-GL4*.arrays_of_arrays_gl.SubroutineFunctionCalls2
- KHR-GL4*.arrays_of_arrays_gl.SubroutineArgumentAliasing1
- KHR-GL4*.arrays_of_arrays_gl.SubroutineArgumentAliasing2
- KHR-GL4*.arrays_of_arrays_gl.SubroutineArgumentAliasing3
- KHR-GL4*.arrays_of_arrays_gl.SubroutineArgumentAliasing4
- KHR-GLES31.core.arrays_of_arrays.InteractionFunctionCalls1
- KHR-GLES31.core.arrays_of_arrays.InteractionFunctionCalls2
- KHR-GLES31.core.arrays_of_arrays.InteractionArgumentAliasing1
- KHR-GLES31.core.arrays_of_arrays.InteractionArgumentAliasing2
- KHR-GLES31.core.arrays_of_arrays.InteractionArgumentAliasing3
- KHR-GLES31.core.arrays_of_arrays.InteractionArgumentAliasing4
- KHR-GLES31.core.arrays_of_arrays.InteractionArgumentAliasing5
- KHR-GLES31.core.arrays_of_arrays.InteractionArgumentAliasing6

Change-Id: Ia26ac5fb94799a2f80c9e2e9553c066d9c13c59b

6 years agoFix OpenGL function prototype calling conventions
Piers Daniell [Fri, 1 Dec 2017 21:17:54 +0000 (14:17 -0700)]
Fix OpenGL function prototype calling conventions

OpenGL doesn't use the default function calling convention
on all platforms, which is why gl.h defines the macros
GL_APICALL and GL_APIENTRY for applications to use when
defining their own OpenGL function prototypes. Not using
these may cause a crash if an OpenGL function is called
with the wrong calling convention.

Affects:
KHR-GL46.transform_feedback.*

Components: OpenGL

VK-GL-CTS issue: 882

Change-Id: I8766262b32a04b8eff8e110e1f116c2f915274e9

6 years agoUpdate KC CTS reference
Alexander Galazin [Fri, 1 Dec 2017 14:02:32 +0000 (15:02 +0100)]
Update KC CTS reference

Component: OpenGL

Change-Id: I5cfa8633cdc7af147351951e7c1cd89908ea3f45

6 years agoAdd OpenGL 4.6 configuration
Piers Daniell [Mon, 27 Nov 2017 19:26:19 +0000 (12:26 -0700)]
Add OpenGL 4.6 configuration

The CTS-Configs.gl46 entry was missing from the configs.qpa
file and results in validation failure.

Affects:

cts-runner --type=gl46

Components: OpenGL

VK-GL-CTS issue: 866

Change-Id: I16745a7ce36040f8ef60cfbb1e4ffac250b289ee

6 years agoFix maximum location for varying location limit test
Iago Toral Quiroga [Thu, 23 Nov 2017 08:30:35 +0000 (09:30 +0100)]
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

6 years agogl3cTransformFeedbackTests: use delete[] to match new[]
Nicolai Hähnle [Mon, 20 Nov 2017 16:45:49 +0000 (17:45 +0100)]
gl3cTransformFeedbackTests: use delete[] to match new[]

C++ requires that memory allocated by new[] is freed using delete[]
instead of just plain delete. This does not really have an effect in
practice, but it does fix an error reported by Address Sanitizer:

=================================================================
==12338==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x6020000634b0
    #0 0x7f21af5b3580 in operator delete(void*) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc8580)
    #1 0x55d795f901ae in gl3cts::TransformFeedback::APIErrors::testExtension1() /home/nha/amd/tests/cts/external/openglcts/modules/gl/gl3cTransformFeedbackTests.cpp:837
    #2 0x55d795f9d71f in gl3cts::TransformFeedback::APIErrors::iterate() /home/nha/amd/tests/cts/external/openglcts/modules/gl/gl3cTransformFeedbackTests.cpp:251
    #3 0x55d795f64736 in gl3cts::TestCaseWrapper::iterate(tcu::TestCase*) /home/nha/amd/tests/cts/external/openglcts/modules/gl/gl3cTestPackages.cpp:100
    #4 0x55d797d10682 in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/nha/amd/tests/cts/framework/common/tcuTestSessionExecutor.cpp:272
    #5 0x55d797d10798 in tcu::TestSessionExecutor::iterate() /home/nha/amd/tests/cts/framework/common/tcuTestSessionExecutor.cpp:135
    #6 0x55d797cf0748 in tcu::App::iterate() /home/nha/amd/tests/cts/framework/common/tcuApp.cpp:173
    #7 0x55d795f15967 in main /home/nha/amd/tests/cts/framework/platform/tcuMain.cpp:55
    #8 0x7f21adceb3f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0)
    #9 0x55d795f5e449 in _start (/mnt/9a5f7d49-0504-436d-83ae-10198f821499/nha/amd/tests/cts/build/external/openglcts/modules/glcts+0xa55449)

0x6020000634b0 is located 0 bytes inside of 3-byte region [0x6020000634b0,0x6020000634b3)
allocated by thread T0 here:
    #0 0x7f21af5b30a0 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc80a0)
    #1 0x55d795f900da in gl3cts::TransformFeedback::APIErrors::testExtension1() /home/nha/amd/tests/cts/external/openglcts/modules/gl/gl3cTransformFeedbackTests.cpp:826

Component: OpenGL
VK-GL-CTS issue: 858
Affects:
KHR-GL45.transform_feedback.api_errors_test

Change-Id: Ie0872535d224c27cc6864fb71aaf7eb219661a02

6 years agoFix expectation for multisample SPIR-V test
Iago Toral Quiroga [Wed, 15 Nov 2017 07:44:22 +0000 (08:44 +0100)]
Fix expectation for multisample SPIR-V test

The last subtest of the builtin variable decorations
SPIR-V test renders to a 2-sample multisample FBO by
clearing to black and then using a fragment shader
that uses gl_SampleMask to select only one of the 2
samples. The selected sample always outputs 100% green.

Because the sample locations can be different acrosss
implementations, we can't tell what the resolved green
component will be, only that it cannot be 0x00 (since
one green sample is selected) and it cannot
be 0xFF (since sample coverage is only 50%).

Modules: OpenGL

VK-GL-CTS issue: 850

Affects:
KHR-GL45.gl_spirv.spirv_validation_builtin_variable_decorations_test
KHR-GL46.gl_spirv.spirv_validation_builtin_variable_decorations_test

Change-Id: I7f225199954c9193ff0b5e962d4de0ca905a5a76

6 years agoRemove luminance and 3D depth requirement from ARB_texture_filter_minmax
Scott D Phillips [Tue, 14 Nov 2017 22:06:50 +0000 (14:06 -0800)]
Remove luminance and 3D depth requirement from ARB_texture_filter_minmax

Support not required by the extension.

Component: OpenGL

VK-GL-CTS issue: 849

Affects:
* KHR-GL45.texture_filter_minmax_tests.*

Change-Id: I53ede0343aa15e7528e12bf387f337f70ac155dd

6 years agoAdd interaction with NVX_cross_process_interop
Daniel Koch [Wed, 15 Nov 2017 15:20:54 +0000 (10:20 -0500)]
Add interaction with NVX_cross_process_interop

Update registry references to include
GL_NV_gpu_multicast and GL_NVX_cross_process_interop

VK-GL-CTS issue: 851
Component: OpenGL

Affects:
KHR-GL45.direct_state_access.buffers_errors
KHR-GL46.direct_state_access.buffers_errors

Change-Id: I42cdb7ad37f9c2ed60547aa817d263cd777f0f6f

6 years agoFix strict aliasing violations in gl3cCommonBugsTests
Neil Roberts [Wed, 15 Nov 2017 21:45:39 +0000 (22:45 +0100)]
Fix strict aliasing violations in gl3cCommonBugsTests

In two places in PerVertexValidationTest::getTestIterationProperties
it first stores a value in a pointer to an enum and then later tries
to update the enum via a reference casted to an int reference. I
believe this violates the strict aliasing rules and so is undefined
behaviour. At least with gcc and -O2 the compiler seems to take
advantage of this and effectively ignores the initial assignment of
SHADER_STAGE_VERTEX for the PERVERTEX_DECLARATION_MISMATCH_TC_TE_VS
iteration. The result is that used_shader_stages gets or’d with an
unitialised value. This was causing a valgrind error and depending on
what the original value happened to be it can make the test
erroneously fail.

Modules: OpenGL

VK-GL-CTS issue: 853

Affects:
KHR-GL*.CommonBugs.CommonBug_PerVertexValidation

Change-Id: I1094de5c2114c035e339cdb524808f45cbe55782

6 years agoDocumentation updates for OpenGL 4.6
Daniel Koch [Fri, 10 Nov 2017 19:42:51 +0000 (14:42 -0500)]
Documentation updates for OpenGL 4.6

Change-Id: I2d0a29ee9de24ae5aa616e0a5450c923ba3ba26d
Component: OpenGL
Affects: None

6 years agoRemove mod from GL mustpass
Alexander Galazin [Fri, 10 Nov 2017 15:13:33 +0000 (16:13 +0100)]
Remove mod from GL mustpass

Components: OpenGL

VK-GL-CTS public issue: 51

Affects:
KHR-GL*.gpu_shader_fp64.builtin.mod_*

Change-Id: Idac62351b9ca926cdcb411990c33e7332e8a9db7

6 years agoUpdate KC CTS reference
Alexander Galazin [Fri, 10 Nov 2017 12:11:07 +0000 (13:11 +0100)]
Update KC CTS reference

Components: OpenGL

Change-Id: I241503a713fc4a15cdcf359c40e2b119b5b5fd4f

6 years agoUse proper name for array-of-array varyings.
Juan A. Suarez Romero [Mon, 30 Oct 2017 12:50:23 +0000 (12:50 +0000)]
Use proper name for array-of-array varyings.

varying_structure_location tests have the piece of shader code:

```
struct Data {
    dvec2 single;
    dvec2 array[1];
};

layout (location = 0) flat in Data tes_gs_output[][1];
```

When test tries to verify "single" variable, it tries to access through
"tes_gs_output[0].single", which is not correct. Rather it must use
"tes_gs_output[0][0].single"

Affects:
* KHR-GL46.enhanced_layouts.varying_structure_locations

Components: OpenGL

VK-GL-CTS issue: 796

Change-Id: Ib1c2ac6877f46f0be8530156a184b8fa41349c40

6 years agoGL_ARB_compute_shader required for OpenGL < 4.3
Juan A. Suarez Romero [Mon, 6 Nov 2017 18:50:28 +0000 (19:50 +0100)]
GL_ARB_compute_shader required for OpenGL < 4.3

GL_ARB_compute_shader is part of OpenGL 4.3 and above.

For older versions, it is required to enable it explicitly.

Fixes:
KHR-GL31.CommonBugs.CommonBug_ParenthesisInLayoutQualifierIntegerValue
KHR-GL32.CommonBugs.CommonBug_ParenthesisInLayoutQualifierIntegerValue
KHR-GL33.CommonBugs.CommonBug_ParenthesisInLayoutQualifierIntegerValue
KHR-GL40.CommonBugs.CommonBug_ParenthesisInLayoutQualifierIntegerValue
KHR-GL41.CommonBugs.CommonBug_ParenthesisInLayoutQualifierIntegerValue
KHR-GL42.CommonBugs.CommonBug_ParenthesisInLayoutQualifierIntegerValue

Components: OpenGL

VK-GL-CTS issue: 818

Change-Id: I8e7ab78e29861547f0379feebce0375e1dabf47c

6 years agoLoad functions from ARB_uniform_buffer_object
Juan A. Suarez Romero [Tue, 7 Nov 2017 12:24:25 +0000 (12:24 +0000)]
Load functions from ARB_uniform_buffer_object

While this extension is part of OpenGL 3.1 and above, it is not part of
OpenGL 3.0.

As we need to run the tests for OpenGL 3.0 too, and we need to use some
functions exposed by this extension, let's load them from the extension
itself, instead of relying in the core functions.

Affects:
* KHR-GL30.transform_feedback.draw_xfb_instanced_test
* KHR-GL30.transform_feedback.draw_xfb_stream_instanced_test

Components: OpenGL

VK-GL-CTS issue: 819

Change-Id: I2cd1652b4c2d3b55e009c44b85b451d207387b96

6 years agoRelax XFB begin check to match recent spec edit
James Helferty [Thu, 19 Oct 2017 18:24:35 +0000 (14:24 -0400)]
Relax XFB begin check to match recent spec edit

Update tests to reflect a recent change to the GL 4.6 specification.
Previously, if a shader layout qualifier specified that xfb_stride was
non-zero for a given xfb_buffer, then a buffer object was required to
be bound at that transform feedback buffer binding point. After the
spec change, it is now legal to not have a buffer bound, provided no
outputs are associated with the buffer.

Components: OpenGL

VK-GL-CTS issue: 785

Affects:
* KHR-GL44/45/46.enhanced_layouts.xfb_stride_of_empty_list
* KHR-GL44/45/46.enhanced_layouts.xfb_stride_of_empty_list_and_api

Change-Id: I38622bad1af3bc8a2a4c683eadc184e6231f7c85

6 years agoAdd CTS_ARB_gl_spirv test implementation
Adam Czupryna [Fri, 7 Jul 2017 09:42:37 +0000 (11:42 +0200)]
Add CTS_ARB_gl_spirv test implementation

Add CTS_ARB_gl_spirv test implementation that contains:
SpirvModulesPositiveTest,
SpirvModulesShaderBinaryMultipleShaderObjectsTest,
SpirvModulesStateQueriesTest,
SpirvModulesErrorVerificationTest,
SpirvGlslToSpirVEnableTest,
SpirvGlslToSpirVBuiltInFunctionsTest,
SpirvGlslToSpirVSpecializationConstantsTest,
SpirvValidationBuiltInVariableDecorationsTest

Affects:

KHR-GL45.gl_spirv.*

Components: Framework, OpenGL

VK-GL-CTS issue: 554

Change-Id: I0d54c70df619dbbd80b28350d2ac5e31aca08927
(cherry picked from commit a24448cdd72ffdbd8f7f571886625b8a53100979)

6 years agoFix attribute mapping in enhanced layouts tests for input arrays
Iago Toral Quiroga [Mon, 2 Oct 2017 11:10:20 +0000 (13:10 +0200)]
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

6 years agoSeveral fixes for texture_size_promotion
Juan A. Suarez Romero [Wed, 18 Oct 2017 09:37:27 +0000 (09:37 +0000)]
Several fixes for texture_size_promotion

Specifically, this changeset fixes:

- Check for unsupported framebuffer configurations
- Setup data for depth/stencil textures
- Explicitly set minification/magnification filters
- Deal with the corner cases in precision when using fixed-point
textures.

Affects:

KHR-GL45.texture_size_promotion.functional
KHR-GL46.texture_size_promotion.functional

Components: OpenGL

VK-GL-CTS issue: 783

Change-Id: I3f191084b2a604f1a743759905d641d2b13db2ad

6 years agoRespect GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS
Iago Toral Quiroga [Tue, 17 Oct 2017 07:58:57 +0000 (09:58 +0200)]
Respect GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS

KHR-GL45.enhanced_layouts.xfb_override_qualifiers_with_api
generates shaders that capture XFB for varyings of all types.
For the cases of dmat4x3, dmat3x4 and dmat4, this requires
over 64 transform feedback components in total, which is larger
than the minimum value that implementations are required to
support for GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,
which the OpenGL 4.6 spec sets in 64. For implementations that
support this minimum, the generated shaders are invalid and
expected to fail to link.

Check the required component size of the XFB for the generated
shaders and skip them if they exceed the implementation limit.
At worse, for implementations that only support the minimum
number of transform feedback components required by the spec
it would only skip the 3 largest types (out of 34 being tested).

Components: OpenGL
VK-GL-CTS issue: 776

Affects:
KHR-GL45.enhanced_layouts.xfb_override_qualifiers_with_api

Change-Id: I51c9da494f96a0746f74116f817d99afd070a9ee

6 years agoComponent aliasing on vertex inputs is allowed
Iago Toral Quiroga [Wed, 18 Oct 2017 10:08:54 +0000 (12:08 +0200)]
Component aliasing on vertex inputs is allowed

From the OpenGL 4.6 spec, section 11.1 Vertex shaders,
page 384:

"It is possible for an application to bind more than one
 attribute name to the same location. This is referred
 to as aliasing. This will only work if only one of the
 aliased attributes is active in the executable program,
 or if no path through the shader consumes more than one
 attribute of a set of attributes aliased to the same
 location. A link error can occur if the linker determines
 that every path through the shader consumes multiple
 aliased attributes, but implementations are not required
 to generate an error in this case."

The varying_location_aliasing_with_mixed_types enhanced
layouts test generates negative tests to check that
component aliasing produces linker errors for all shader
stages, including vertex shaders when the aliasing occurs
on the vertex inputs. By the citation above, the spec
doesn't mandate implementations to produce an error in
this case, so these particular tests are invalid.

This change removes the test cases that expect an error
to be generated for shaders with component aliasing on
vertex shader inputs.

Components: OpenGL
VK-GL-CTS issue: 781

Affects:
KHR-GL45.enhanced_layouts.varying_location_aliasing_with_mixed_types
KHR-GL46.enhanced_layouts.varying_location_aliasing_with_mixed_types

Change-Id: Ie1cafc92c4b7023c3d911ec5fe883dad297029d5

6 years agoOnline compression for ETC2 compressed formats is not required
Eleni Maria Stea [Tue, 13 Jun 2017 07:08:08 +0000 (09:08 +0200)]
Online compression for ETC2 compressed formats is not required

The DSA compressed texture tests currently require online compression for
ETC2 formats but drivers are not required to support this. Since the purpose
of the test is not to test the compression, when a compression format is not
supported we use already compressed data.

Components: OpenGL
VK-GL-CTS issue: 497

Affects:
KHR-GL45.direct_state_access.textures_compressed_subimage

Change-Id: Icff52745e9cf7a2acb39aea71d31f4ff827ea01c

6 years agoDelete incorrect invalid map transform feedback subtest.
Kenneth Graunke [Thu, 12 Oct 2017 04:39:05 +0000 (21:39 -0700)]
Delete incorrect invalid map transform feedback subtest.

The citation given in this test comes from the OpenGL man pages, which
are not authoritative.  The ES 3.2 and GL 4.x specifications say:

   "Effects of Mapping Buffers on Other GL Commands

    Any GL command which attempts to read from, write to, or change the
    state of a buffer object may generate an INVALID_OPERATION error if
    all or part of the buffer object is mapped. However, only commands
    which explicitly describe this error are required to do so. If an
    error is not generated, using such commands to perform invalid
    reads, writes, or state changes will have undefined results and may
    result in GL interruption or termination."

Importantly, it says "_may_ generate an INVALID_OPERATION error".  Some
drivers choose not to implement this to avoid the CPU overhead required
to enforce this optional restriction.

Affects:
- KHR-*.transform_feedback.api_errors_test

VK-GL-CTS issue: 765

Change-Id: I34ca78926fe0f311db096de98b71e0981ee91d53
Components: OpenGL

6 years agoSkip non accelerated pixel format
Jeannot Breton [Fri, 6 Oct 2017 13:56:17 +0000 (08:56 -0500)]
Skip non accelerated pixel format

They were previously skipped in older CTS version,
but when we reorganized the code to merge all CTS together the
related code got remove

We also fix the way we detect hardware acceleration

Affects:

pixel formats selected by cts-runner on Windows

Components: OpenGL

VK-GL-CTS issue: 692

Change-Id: I9968d85b555fe41aea8e64b885f182407e1ce95e

6 years agoMake 420pack 'binding' layout qualifier tests check MAX_*_IMAGE_UNIFORMS
Kenneth Graunke [Mon, 25 Sep 2017 04:18:11 +0000 (21:18 -0700)]
Make 420pack 'binding' layout qualifier tests check MAX_*_IMAGE_UNIFORMS

Image uniform support is not mandatory for the VS/TCS/TES/GS stages,
so GL_MAX_*_IMAGE_UNIFORMS can report 0.  On such an implementation,
these tests would fail.

This patch skips image testing in any such stages, making them
essentially passthrough shaders.

In BindingImageSingleTest, we also put the binding qualifier in the
fragment shader stage if the stage where we'd normally put it doesn't
support images.  This way, it's guaranteed to exist in at least one
shader stage.

Components: OpenGL

VK-GL-CTS issue: 712

Affects:
* KHR-GL45.shading_language_420pack.binding_images
* KHR-GL45.shading_language_420pack.binding_image_api_override
* KHR-GL45.shading_language_420pack.binding_image_array
* KHR-GL45.shading_language_420pack.binding_image_single
* KHR-GL45.shading_language_420pack.binding_image_default

Change-Id: Ic9eceb4472edff87d5de54ec6318cdb856b0bb8d

6 years agoSkip impossible shader stages in image load store max uniforms test.
Kenneth Graunke [Sun, 24 Sep 2017 23:18:11 +0000 (16:18 -0700)]
Skip impossible shader stages in image load store max uniforms test.

Implementations not required to support images in the geometry stages,
and are allowed to advertise 0 for:

    * GL_MAX_VERTEX_IMAGE_UNIFORMS
    * GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS
    * GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS
    * GL_MAX_GEOMETRY_IMAGE_UNIFORMS

This means that gl_Max*ImageUniforms may be 0, which means that

    #define N_UNIFORMS gl_MaxVertexImageUniforms
    layout(r32i) uniform iimage2D u_image[N_UNIFORMS];

will define a zero sized array, which is illegal.  To work around this,
simply skip stages that have zero supported image uniforms - there's
nothing to test there, anyway.

Components: OpenGL

VK-GL-CTS issue: 712

Affects:
* KHR-GL45.shader_image_load_store.uniform-limits

Change-Id: I14116ff8b4714e04b35ce0929ed68ed0f38e7d52