Fix geometry shader limits regarding available image units
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 15 Oct 2019 11:16:21 +0000 (13:16 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 12 Nov 2019 09:31:48 +0000 (04:31 -0500)
commit8cdad13014d8e3bf2f1d4a6ec020d8151c528251
tree8291a66f8c70a73064e8160fa7ac7c2761459a89
parentf5647cfb2497df63e123b1c413d102a9e0230512
Fix geometry shader limits regarding available image units

The test case KHR-GLES31.core.geometry_shader.api.max_image_uniforms
would fail if the implementations reports:

MAX_GEOMETRY_TEXTURE_IMAGE_UNITS < MAX_GEOMETRY_IMAGE_UNIFORMS

However, the latter was introduced with ARB_shader_image_load_store,
whereas the former refers to samplers. From the GLES 3.2 spec:

   "Note that image units used for image variables are independent
    of the texture image units used for sampler variables; the number
    of units provided by the implementation may differ.  Textures
    are bound independently and separately to image and texture image
    units".

In fact the ARB_shader_image_load_store spec doesn't mention any of
the MAX_{*}_TEXTURE_IMAGE_UNITS at all, and it only talks about
MAX_IMAGE_UNITS and MAX_{*}_IMAGE_UNIFORMS.

Specifically, the test calls glBindImageTexture for as many
units as reported by MAX_GEOMETRY_IMAGE_UNIFORMS and the spec for
glBindImageTexture only requires that:

   "An INVALID_VALUE error is generated if unit is greater than
    or equal tothe value of MAX_IMAGE_UNITS, (...)"

So this changes the test to fail only if:

MAX_IMAGE_UNITS < MAX_GEOMETRY_IMAGE_UNIFORMS

VK-GL-CTS issue: 2057
Components: OpenGL ES
Affects: KHR-GLES31.core.geometry_shader.api.max_image_uniforms
Change-Id: I24566a1372c486512b64ce5d4b329925d859e0af
external/openglcts/modules/glesext/geometry_shader/esextcGeometryShaderAPI.cpp