[Piglit] [PATCH 2/4] shader_runner: Support creating uninitialized 2d array textures

Chris Forbes chrisf at ijw.co.nz
Sat Jun 21 22:25:52 PDT 2014


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 3a0ceda..4046a1e 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2307,6 +2307,17 @@ piglit_display(void)
 			if (!piglit_is_core_profile)
 				glEnable(GL_TEXTURE_2D);
 		} else if (sscanf(line,
+				  "texture junk 2DArray %d ( %d , %d , %d )",
+				  &tex, &w, &h, &l) == 4) {
+			GLint texobj;
+			glActiveTexture(GL_TEXTURE0 + tex);
+			glGenTextures(1, &texobj);
+			glBindTexture(GL_TEXTURE_2D_ARRAY, texobj);
+			glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA,
+				     w, h, l, 0, GL_RGBA, GL_FLOAT, 0);
+			if (!piglit_is_core_profile)
+				glEnable(GL_TEXTURE_2D_ARRAY);
+		} else if (sscanf(line,
 				  "texture shadow2D %d ( %d , %d )",
 				  &tex, &w, &h) == 3) {
 			glActiveTexture(GL_TEXTURE0 + tex);
-- 
2.0.0



More information about the Piglit mailing list