[Piglit] [PATCH] arb_shader_image_load_store: test duplicate format qualifier more thoroughly
Francisco Jerez
currojerez at riseup.net
Tue Jan 19 18:57:41 PST 2016
Timothy Arceri <timothy.arceri at collabora.com> writes:
> On Tue, 2016-01-19 at 18:08 -0800, Francisco Jerez wrote:
>> Timothy Arceri <timothy.arceri at collabora.com> writes:
>>
>> > From the ARB_shader_image_load_store spec:
>> >
>> > "Only one format qualifier may be specified for any image
>> > variable
>> > declaration."
>> > ---
>> > .../gen_shader_image_load_store_tests.py | 15
>> > +++++++++++
>> > ...aration-format-qualifier-duplicate-420pack.frag | 28
>> > +++++++++++++++++++++
>> > ...aration-format-qualifier-duplicate-420pack.vert | 28
>> > +++++++++++++++++++++
>> > ...ormat-qualifier-duplicate-enhanced-layouts.frag | 29
>> > ++++++++++++++++++++++
>> > ...ormat-qualifier-duplicate-enhanced-layouts.vert | 29
>> > ++++++++++++++++++++++
>>
>> Can you comment on the usefulness of these last four tests? At first
>> glance it doesn't seem obvious why they provide any value over
>> declaration-format-qualifier-duplicate or
>> declaration-format-qualifier-duplicate-within-layout.
>
> Sure.
>
> ARB_enhanced_layouts
>
> Allows duplicates within a single layout qualifier e.g.
>
> layout(location = 0, location = 1) out vec4 a;
>
> ARB_shading_language_420pack
>
> Allows multiple layout qualifiers e.g.
>
> layout(location = 0) layout(location = 2) out vec4 b;
>
> However
>
> layout(rgba32f, rgba32f) uniform image2D img;
>
> and
>
> layout(rgba32f) layout(rgba32f) uniform image2D img;
>
> Should still fail when these extensions are enabled according to the
> spec.
>
> I can add this to the commit message if you like.
>
That means that declaration-format-qualifier-duplicate-420pack.vert and
.frag are exactly the same as
declaration-format-qualifier-duplicate.vert and .frag except for the
additional extension enable, and the same goes for
declaration-format-qualifier-duplicate-enhanced-layouts.* vs
declaration-format-qualifier-duplicate-within-layout.*. It would be
really nice in order to keep the source code size under control if you
could do this as is done in other image load/store compiler tests by
adding an '${extra_extensions}' placeholder right after the header in
the templates for declaration-format-qualifier-duplicate(-within-layout)
and then pass the two alternatives to the cartesian product. It may
also be useful to explain in a comment above the placeholder why it's
interesting to test with and without the additional extension.
>>
>> > 5 files changed, 129 insertions(+)
>> > create mode 100644
>> > tests/spec/arb_shader_image_load_store/compiler/declaration-format
>> > -qualifier-duplicate-420pack.frag
>> > create mode 100644
>> > tests/spec/arb_shader_image_load_store/compiler/declaration-format
>> > -qualifier-duplicate-420pack.vert
>> > create mode 100644
>> > tests/spec/arb_shader_image_load_store/compiler/declaration-format
>> > -qualifier-duplicate-enhanced-layouts.frag
>> > create mode 100644
>> > tests/spec/arb_shader_image_load_store/compiler/declaration-format
>> > -qualifier-duplicate-enhanced-layouts.vert
>> >
>> > diff --git a/generated_tests/gen_shader_image_load_store_tests.py
>> > b/generated_tests/gen_shader_image_load_store_tests.py
>> > index 8d6be9c..ee27808 100644
>> > --- a/generated_tests/gen_shader_image_load_store_tests.py
>> > +++ b/generated_tests/gen_shader_image_load_store_tests.py
>> > @@ -473,6 +473,21 @@ gen('declaration-format-qualifier-duplicate',
>> > """\
>> > }
>> > """, shader_stages)
>> >
>> > +gen('declaration-format-qualifier-duplicate-within-layout', """\
>> > + ${header('fail')}
>> > + /*
>> > + * From the ARB_shader_image_load_store spec:
>> > + *
>> > + * "Only one format qualifier may be specified for any image
>> > variable
>> > + * declaration."
>> > + */
>> > + layout(rgba32f, rgba32f) uniform image2D img;
>> > +
>> > + void main()
>> > + {
>> > + }
>> > +""", shader_stages)
>> > +
>> > gen('declaration-format-qualifier-missing', """\
>> > ${header(status)}
>> > /*
>> > diff --git
>> > a/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-420pack.frag
>> > b/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-420pack.frag
>> > new file mode 100644
>> > index 0000000..1ea3749
>> > --- /dev/null
>> > +++ b/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-420pack.frag
>> > @@ -0,0 +1,28 @@
>> > +/*
>> > + * [config]
>> > + * expect_result: fail
>> > + * glsl_version: 1.50
>> > + * require_extensions: GL_ARB_shader_image_load_store
>> > GL_ARB_shading_language_420pack
>> > + * [end config]
>> > + */
>> > +#version 150
>> > +#extension GL_ARB_shader_image_load_store: require
>> > +#extension GL_ARB_shading_language_420pack: require
>> > +
>> > +/*
>> > + * From the ARB_shader_image_load_store spec:
>> > + *
>> > + * "Only one format qualifier may be specified for any image
>> > variable
>> > + * declaration."
>> > + *
>> > + * From the ARB_shading_language_420pack spec:
>> > + *
>> > + * "More than one layout qualifier may appear in a single
>> > declaration. If
>> > + * the same layout-qualifier-name occurs in multiple layout
>> > qualifiers for
>> > + * the same declaration, the last one overrides the former
>> > ones."
>> > + */
>> > +layout(rgba32f) layout(rgba32f) uniform image2D img;
>> > +
>> > +void main()
>> > +{
>> > +}
>> > diff --git
>> > a/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-420pack.vert
>> > b/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-420pack.vert
>> > new file mode 100644
>> > index 0000000..1ea3749
>> > --- /dev/null
>> > +++ b/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-420pack.vert
>> > @@ -0,0 +1,28 @@
>> > +/*
>> > + * [config]
>> > + * expect_result: fail
>> > + * glsl_version: 1.50
>> > + * require_extensions: GL_ARB_shader_image_load_store
>> > GL_ARB_shading_language_420pack
>> > + * [end config]
>> > + */
>> > +#version 150
>> > +#extension GL_ARB_shader_image_load_store: require
>> > +#extension GL_ARB_shading_language_420pack: require
>> > +
>> > +/*
>> > + * From the ARB_shader_image_load_store spec:
>> > + *
>> > + * "Only one format qualifier may be specified for any image
>> > variable
>> > + * declaration."
>> > + *
>> > + * From the ARB_shading_language_420pack spec:
>> > + *
>> > + * "More than one layout qualifier may appear in a single
>> > declaration. If
>> > + * the same layout-qualifier-name occurs in multiple layout
>> > qualifiers for
>> > + * the same declaration, the last one overrides the former
>> > ones."
>> > + */
>> > +layout(rgba32f) layout(rgba32f) uniform image2D img;
>> > +
>> > +void main()
>> > +{
>> > +}
>> > diff --git
>> > a/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-enhanced-layouts.frag
>> > b/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-enhanced-layouts.frag
>> > new file mode 100644
>> > index 0000000..f1bb73d
>> > --- /dev/null
>> > +++ b/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-enhanced-layouts.frag
>> > @@ -0,0 +1,29 @@
>> > +/*
>> > + * [config]
>> > + * expect_result: fail
>> > + * glsl_version: 1.50
>> > + * require_extensions: GL_ARB_shader_image_load_store
>> > GL_ARB_enhanced_layouts
>> > + * [end config]
>> > + */
>> > +#version 150
>> > +#extension GL_ARB_shader_image_load_store: require
>> > +#extension GL_ARB_enhanced_layouts: require
>> > +
>> > +/*
>> > + * From the ARB_shader_image_load_store spec:
>> > + *
>> > + * "Only one format qualifier may be specified for any image
>> > variable
>> > + * declaration."
>> > + *
>> > + * From the ARB_enhanced_layouts spec:
>> > + *
>> > + * "More than one layout qualifier may appear in a single
>> > declaration.
>> > + * Additionally, the same layout-qualifier-name can occur
>> > multiple times
>> > + * within a layout qualifier or across multiple layout
>> > qualifiers in the
>> > + * same declaration"
>> > + */
>> > +layout(rgba32f, rgba32f) uniform image2D img;
>> > +
>> > +void main()
>> > +{
>> > +}
>> > diff --git
>> > a/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-enhanced-layouts.vert
>> > b/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-enhanced-layouts.vert
>> > new file mode 100644
>> > index 0000000..f1bb73d
>> > --- /dev/null
>> > +++ b/tests/spec/arb_shader_image_load_store/compiler/declaration
>> > -format-qualifier-duplicate-enhanced-layouts.vert
>> > @@ -0,0 +1,29 @@
>> > +/*
>> > + * [config]
>> > + * expect_result: fail
>> > + * glsl_version: 1.50
>> > + * require_extensions: GL_ARB_shader_image_load_store
>> > GL_ARB_enhanced_layouts
>> > + * [end config]
>> > + */
>> > +#version 150
>> > +#extension GL_ARB_shader_image_load_store: require
>> > +#extension GL_ARB_enhanced_layouts: require
>> > +
>> > +/*
>> > + * From the ARB_shader_image_load_store spec:
>> > + *
>> > + * "Only one format qualifier may be specified for any image
>> > variable
>> > + * declaration."
>> > + *
>> > + * From the ARB_enhanced_layouts spec:
>> > + *
>> > + * "More than one layout qualifier may appear in a single
>> > declaration.
>> > + * Additionally, the same layout-qualifier-name can occur
>> > multiple times
>> > + * within a layout qualifier or across multiple layout
>> > qualifiers in the
>> > + * same declaration"
>> > + */
>> > +layout(rgba32f, rgba32f) uniform image2D img;
>> > +
>> > +void main()
>> > +{
>> > +}
>> > _______________________________________________
>> > Piglit mailing list
>> > Piglit at lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/piglit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20160119/4da971b2/attachment.sig>
More information about the Piglit
mailing list