[Piglit] [PATCH] sso: move helper function to sso-common

Timothy Arceri timothy.arceri at collabora.com
Wed Nov 25 01:01:38 PST 2015


---
 .../arb_separate_shader_objects/rendezvous_by_name.c     | 15 ---------------
 .../rendezvous_by_name_interpolation.c                   | 10 +++++-----
 tests/spec/arb_separate_shader_objects/sso-common.c      | 16 ++++++++++++++++
 tests/spec/arb_separate_shader_objects/sso-common.h      |  3 +++
 4 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c
index 2b01888..48caf0a 100644
--- a/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c
+++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c
@@ -235,21 +235,6 @@ piglit_display(void)
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
 
-GLuint format_and_link_program(GLenum type, const char* code, unsigned glsl_version)
-{
-	char *source;
-	GLuint prog;
-
-	asprintf(&source, code, glsl_version);
-	prog = glCreateShaderProgramv(type, 1,
-			(const GLchar *const *) &source);
-
-	piglit_link_check_status(prog);
-	free(source);
-
-	return prog;
-}
-
 void piglit_init(int argc, char **argv)
 {
 	unsigned glsl_version;
diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c b/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c
index 98d3f43..74d22e2 100644
--- a/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c
+++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c
@@ -131,8 +131,8 @@ piglit_display(void)
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
 
-GLuint format_and_link_program(GLenum type, const char* code, unsigned glsl_version,
-		unsigned q1, unsigned q2, unsigned q3)
+GLuint format_and_link_program_with_qualifiers(GLenum type, const char* code,
+		unsigned glsl_version, unsigned q1, unsigned q2, unsigned q3)
 {
 	char *source;
 	GLuint prog;
@@ -171,15 +171,15 @@ void piglit_init(int argc, char **argv)
 		int next = (i+1) % 4;
 		int prev = (i-1) % 4;
 		printf("Compile vs_prog[%d]\n", i);
-		vs_prog[i] = format_and_link_program(GL_VERTEX_SHADER,
+		vs_prog[i] = format_and_link_program_with_qualifiers(GL_VERTEX_SHADER,
 				vs_code_template, glsl_version, prev, i, next);
 
 		printf("Compile fs_prog_match[%d]\n", i);
-		fs_prog_match[i] = format_and_link_program(GL_FRAGMENT_SHADER,
+		fs_prog_match[i] = format_and_link_program_with_qualifiers(GL_FRAGMENT_SHADER,
 				fs_code_template, glsl_version, prev, i, next);
 
 		printf("Compile fs_prog_unmatch[%d]\n", i);
-		fs_prog_unmatch[i] = format_and_link_program(GL_FRAGMENT_SHADER,
+		fs_prog_unmatch[i] = format_and_link_program_with_qualifiers(GL_FRAGMENT_SHADER,
 				fs_code_template, glsl_version, next, prev, i);
 	}
 
diff --git a/tests/spec/arb_separate_shader_objects/sso-common.c b/tests/spec/arb_separate_shader_objects/sso-common.c
index 10023ca..dcac1b1 100644
--- a/tests/spec/arb_separate_shader_objects/sso-common.c
+++ b/tests/spec/arb_separate_shader_objects/sso-common.c
@@ -54,3 +54,19 @@ pick_a_glsl_version(void)
 
 	return glsl_version;
 }
+
+GLuint
+format_and_link_program(GLenum type, const char* code, unsigned glsl_version)
+{
+	char *source;
+	GLuint prog;
+
+	asprintf(&source, code, glsl_version);
+	prog = glCreateShaderProgramv(type, 1,
+			(const GLchar *const *) &source);
+
+	piglit_link_check_status(prog);
+	free(source);
+
+	return prog;
+}
diff --git a/tests/spec/arb_separate_shader_objects/sso-common.h b/tests/spec/arb_separate_shader_objects/sso-common.h
index 23e962c..b785886 100644
--- a/tests/spec/arb_separate_shader_objects/sso-common.h
+++ b/tests/spec/arb_separate_shader_objects/sso-common.h
@@ -26,4 +26,7 @@
 
 unsigned pick_a_glsl_version(void);
 
+GLuint format_and_link_program(GLenum type, const char* code,
+                               unsigned glsl_version);
+
 #endif /* SSO_COMMON_H */
-- 
2.4.3



More information about the Piglit mailing list