[Piglit] [PATCH 2/5] ext_texture_array: Use piglit_build_simple_program

Ian Romanick idr at freedesktop.org
Wed Dec 2 08:43:53 PST 2015


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

I don't think piglit_build_simple_program supported piglit_vertex and
piglit_texcoord when this test was written, but it does now.  Use it!

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/spec/ext_texture_array/compressed.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/tests/spec/ext_texture_array/compressed.c b/tests/spec/ext_texture_array/compressed.c
index cc45cc9..f8acc1d 100644
--- a/tests/spec/ext_texture_array/compressed.c
+++ b/tests/spec/ext_texture_array/compressed.c
@@ -86,24 +86,22 @@ PIGLIT_GL_TEST_CONFIG_END
 static const char vs_text[] =
 #ifdef PIGLIT_USE_OPENGL
 	"#version 120\n"
-	"#define piglit_Vertex gl_Vertex\n"
-	"#define piglit_MultiTexCoord0 gl_MultiTexCoord0\n"
 	"#define piglit_in attribute\n"
 	"#define piglit_out varying\n"
 #else // PIGLIT_USE_OPENGL_ES3
 	"#version 300 es\n"
 	"#define piglit_in in\n"
 	"#define piglit_out out\n"
-	"piglit_in vec4 piglit_Vertex;\n"
-	"piglit_in vec4 piglit_MultiTexCoord0;\n"
 #endif
+	"piglit_in vec4 piglit_vertex;\n"
+	"piglit_in vec4 piglit_texcoord;\n"
 	"piglit_out vec3 texcoord;\n"
 	"uniform mat4 proj;\n"
 	"uniform int layer;\n"
 	"void main()\n"
 	"{\n"
-	"  gl_Position = proj * piglit_Vertex;\n"
-	"  texcoord = vec3(piglit_MultiTexCoord0.xy, float(layer));\n"
+	"  gl_Position = proj * piglit_vertex;\n"
+	"  texcoord = vec3(piglit_texcoord.xy, float(layer));\n"
 	"}\n";
 
 static const char fs_text[] =
@@ -251,12 +249,7 @@ piglit_init(int argc, char **argv)
 	}
 
 	/* Create the shaders */
-	prog = piglit_build_simple_program_unlinked(vs_text, fs_text);
-	glBindAttribLocation(prog, PIGLIT_ATTRIB_POS, "piglit_Vertex");
-	glBindAttribLocation(prog, PIGLIT_ATTRIB_TEX, "piglit_MultiTexCoord0");
-	glLinkProgram(prog);
-	if (!piglit_link_check_status(prog))
-		piglit_report_result(PIGLIT_FAIL);
+	prog = piglit_build_simple_program(vs_text, fs_text);
 	proj_loc = glGetUniformLocation(prog, "proj");
 	layer_loc = glGetUniformLocation(prog, "layer");
 	if (!piglit_check_gl_error(GL_NO_ERROR))
-- 
2.5.0



More information about the Piglit mailing list