[Piglit] [PATCH 2/5] arb_enhanced_layouts: add basic compile time constant compile tests

Timothy Arceri timothy.arceri at collabora.com
Sun Nov 1 21:45:42 PST 2015


On Sun, 2015-11-01 at 21:15 -0500, Ilia Mirkin wrote:
> On Sun, Nov 1, 2015 at 8:54 PM, Timothy Arceri
> <timothy.arceri at collabora.com> wrote:
> > ---
> >  .../binding-separate-shader-objects.frag              | 18
> > ++++++++++++++++++
> >  .../compiler-time-constants/index-subroutine.vert     | 16
> > ++++++++++++++++
> >  .../compiler/compiler-time-constants/index.frag       | 17
> > +++++++++++++++++
> >  .../compiler-time-constants/input-location.vert       | 17
> > +++++++++++++++++
> >  .../compiler/compiler-time-constants/invocation.geom  | 17
> > +++++++++++++++++
> >  .../compiler-time-constants/local_size_x.comp         | 16
> > ++++++++++++++++
> >  .../compiler-time-constants/local_size_y.comp         | 16
> > ++++++++++++++++
> >  .../compiler-time-constants/local_size_z.comp         | 16
> > ++++++++++++++++
> >  .../compiler-time-constants/max_vertices.geom         | 17
> > +++++++++++++++++
> >  .../compiler-time-constants/offset-atomic.frag        | 16
> > ++++++++++++++++
> >  .../compiler/compiler-time-constants/stream.geom      | 19
> > +++++++++++++++++++
> >  .../compiler-time-constants/uniform-location.vert     | 18
> > ++++++++++++++++++
> >  .../compiler/compiler-time-constants/vertices.tesc    | 16
> > ++++++++++++++++
> >  13 files changed, 219 insertions(+)
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/binding-separate-shader-objects.frag
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/index-subroutine.vert
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/index.frag
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/input-location.vert
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/invocation.geom
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/local_size_x.comp
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/local_size_y.comp
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/local_size_z.comp
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/max_vertices.geom
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/offset-atomic.frag
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/stream.geom
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/uniform-location.vert
> >  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/vertices.tesc
> > 
> > diff --git a/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/binding-separate-shader-objects.frag
> > b/tests/spec/arb_enhanced_layouts/compiler/compiler-time-constants/binding
> > -separate-shader-objects.frag
> > new file mode 100644
> > index 0000000..468fb93
> > --- /dev/null
> > +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/binding-separate-shader-objects.frag
> 
> These are generally known as compile-time constants, not compiler-time.
> 
> > @@ -0,0 +1,18 @@
> > +// [config]
> > +// expect_result: pass
> > +// glsl_version: 1.50
> > +// require_extensions: GL_ARB_shader_storage_buffer_object
> > GL_ARB_enhanced_layouts
> > +// [end config]
> > +
> > +#version 150
> > +#extension GL_ARB_shader_storage_buffer_object: require
> > +#extension GL_ARB_enhanced_layouts: require
> > +
> > +const int start = 3;
> > +layout (binding = start + 4) buffer buf {
> > +       float f;
> > +};
> > +
> > +float foo(void) {
> > +       return f;
> > +}
> > diff --git a/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/index-subroutine.vert
> > b/tests/spec/arb_enhanced_layouts/compiler/compiler-time-constants/index
> > -subroutine.vert
> > new file mode 100644
> > index 0000000..33a24d3
> > --- /dev/null
> > +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/index-subroutine.vert
> > @@ -0,0 +1,16 @@
> > +// [config]
> > +// expect_result: pass
> > +// glsl_version: 1.50
> > +// require_extensions: GL_ARB_shader_subroutine GL_ARB_enhanced_layouts
> > GL_ARB_explicit_uniform_location
> > +// [end config]
> > +
> > +#version 150
> > +#extension GL_ARB_shader_subroutine: require
> > +#extension GL_ARB_enhanced_layouts: require
> > +#extension GL_ARB_explicit_uniform_location: require
> > +
> > +const int start = 3;
> > +subroutine void func_type();
> > +
> > +/* A subroutine matching the above type */
> > +layout(index = start + 2) subroutine (func_type) void f() {}
> > diff --git a/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/index.frag b/tests/spec/arb_enhanced_layouts/compiler/compiler
> > -time-constants/index.frag
> > new file mode 100644
> > index 0000000..0ef0b3c
> > --- /dev/null
> > +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/index.frag
> > @@ -0,0 +1,17 @@
> > +// [config]
> > +// expect_result: pass
> > +// glsl_version: 1.20
> 
> 1.40
> 
> > +// require_extensions: GL_ARB_explicit_attrib_location
> > GL_ARB_enhanced_layouts
> > +// [end config]
> > +
> > +#version 120
> > +#extension GL_ARB_explicit_attrib_location: require
> > +#extension GL_ARB_enhanced_layouts: require
> > +
> > +const int start = 0;
> > +layout(location = 0, index = start + 1) varying vec4 color;
> > +
> > +void main()
> > +{
> > +       color = vec4(1.0);
> > +}
> > diff --git a/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/input-location.vert
> > b/tests/spec/arb_enhanced_layouts/compiler/compiler-time-constants/input
> > -location.vert
> > new file mode 100644
> > index 0000000..f934595
> > --- /dev/null
> > +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/input-location.vert
> > @@ -0,0 +1,17 @@
> > +// [config]
> > +// expect_result: pass
> > +// glsl_version: 1.10
> 
> 1.40
> 
> > +// require_extensions: GL_ARB_enhanced_layouts
> > GL_ARB_explicit_attrib_location
> > +// [end config]
> > +
> > +#version 110
> > +#extension GL_ARB_explicit_attrib_location: require
> > +#extension GL_ARB_enhanced_layouts: require
> > +
> > +const int start = 3;
> > +layout(location = start + 2) in vec4 b;
> > +
> > +void main()
> > +{
> > +       gl_Position = b;
> > +}
> > diff --git a/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/invocation.geom
> > b/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/invocation.geom
> > new file mode 100644
> > index 0000000..aeb221c
> > --- /dev/null
> > +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/invocation.geom
> > @@ -0,0 +1,17 @@
> > +// [config]
> > +// expect_result: pass
> > +// glsl_version: 1.50
> > +// require_extensions: GL_ARB_gpu_shader5 GL_ARB_enhanced_layouts
> > +// check_link: false
> > +// [end config]
> > +
> > +#version 150
> > +#extension GL_ARB_gpu_shader5: enable
> > +#extension GL_ARB_enhanced_layouts: require
> > +
> > +const int start = 3;
> > +layout(lines, invocations = start + 2) in;
> > +
> > +void main()
> > +{
> > +}
> > diff --git a/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/local_size_x.comp
> > b/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/local_size_x.comp
> > new file mode 100644
> > index 0000000..efe028f
> > --- /dev/null
> > +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time
> > -constants/local_size_x.comp
> > @@ -0,0 +1,16 @@
> > +// [config]
> > +// expect_result: pass
> > +// glsl_version: 3.30
> 
> Why 3.30? ARB_cs claims it needs 4.2 but that's probably BS.

Just because thats what all the cs tests were doing, I didn't look into it
further.


More information about the Piglit mailing list