[Piglit] [PATCH 02/10] shader_runner: add ability to control red swizzle texparameter

Chris Forbes chrisf at ijw.co.nz
Tue Oct 15 10:47:04 CEST 2013


Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 tests/shaders/shader_runner.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index fbc1964..a617d0d 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1547,6 +1547,12 @@ handle_texparameter(const char *line)
 		{ "linear",                 GL_LINEAR                 },
 		{ NULL, 0 }
 	};
+	const struct string_to_enum swizzle_modes[] = {
+		{ "red", GL_RED },
+		{ "green", GL_GREEN },
+		{ "blue", GL_BLUE },
+		{ "alpha", GL_ALPHA },
+	};
 	GLenum target = 0;
 	GLenum parameter;
 	const char *parameter_name;
@@ -1595,6 +1601,11 @@ handle_texparameter(const char *line)
 		glTexParameteri(target, GL_TEXTURE_BASE_LEVEL,
 				strtol(line, NULL, 10));
 		return;
+	} else if (string_match("swizzle_r ", line)) {
+		parameter = GL_TEXTURE_SWIZZLE_R;
+		parameter_name = "swizzle_r";
+		line += strlen("swizzle_r ");
+		strings = swizzle_modes;
 	} else {
 		fprintf(stderr, "unknown texture parameter in `%s'\n", line);
 		piglit_report_result(PIGLIT_FAIL);
-- 
1.8.4



More information about the Piglit mailing list