[Piglit] [PATCH] getuniform-01: Add a fragment shader to enusre the uniform is active

Ian Romanick idr at freedesktop.org
Fri Oct 21 11:36:28 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
---
 tests/shaders/getuniform-01.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/tests/shaders/getuniform-01.c b/tests/shaders/getuniform-01.c
index 6daf8ca..ffbce1f 100644
--- a/tests/shaders/getuniform-01.c
+++ b/tests/shaders/getuniform-01.c
@@ -46,6 +46,11 @@ static const char vs_text[] =
 	"}\n"
 	;
 
+static const char fs_text[] =
+	"varying vec4 color;\n"
+	"void main() { gl_FragColor = color; }\n"
+	;
+
 static GLint prog;
 static GLint base_location;
 static GLint array_location[4];
@@ -94,6 +99,7 @@ piglit_init(int argc, char **argv)
 		12.0, 0.5, 3.14169, 42.0
 	};
 	GLint vs;
+	GLint fs;
 	unsigned i;
 	union data_blob buffer[16];
 
@@ -101,8 +107,9 @@ piglit_init(int argc, char **argv)
 	piglit_require_fragment_shader();
 
 	vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_text);
+	fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_text);
 
-	prog = piglit_link_simple_program(vs, 0);
+	prog = piglit_link_simple_program(vs, fs);
 
 	piglit_UseProgram(prog);
 
-- 
1.7.6.4



More information about the Piglit mailing list