From: Nicolai Hähnle <[email protected]>
---
tests/shaders/shader_runner.c | 17 +++++++++++++++++
tests/util/piglit-util-gl.c | 35 +++++++++++++++++++++++++++++++++++
tests/util/piglit-util-gl.h | 1 +
3 files changed, 53 insertions(+)
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 8d2a9bd..206258c 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -3102,6 +3102,23 @@ piglit_display(void)
GL_UNSIGNED_NORMALIZED);
if (!piglit_is_core_profile)
glEnable(GL_TEXTURE_2D);
+ } else if (sscanf(line, "texture integer %d ( %d", &tex, &w) ==
2) {
+ GLenum int_fmt;
+ int b, a;
+ int num_scanned =
+ sscanf(line,
+ "texture integer %d ( %d , %d ) ( %d, %d )
%31s",
+ &tex, &w, &h, &b, &a, s);
+ if (num_scanned < 6) {
+ fprintf(stderr,
+ "invalid texture integer command!\n");
+ piglit_report_result(PIGLIT_FAIL);
+ }
+
+ int_fmt = piglit_get_gl_enum_from_name(s);
+
+ glActiveTexture(GL_TEXTURE0 + tex);
+ piglit_integer_texture(int_fmt, w, h, b, a);
} else if (sscanf(line, "texture miptree %d", &tex) == 1) {
glActiveTexture(GL_TEXTURE0 + tex);
piglit_miptree_texture();
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index dbdfb13..e8a47c5 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -2494,6 +2494,41 @@ piglit_rgbw_texture(GLenum internalFormat, int w, int h,
GLboolean mip,
}
/**
+ * Generates a texture with the given integer internal format.
+ * Pixel data will be filled as R = x, G = y, B = b, A = a.
+ */
+GLuint piglit_integer_texture(GLenum internalFormat, int w, int h, int b, int
a)