From aea7f14b17224ac2f8ba5be2f056d73a005dd860 Mon Sep 17 00:00:00 2001 From: Benedikt Schemmer Date: Wed, 18 Apr 2018 10:19:00 +0200 Subject: [PATCH] temporary fix --- tests/texturing/zero-tex-coord.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/tests/texturing/zero-tex-coord.c b/tests/texturing/zero-tex-coord.c index 98f3629b9..35d02427b 100644 --- a/tests/texturing/zero-tex-coord.c +++ b/tests/texturing/zero-tex-coord.c @@ -54,30 +54,36 @@ struct sample_function { static const struct sample_function sample_functions[] = { - { "texture2D", "texture2D(tex, vec2(0.0))", 0 }, - { "bias", "texture2D(tex, vec2(0.0), 0.0)", 0 }, + { "texture2D", + "gl_FragColor = texture2D(tex, vec2(0.0))", + 0 }, + { "bias", + "gl_FragColor = texture2D(tex, vec2(0.0), 0.0)", + 0 }, { "textureGrad", - "textureGrad(tex, vec2(0.0), vec2(0.0), vec2(0.0))", + "gl_FragColor = textureGrad(tex, vec2(0.0), vec2(0.0), vec2(0.0))", + 130 }, + { "texelFetch", + "gl_FragColor = texelFetch(tex, ivec2(0), 0)", 130 }, - { "texelFetch", "texelFetch(tex, ivec2(0), 0)", 130 }, { "textureLod", - "textureLod(tex, vec2(0.0), 0.0)", + "gl_FragColor = textureLod(tex, vec2(0.0), 0.0)", 130 }, { "textureSize", - "textureSize(tex, 0) == ivec2(4) ? " + "gl_FragColor = textureSize(tex, 0) == ivec2(4) ? " "vec4(0.0, 1.0, 0.0, 1.0) : " "vec4(1.0, 0.0, 0.0, 1.0)", 130 }, { "textureQueryLOD", - "textureQueryLOD(tex, vec2(0.0)).x == 0.0 ? " + "gl_FragColor = textureQueryLOD(tex, vec2(0.0)).x == 0.0 ? " "vec4(0.0, 1.0, 0.0, 1.0) : " "vec4(1.0, 0.0, 0.0, 1.0)", 0, "GL_ARB_texture_query_lod" }, { "textureGather", - "textureGather(tex, vec2(0.0), 0) == vec4(0.0) ? " + "fragColor = textureGather(tex, vec2(0.0), 0) == vec4(0.0) ? " "vec4(0.0, 1.0, 0.0, 1.0) : " "vec4(1.0, 0.0, 0.0, 1.0)", - 130, "GL_ARB_gpu_shader5" }, + 150, "GL_ARB_gpu_shader5" }, }; static const char @@ -97,7 +103,7 @@ fragment_source[] = "void\n" "main()\n" "{\n" - " gl_FragColor = SNIPPET;\n" + " SNIPPET;\n" "}\n"; const struct sample_function * @@ -190,6 +196,10 @@ make_program(void) piglit_require_extension(sample_function->extension); } + if (glsl_version >= 150) { + p += sprintf(p, "out vec4 fragColor;\n"); + } + memcpy(p, fragment_source, snippet_pos); p += snippet_pos; memcpy(p, snippet, snippet_length); -- 2.14.1