summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2019-03-08 18:52:44 -0800
committerIan Romanick <ian.d.romanick@intel.com>2019-06-26 08:31:49 -0700
commitd944694a4e7f5f5a74c228dae4041537b52709f8 (patch)
treeabf5a168cccdc3b73cd9851aa209f353719d0741
parentc7fcd8ee2b3664478f7129e05ede6d442c09185f (diff)
fbo-integer: Allow test to run on either GLSL 1.30 or GL_EXT_gpu_shader4
Cc: Vinson Lee <vlee@freedesktop.org> Cc: Brian Paul <brianp@vmware.com>
-rw-r--r--tests/fbo/fbo-integer.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/fbo/fbo-integer.c b/tests/fbo/fbo-integer.c
index 27e4323af..a83a3097a 100644
--- a/tests/fbo/fbo-integer.c
+++ b/tests/fbo/fbo-integer.c
@@ -23,8 +23,9 @@
*/
/**
- * @file
- * Tests FBO rendering with GL_EXT_texture_integer and GL_EXT_gpu_shader4.
+ * @file fbo-integer.c
+ * Test FBO rendering with GL_EXT_texture_integer and either
+ * GL_EXT_gpu_shader4 or GLSL 1.30.
*/
@@ -75,7 +76,6 @@ static const struct format_info Formats[] = {
*/
static const char *SimpleFragShaderText =
"#version 130 \n"
- "#extension GL_EXT_gpu_shader4: enable \n"
"uniform ivec4 value; \n"
"out ivec4 out_color; \n"
"void main() \n"
@@ -259,10 +259,11 @@ test_fbo(const struct format_info *info)
glUniform4iv(loc, 1, value);
check_error(__FILE__, __LINE__);
-#if 0 /* allow testing on mesa until this is implemented */
- loc = glGetFragDataLocationEXT(SimpleProgram, "out_color");
+ if (piglit_get_gl_version() < 130)
+ loc = glGetFragDataLocationEXT(SimpleProgram, "out_color");
+ else
+ loc = glGetFragDataLocation(SimpleProgram, "out_color");
assert(loc >= 0);
-#endif
glBegin(GL_POLYGON);
glVertex2f(0, 0);
@@ -319,9 +320,9 @@ piglit_init(int argc, char **argv)
{
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_EXT_texture_integer");
- piglit_require_extension("GL_EXT_gpu_shader4");
- piglit_require_GLSL_version(130);
+ if (piglit_get_gl_version() < 130)
+ piglit_require_extension("GL_EXT_gpu_shader4");
PassthroughFragShader = piglit_compile_shader_text(GL_FRAGMENT_SHADER,
PassthroughFragShaderText);