[Piglit] [PATCH] arb_shader_image_load_store: test duplicate format qualifier more thoroughly

Timothy Arceri timothy.arceri at collabora.com
Tue Jan 19 18:27:03 PST 2016


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.

> 
> >  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


More information about the Piglit mailing list