[Piglit] [PATCH 4/5] ext_framebuffer_multisample_blit_scaled: Use piglit_build_simple_program

Ian Romanick idr at freedesktop.org
Mon Sep 21 08:57:51 PDT 2015


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

If the vertex shader inputs are named piglit_vertex and piglit_texcoord,
the utility function will handle everything for us.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 .../blit-scaled.cpp                                 | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp b/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
index 234d1b6..5cfc817 100644
--- a/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
+++ b/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
@@ -72,13 +72,13 @@ compile_shader(void)
 {
 	static const char *vert =
 		"#version 130\n"
-		"in vec2 pos;\n"
-		"in vec2 texCoord;\n"
+		"in vec2 piglit_vertex;\n"
+		"in vec2 piglit_texcoord;\n"
 		"out vec2 textureCoord;\n"
 		"void main()\n"
 		"{\n"
-		"  gl_Position = vec4(pos, 0.0, 1.0);\n"
-		"  textureCoord = texCoord;\n"
+		"  gl_Position = vec4(piglit_vertex, 0.0, 1.0);\n"
+		"  textureCoord = piglit_texcoord;\n"
 		"}\n";
 	/* Bilinear filtering of samples using shader program */
 	static const char *frag_template =
@@ -194,18 +194,7 @@ compile_shader(void)
 		 1.0f / samples, texel_fetch_macro);
 
 	/* Compile program */
-	prog = glCreateProgram();
-	GLint vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vert);
-	glAttachShader(prog, vs);
-	piglit_check_gl_error(GL_NO_ERROR);
-	GLint fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, frag);
-	glAttachShader(prog, fs);
-	glBindAttribLocation(prog, 0, "pos");
-	glBindAttribLocation(prog, 1, "texCoord");
-	glLinkProgram(prog);
-	if (!piglit_link_check_status(prog)) {
-		piglit_report_result(PIGLIT_FAIL);
-	}
+	prog = piglit_build_simple_program(vert, frag);
 
 	/* Set up vertex array object */
 	glGenVertexArrays(1, &vao);
-- 
2.1.0



More information about the Piglit mailing list