From d944694a4e7f5f5a74c228dae4041537b52709f8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 8 Mar 2019 18:52:44 -0800 Subject: fbo-integer: Allow test to run on either GLSL 1.30 or GL_EXT_gpu_shader4 Cc: Vinson Lee Cc: Brian Paul --- tests/fbo/fbo-integer.c | 17 +++++++++-------- 1 file 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); -- cgit v1.2.3