[Piglit] [PATCH 4/5] arb_enhanced_layouts: test negative compile time constants

Emil Velikov emil.l.velikov at gmail.com
Wed Nov 4 04:10:09 PST 2015


Hi Tim,

On 2 November 2015 at 01:54, Timothy Arceri
<timothy.arceri at collabora.com> wrote:

> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time-constants/negative-qualifiers/binding-separate-shader-objects.frag
> @@ -0,0 +1,25 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_shader_storage_buffer_object GL_ARB_enhanced_layouts
> +// [end config]
> +//
> +// From Section 4.4.5 (Uniform and Shader Storage Block Layout Qualifiers)
> +// of the GLSL 4.5 spec:
> +//
> +// "If the binding point for any uniform or shader storage block instance is
> +// less than zero, or greater than or equal to the implementation-dependent
> +// maximum number of uniform buffer bindings, a compile-time error will occur."
> +
> +#version 150
140 ?

> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time-constants/negative-qualifiers/index-subroutine.vert
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_shader_subroutine GL_ARB_enhanced_layouts GL_ARB_explicit_uniform_location
> +// [end config]
> +//
> +// From the ARB_explicit_uniform_location spec:
> +//
> +// "The subroutine functions can be assigned an explicit index in the shader
> +// between 0 and MAX_SUBROUTINES minus one."
> +
> +#version 150
Just confirming - 150 requirement is due to GL_ARB_shader_subroutine ?


> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time-constants/negative-qualifiers/index.frag
> @@ -0,0 +1,23 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.20
> +// require_extensions: GL_ARB_explicit_attrib_location GL_ARB_enhanced_layouts
> +// [end config]
> +//
> +// While the GL_ARB_explicit_attrib_location specification does not say
> +// anything about generating errors for invalid indices, the GLSL 4.30
> +// spec clarifies this: "It is also a compile-time error if a fragment shader
> +// sets a layout index to less than 0 or greater than 1."  This matches the
> +// behavior of the equivalent API call, glBindFragDataLocationIndexed, which
> +// generates an INVALID_VALUE error if <index> is not 0 or 1.
> +
> +#version 120
140 ?


> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/compiler-time-constants/negative-qualifiers/negative-layout-qualifier-location.vert
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location
> +// [end config]
> +//
> +// From the ARB_explicit_uniform_location spec:
> +//
> +// "Valid locations for default-block uniform variable locations are in the
> +// range of 0 to the implementation-defined maximum number of uniform
> +// locations."
> +
> +#version 110
140 ?

With the above
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

-Emil


More information about the Piglit mailing list