summaryrefslogtreecommitdiff
path: root/tests/spec/arb_shader_draw_parameters
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2020-10-26 12:25:42 -0700
committerIan Romanick <ian.d.romanick@intel.com>2020-12-07 16:41:11 -0800
commitad875eed0cd4401978798bbe762974af5773fd5d (patch)
tree0ec4d6b000c2848ebaa01e8d99c32dd2c25d6ca3 /tests/spec/arb_shader_draw_parameters
parent15a0c0f235148ef2a7512efec92b9cc8ab4e5254 (diff)
shader_draw_parameters: Reduce GLSL requirement back to 1.40
The extensions being tested only require OpenGL 3.1. The top-level OpenGL requirement of the tests is OpenGL 3.1. Commit 43aec6de0 ("arb_shader_draw_parameters: require GLSL 3.30") added a GLSL 3.30 requirement due to the use of layout("location=...") in the shaders. This is effectively an OpenGL 3.3 requirement. To increase (theoretical) test coverage, make these tests work on vanilla OpenGL 3.1 again. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/427>
Diffstat (limited to 'tests/spec/arb_shader_draw_parameters')
-rw-r--r--tests/spec/arb_shader_draw_parameters/basevertex.c12
-rw-r--r--tests/spec/arb_shader_draw_parameters/drawid-indirect.c12
-rw-r--r--tests/spec/arb_shader_draw_parameters/drawid.c13
3 files changed, 18 insertions, 19 deletions
diff --git a/tests/spec/arb_shader_draw_parameters/basevertex.c b/tests/spec/arb_shader_draw_parameters/basevertex.c
index 4db6cd17b..649bd3ea8 100644
--- a/tests/spec/arb_shader_draw_parameters/basevertex.c
+++ b/tests/spec/arb_shader_draw_parameters/basevertex.c
@@ -56,16 +56,16 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
PIGLIT_GL_TEST_CONFIG_END
static const char vs_template[] =
- "#version 330\n"
+ "#version 140\n"
"#extension GL_ARB_shader_draw_parameters: require\n"
"\n"
- "layout(location = 0) in vec2 pos;\n"
- "layout(location = 1) in ivec4 ref;\n"
+ "in vec4 piglit_vertex;\n"
+ "in ivec4 ref;\n"
"out vec4 color;\n"
"\n"
"void main()\n"
"{\n"
- " gl_Position = vec4(pos, 0.0, 1.0);\n"
+ " gl_Position = piglit_vertex;\n"
" if (%s)\n"
" color = vec4(0, 1, 0, 1);\n"
" else\n"
@@ -116,8 +116,6 @@ piglit_init(int argc, char **argv)
}
}
- piglit_require_GLSL_version(330);
-
piglit_require_extension("GL_ARB_shader_draw_parameters");
piglit_require_extension("GL_ARB_base_instance");
if (opt_draw_indirect)
@@ -125,6 +123,8 @@ piglit_init(int argc, char **argv)
prog = piglit_build_simple_program(vs_text, fs_text);
+ glBindAttribLocation(prog, 1, (const GLchar *) "ref");
+ glLinkProgram(prog);
glUseProgram(prog);
}
diff --git a/tests/spec/arb_shader_draw_parameters/drawid-indirect.c b/tests/spec/arb_shader_draw_parameters/drawid-indirect.c
index 84d270eec..d59893587 100644
--- a/tests/spec/arb_shader_draw_parameters/drawid-indirect.c
+++ b/tests/spec/arb_shader_draw_parameters/drawid-indirect.c
@@ -50,16 +50,16 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
PIGLIT_GL_TEST_CONFIG_END
static const char vs_template[] =
- "#version 330\n"
+ "#version 140\n"
"#extension GL_ARB_shader_draw_parameters: require\n"
"\n"
- "layout(location = 0) in vec2 pos;\n"
- "layout(location = 1) in ivec4 ref;\n"
+ "in vec4 piglit_vertex;\n"
+ "in ivec4 ref;\n"
"out vec4 color;\n"
"\n"
"void main()\n"
"{\n"
- " gl_Position = vec4(pos, 0.0, 1.0);\n"
+ " gl_Position = piglit_vertex;\n"
" if (%s)\n"
" color = vec4(0, 1, 0, 1);\n"
" else\n"
@@ -99,8 +99,6 @@ piglit_init(int argc, char **argv)
piglit_report_result(PIGLIT_FAIL);
}
- piglit_require_GLSL_version(330);
-
piglit_require_extension("GL_ARB_shader_draw_parameters");
piglit_require_extension("GL_ARB_base_instance");
@@ -120,6 +118,8 @@ piglit_init(int argc, char **argv)
prog = piglit_build_simple_program(vs_text, fs_text);
+ glBindAttribLocation(prog, 1, (const GLchar *) "ref");
+ glLinkProgram(prog);
glUseProgram(prog);
}
diff --git a/tests/spec/arb_shader_draw_parameters/drawid.c b/tests/spec/arb_shader_draw_parameters/drawid.c
index b3a26e179..7351614c7 100644
--- a/tests/spec/arb_shader_draw_parameters/drawid.c
+++ b/tests/spec/arb_shader_draw_parameters/drawid.c
@@ -37,17 +37,16 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
PIGLIT_GL_TEST_CONFIG_END
static const char vs_template[] =
- "#version 330\n"
+ "#version 140\n"
"#extension GL_ARB_shader_draw_parameters: require\n"
"\n"
- "/* This is floating point so we can use immediate mode */\n"
- "layout(location = 0) in vec2 pos;\n"
- "layout(location = 1) in ivec2 ref;\n"
+ "in vec4 piglit_vertex;\n"
+ "in ivec2 ref;\n"
"out vec4 color;\n"
"\n"
"void main()\n"
"{\n"
- " gl_Position = vec4(pos, 0.0, 1.0);\n"
+ " gl_Position = piglit_vertex;\n"
" if (%s)\n"
" color = vec4(0, 1, 0, 1);\n"
" else\n"
@@ -81,13 +80,13 @@ piglit_init(int argc, char **argv)
piglit_report_result(PIGLIT_FAIL);
}
- piglit_require_GLSL_version(330);
-
piglit_require_extension("GL_ARB_shader_draw_parameters");
piglit_require_extension("GL_ARB_base_instance");
prog = piglit_build_simple_program(vs_text, fs_text);
+ glBindAttribLocation(prog, 1, (const GLchar *) "ref");
+ glLinkProgram(prog);
glUseProgram(prog);
}