[Piglit] [PATCH] arb_compute_variable_group_size: add ARB_compute_shader enables
Nicolai Hähnle
nhaehnle at gmail.com
Mon Oct 17 19:38:02 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
Without those, many of the tests started failing now that Mesa explicitly
checks for the compute shader enable in the compiler.
---
tests/spec/arb_compute_variable_group_size/compiler/do_nothing.comp | 1 +
.../compiler/gl_LocalGroupSizeARB_illegal_use.comp | 1 +
.../compiler/gl_LocalGroupSizeARB_layout.comp | 1 +
tests/spec/arb_compute_variable_group_size/errors.c | 1 +
.../execution/basic-local-size.shader_test | 1 +
.../linker/mixed_fixed_variable_local_work_size.shader_test | 2 ++
.../linker/no_local_size_specified.shader_test | 2 ++
tests/spec/arb_compute_variable_group_size/local-size.c | 1 +
8 files changed, 10 insertions(+)
diff --git a/tests/spec/arb_compute_variable_group_size/compiler/do_nothing.comp b/tests/spec/arb_compute_variable_group_size/compiler/do_nothing.comp
index 95c061b..ae2e973 100644
--- a/tests/spec/arb_compute_variable_group_size/compiler/do_nothing.comp
+++ b/tests/spec/arb_compute_variable_group_size/compiler/do_nothing.comp
@@ -1,14 +1,15 @@
// [config]
// expect_result: pass
// glsl_version: 3.30
// require_extensions: GL_ARB_compute_variable_group_size
// [end config]
#version 330
+#extension GL_ARB_compute_shader: enable
#extension GL_ARB_compute_variable_group_size: enable
layout(local_size_variable) in;
void main()
{
}
diff --git a/tests/spec/arb_compute_variable_group_size/compiler/gl_LocalGroupSizeARB_illegal_use.comp b/tests/spec/arb_compute_variable_group_size/compiler/gl_LocalGroupSizeARB_illegal_use.comp
index f8fcf92..5eb8f4d 100644
--- a/tests/spec/arb_compute_variable_group_size/compiler/gl_LocalGroupSizeARB_illegal_use.comp
+++ b/tests/spec/arb_compute_variable_group_size/compiler/gl_LocalGroupSizeARB_illegal_use.comp
@@ -11,18 +11,19 @@
// example, a shader might want to declare a shared variable with one
// instance per work group invocation, such as:
//
// shared float shared_values[gl_WorkGroupSize.x *
// gl_WorkGroupSize.y * gl_WorkGroupSize.z];
//
// Such declarations would be illegal using the input
// "gl_LocalGroupSizeARB".
#version 330
+#extension GL_ARB_compute_shader: enable
#extension GL_ARB_compute_variable_group_size: enable
layout(local_size_variable) in;
void main()
{
uint v[gl_LocalGroupSizeARB.x];
}
diff --git a/tests/spec/arb_compute_variable_group_size/compiler/gl_LocalGroupSizeARB_layout.comp b/tests/spec/arb_compute_variable_group_size/compiler/gl_LocalGroupSizeARB_layout.comp
index 953856e..d575001 100644
--- a/tests/spec/arb_compute_variable_group_size/compiler/gl_LocalGroupSizeARB_layout.comp
+++ b/tests/spec/arb_compute_variable_group_size/compiler/gl_LocalGroupSizeARB_layout.comp
@@ -10,18 +10,19 @@
// variable containing the local work group size for the current compute-
// shader work group. For compute shaders with a fixed local group size
// (using *local_size_x*, *local_size_y*, or *local_size_z* layout
// qualifiers), its value will be the same as the constant
// /gl_WorkGroupSize/. For compute shaders with a variable local group size
// (using *local_size_variable*), the value of /gl_LocalGroupSizeARB/ will
// be the work group size specified in the OpenGL API command dispatching
// the current compute shader work.
#version 330
+#extension GL_ARB_compute_shader: enable
#extension GL_ARB_compute_variable_group_size: enable
layout(local_size_variable) in;
void main()
{
uvec3 size = gl_LocalGroupSizeARB;
}
diff --git a/tests/spec/arb_compute_variable_group_size/errors.c b/tests/spec/arb_compute_variable_group_size/errors.c
index 19945d1..82bae42 100644
--- a/tests/spec/arb_compute_variable_group_size/errors.c
+++ b/tests/spec/arb_compute_variable_group_size/errors.c
@@ -35,20 +35,21 @@ static struct piglit_gl_test_config *piglit_config;
PIGLIT_GL_TEST_CONFIG_BEGIN
piglit_config = &config;
config.supports_gl_compat_version = 33;
config.supports_gl_core_version = 33;
PIGLIT_GL_TEST_CONFIG_END
static const char *variable_work_group_size_shader =
"#version 330\n"
+ "#extension GL_ARB_compute_shader: enable\n"
"#extension GL_ARB_compute_variable_group_size: enable\n"
"\n"
"layout(local_size_variable) in;\n"
"\n"
"void main()\n"
"{\n"
"}\n";
static const char *fixed_work_group_size_shader =
"#version 330\n"
diff --git a/tests/spec/arb_compute_variable_group_size/execution/basic-local-size.shader_test b/tests/spec/arb_compute_variable_group_size/execution/basic-local-size.shader_test
index 108ebd5..75c93f7 100644
--- a/tests/spec/arb_compute_variable_group_size/execution/basic-local-size.shader_test
+++ b/tests/spec/arb_compute_variable_group_size/execution/basic-local-size.shader_test
@@ -2,20 +2,21 @@
# functioning. Atomic counters are used as outputs.
[require]
GL >= 3.3
GLSL >= 3.30
GL_ARB_compute_variable_group_size
GL_ARB_shader_atomic_counters
[compute shader]
#version 330
+#extension GL_ARB_compute_shader: enable
#extension GL_ARB_compute_variable_group_size: enable
#extension GL_ARB_shader_atomic_counters: require
layout(binding = 0) uniform atomic_uint a;
layout(local_size_variable) in;
void main()
{
if (gl_LocalGroupSizeARB.x == 8u &&
diff --git a/tests/spec/arb_compute_variable_group_size/linker/mixed_fixed_variable_local_work_size.shader_test b/tests/spec/arb_compute_variable_group_size/linker/mixed_fixed_variable_local_work_size.shader_test
index d660d56..6d52933 100644
--- a/tests/spec/arb_compute_variable_group_size/linker/mixed_fixed_variable_local_work_size.shader_test
+++ b/tests/spec/arb_compute_variable_group_size/linker/mixed_fixed_variable_local_work_size.shader_test
@@ -1,36 +1,38 @@
# The ARB_compute_variable_group_size spec says:
#
# If one compute shader attached to a program declares a variable local
# group size and a second compute shader attached to the same program
# declares a fixed local group size, a link-time error results.
[require]
GL >= 3.3
GLSL >= 3.30
GL_ARB_compute_shader
+GL_ARB_compute_variable_group_size
[compute shader]
#version 330
#extension GL_ARB_compute_shader: enable
layout(local_size_x = 2) in;
void foo();
void main()
{
foo();
}
[compute shader]
#version 330
+#extension GL_ARB_compute_shader: enable
#extension GL_ARB_compute_variable_group_size: enable
layout(local_size_variable) in;
void foo()
{
}
[test]
link error
diff --git a/tests/spec/arb_compute_variable_group_size/linker/no_local_size_specified.shader_test b/tests/spec/arb_compute_variable_group_size/linker/no_local_size_specified.shader_test
index 6371c29..78428df 100644
--- a/tests/spec/arb_compute_variable_group_size/linker/no_local_size_specified.shader_test
+++ b/tests/spec/arb_compute_variable_group_size/linker/no_local_size_specified.shader_test
@@ -1,32 +1,34 @@
# The ARB_compute_variable_group_size spec says:
#
# Furthermore, if a program object contains any compute shaders, at least
# one must contain an input layout qualifier specifying a fixed or variable
# local group size for the program, or a link-time error will occur.
[require]
GL >= 3.3
GLSL >= 3.30
GL_ARB_compute_shader
+GL_ARB_compute_variable_group_size
[compute shader]
#version 330
#extension GL_ARB_compute_shader: enable
void foo();
void main()
{
foo();
}
[compute shader]
#version 330
+#extension GL_ARB_compute_shader: enable
#extension GL_ARB_compute_variable_group_size: enable
void foo()
{
}
[test]
link error
diff --git a/tests/spec/arb_compute_variable_group_size/local-size.c b/tests/spec/arb_compute_variable_group_size/local-size.c
index e646c06..26cf5d6 100644
--- a/tests/spec/arb_compute_variable_group_size/local-size.c
+++ b/tests/spec/arb_compute_variable_group_size/local-size.c
@@ -44,20 +44,21 @@ static uint32_t local_x = 0, local_y = 0, local_z = 0;
static int32_t max_local_x = 0, max_local_y = 0, max_local_z = 0;
static int32_t max_variable_invocations = 0;
static uint32_t sizes[] = {
1, 2, 3, 4, 5, 7, 8, 9, 15, 16, 17, 31, 32, 33, 63, 64, 65,
127, 128, 129, 255, 256, 257, 511, 512, 513, 1023, 1024
};
static const char *compute_shader_source =
"#version 330\n"
+ "#extension GL_ARB_compute_shader: enable\n"
"#extension GL_ARB_compute_variable_group_size: enable\n"
"#extension GL_ARB_shader_atomic_counters: require\n"
"\n"
"layout(binding = 0) uniform atomic_uint a;\n"
"layout(local_size_variable) in;\n"
"\n"
"void main()\n"
"{\n"
" if (gl_LocalGroupSizeARB.x == %du &&\n"
" gl_LocalGroupSizeARB.y == %du &&\n"
--
2.7.4
More information about the Piglit
mailing list