[Piglit] [PATCH 5/6] arb_bindless_texture: add inout-non-matching-type.frag compiler tests

Nicolai Hähnle nhaehnle at gmail.com
Thu Apr 27 20:07:18 UTC 2017


On 27.04.2017 10:12, Samuel Pitoiset wrote:
>
>
> On 04/27/2017 10:02 AM, Samuel Pitoiset wrote:
>>
>>
>> On 04/27/2017 02:24 AM, Timothy Arceri wrote:
>>> Same comment for 3-5 as for comment 2. I'd rather see varyables
>>> function params and return values used as frag/vert outputs otherwise
>>> there is no guarantee the compiler won't just optimise the invalid
>>> uses away.
>>
>> I think it's a bit overkill. Most of the compiler tests in piglit are
>> really pretty simple. Looks like only very few of them guarantee that
>> the compiler won't optimize. Yeah, it's sad.
>>
>> I have written and tested this series against NV blob. At least, this
>> one doesn't need anything else because it fails as-is.
>
> I understand your point of view though. But the way I designed the
> compiler tests for ARB_bindless_texture would need a bunch of changes.

I think these tests are mostly about the compiler accepting the syntax 
in the first place, so it's fine if they're trivial to optimize away.

The execution tests are what checks that later stages of the compiler 
pipeline are working correctly.

With that in mind, patches 2-5 are:

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>


>
>>
>>>
>>> On 27/04/17 08:52, Samuel Pitoiset wrote:
>>>> "Replace Section 4.1.X, (Images)"
>>>>
>>>>      "As function parameters, images may be only passed to images
>>>>       of matching type."
>>>>
>>>> "Replace Section 4.1.7 (Samplers), p. 25"
>>>>
>>>>      "As function parameters, samplers may be only passed to samplers
>>>>       of matching type."
>>>>
>>>> Two simple test cases to make sure types are checked.
>>>>
>>>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>>>> ---
>>>>   .../compiler/images/inout-non-matching-type.frag   | 26
>>>> ++++++++++++++++++++++
>>>>   .../compiler/samplers/inout-non-matching-type.frag | 25
>>>> +++++++++++++++++++++
>>>>   2 files changed, 51 insertions(+)
>>>>   create mode 100644
>>>> tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag
>>>>
>>>>   create mode 100644
>>>> tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag
>>>>
>>>>
>>>> diff --git
>>>> a/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag
>>>> b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag
>>>>
>>>> new file mode 100644
>>>> index 000000000..0ff8d5bc9
>>>> --- /dev/null
>>>> +++
>>>> b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag
>>>>
>>>> @@ -0,0 +1,26 @@
>>>> +// [config]
>>>> +// expect_result: fail
>>>> +// glsl_version: 3.30
>>>> +// require_extensions: GL_ARB_bindless_texture
>>>> GL_ARB_shader_image_load_store
>>>> +// [end config]
>>>> +
>>>> +#version 330
>>>> +#extension GL_ARB_bindless_texture: require
>>>> +#extension GL_ARB_shader_image_load_store: enable
>>>> +
>>>> +// The ARB_bindless_texture spec says:
>>>> +//
>>>> +//  "Replace Section 4.1.X, (Images)"
>>>> +//
>>>> +//  "As function parameters, images may be only passed to images of
>>>> +//   matching type."
>>>> +
>>>> +void f(inout image2D p)
>>>> +{
>>>> +}
>>>> +
>>>> +void main()
>>>> +{
>>>> +    writeonly image1D u;
>>>> +    f(u);
>>>> +}
>>>> diff --git
>>>> a/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag
>>>> b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag
>>>>
>>>> new file mode 100644
>>>> index 000000000..25a5724cf
>>>> --- /dev/null
>>>> +++
>>>> b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag
>>>>
>>>> @@ -0,0 +1,25 @@
>>>> +// [config]
>>>> +// expect_result: fail
>>>> +// glsl_version: 3.30
>>>> +// require_extensions: GL_ARB_bindless_texture
>>>> +// [end config]
>>>> +
>>>> +#version 330
>>>> +#extension GL_ARB_bindless_texture: require
>>>> +
>>>> +// The ARB_bindless_texture spec says:
>>>> +//
>>>> +//  "Replace Section 4.1.7 (Samplers), p. 25"
>>>> +//
>>>> +//  "As function parameters, samplers may be only passed to
>>>> samplers of
>>>> +//   matching type."
>>>> +
>>>> +void f(inout sampler2D p)
>>>> +{
>>>> +}
>>>> +
>>>> +void main()
>>>> +{
>>>> +    sampler1D u;
>>>> +    f(u);
>>>> +}
>>>>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the Piglit mailing list