[Piglit] [PATCH] glsl-es-1.00: add test for constant-index-expression indexing

Matt Turner mattst88 at gmail.com
Sun Mar 29 22:06:56 PDT 2015


On Sun, Mar 29, 2015 at 9:36 PM, Tapani Pälli <tapani.palli at intel.com> wrote:
> On 03/27/2015 06:44 PM, Matt Turner wrote:
>> On Thu, Mar 26, 2015 at 11:49 PM, Tapani Pälli <tapani.palli at intel.com>
>> wrote:
>>>
>>> This test fails with current Mesa HEAD (6264348), see bug
>>> https://bugs.freedesktop.org/show_bug.cgi?id=84225.
>>>
>>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>>> ---
>>>   .../sampler-array-index.frag                       | 24
>>> ++++++++++++++++++++++
>>>   1 file changed, 24 insertions(+)
>>>   create mode 100644
>>> tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag
>>>
>>> diff --git
>>> a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag
>>> b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag
>>> new file mode 100644
>>> index 0000000..08ed68d
>>> --- /dev/null
>>> +++
>>> b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag
>>> @@ -0,0 +1,24 @@
>>> +/* [config]
>>> + * expect_result: pass
>>> + * glsl_version: 1.00
>>> + * [end config]
>>> + *
>>> + * From "Appendix A" of the GLSL ES 1.00 spec:
>>> + *
>>> + *     "GLSL ES 1.00 supports both arrays of samplers and arrays of
>>> + *      structures which contain samplers. In both these cases, for
>>> + *      ES 2.0, support for indexing with a constant-index-expression
>>> + *      is mandated"
>>> + *
>>> + */
>>> +#version 100
>>> +uniform sampler2D array[1];
>>
>>
>> I only noticed upon looking at the second test, but this is wrong.
>> Should be array[2].
>
>
> Oops, will fix
>
>>> +
>>> +void main()
>>> +{
>>> +       highp vec4 color;
>>> +       for (int i = 0; i < 2; i++) {
>>
>>
>> Using array.length() here would have at least prevented the failure,
>> even if it didn't quite do what we expected.
>
>
> length() is available only with glsl >=1.20

Oh, I didn't realize that. That's annoying. :\


More information about the Piglit mailing list