summaryrefslogtreecommitdiff
path: root/tests/shaders/shader_runner.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2012-04-04 00:15:47 -0700
committerKenneth Graunke <kenneth@whitecape.org>2012-04-17 12:21:38 -0700
commitbfb1daf1cdfde3debaf9624540f1940f1fdda3d5 (patch)
tree1e567e74f495b611667905876c340e455cc58555 /tests/shaders/shader_runner.c
parentca815f67d02a2ca550bb80fad023006ff3565e2d (diff)
shader_runner: Add support for setting the Min/Mag filters.
It's useful and easy to do. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'tests/shaders/shader_runner.c')
-rw-r--r--tests/shaders/shader_runner.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 07ee20702..ee49e41ee 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1051,6 +1051,20 @@ handle_texparameter(const char *line)
{ "red", GL_RED }, /* Requires GL 3.0 or GL_ARB_texture_rg */
{ NULL, 0 },
};
+ const struct string_to_enum min_filter_modes[] = {
+ { "nearest_mipmap_nearest", GL_NEAREST_MIPMAP_NEAREST },
+ { "linear_mipmap_nearest", GL_LINEAR_MIPMAP_NEAREST },
+ { "nearest_mipmap_linear", GL_NEAREST_MIPMAP_LINEAR },
+ { "linear_mipmap_linear", GL_LINEAR_MIPMAP_LINEAR },
+ { "nearest", GL_NEAREST },
+ { "linear", GL_LINEAR },
+ { NULL, 0 }
+ };
+ const struct string_to_enum mag_filter_modes[] = {
+ { "nearest", GL_NEAREST },
+ { "linear", GL_LINEAR },
+ { NULL, 0 }
+ };
GLenum target = 0;
GLenum parameter;
const char *parameter_name;
@@ -1081,6 +1095,16 @@ handle_texparameter(const char *line)
parameter_name = "depth_mode";
line += strlen("depth_mode ");
strings = depth_modes;
+ } else if (string_match("min ", line)) {
+ parameter = GL_TEXTURE_MIN_FILTER;
+ parameter_name = "min";
+ line += strlen("min ");
+ strings = min_filter_modes;
+ } else if (string_match("mag ", line)) {
+ parameter = GL_TEXTURE_MAG_FILTER;
+ parameter_name = "mag";
+ line += strlen("mag ");
+ strings = mag_filter_modes;
} else {
fprintf(stderr, "unknown texture parameter in `%s'\n", line);
piglit_report_result(PIGLIT_FAIL);