diff mbox

arb_gpu_shader5: test member stream qualifiers match a named blocks qualifier

Message ID 1445073666-8670-1-git-send-email-t_arceri@yahoo.com.au
State New
Headers show

Commit Message

'Timothy Arceri' via Patchwork Forward Oct. 17, 2015, 9:21 a.m. UTC
Named and unnamed interfaces have different code paths in Mesa this
uncovers a bug with named instances.
---
 ...ltiple-named-block-layout-qualifier-stream.geom | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom

Comments

Samuel Iglesias Gonsálvez Oct. 19, 2015, 11:50 a.m. UTC | #1
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>

Thanks,

Sam

On 17/10/15 11:21, Timothy Arceri wrote:
> Named and unnamed interfaces have different code paths in Mesa this
> uncovers a bug with named instances.
> ---
>  ...ltiple-named-block-layout-qualifier-stream.geom | 32 ++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
>  create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
> 
> diff --git a/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
> new file mode 100644
> index 0000000..83a4ff3
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
> @@ -0,0 +1,32 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_gpu_shader5
> +// check_link: false
> +// [end config]
> +//
> +// ARB_gpu_shader5 spec says:
> +//   "A block member may be declared with a stream
> +//    qualifier, but the specified stream must match the stream
> +//    associated with the containing block."
> +//
> +// Tests for multiple declarations of layout qualifier 'stream' for
> +// block's fields.
> +//
> +
> +#version 150
> +#extension GL_ARB_gpu_shader5 : enable
> +
> +layout(points) in;
> +layout(triangle_strip, max_vertices=3) out;
> +
> +out Block1 { // By default, it uses stream = 0
> +	layout(stream=1) vec4 var1; // Wrong: different than block's stream value
> +	layout(stream=3) vec4 var2; // Wrong: different than block's stream value
> +	layout(stream=0) vec4 var3; // Valid
> +	vec4 var4; // Valid
> +} block_name;
> +
> +void main()
> +{
> +}
>
diff mbox

Patch

diff --git a/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
new file mode 100644
index 0000000..83a4ff3
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
@@ -0,0 +1,32 @@ 
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// check_link: false
+// [end config]
+//
+// ARB_gpu_shader5 spec says:
+//   "A block member may be declared with a stream
+//    qualifier, but the specified stream must match the stream
+//    associated with the containing block."
+//
+// Tests for multiple declarations of layout qualifier 'stream' for
+// block's fields.
+//
+
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(points) in;
+layout(triangle_strip, max_vertices=3) out;
+
+out Block1 { // By default, it uses stream = 0
+	layout(stream=1) vec4 var1; // Wrong: different than block's stream value
+	layout(stream=3) vec4 var2; // Wrong: different than block's stream value
+	layout(stream=0) vec4 var3; // Valid
+	vec4 var4; // Valid
+} block_name;
+
+void main()
+{
+}