[Piglit] [PATCH 1/2] shader_runner: Improve MS texture support

Rhys Perry pendingchaos02 at gmail.com
Fri Jul 20 15:36:29 UTC 2018


---
 tests/shaders/shader_runner.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index c1d4c9265..96f009277 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -3149,6 +3149,7 @@ piglit_display(void)
 			if (parse_str(rest, "tex 2d ", &rest)) {
 				GLenum attachments[32];
 				unsigned num_attachments = 0;
+				bool ms = parse_str(rest, "ms ", &rest);
 
 				glGenFramebuffers(1, &fbo);
 				glBindFramebuffer(target, fbo);
@@ -3158,7 +3159,7 @@ piglit_display(void)
 						GL_COLOR_ATTACHMENT0 + num_attachments;
 					glFramebufferTexture2D(
 						target, attachments[num_attachments],
-						GL_TEXTURE_2D,
+						ms ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D,
 						get_texture_binding(tex)->obj, 0);
 
 					if (!piglit_check_gl_error(GL_NO_ERROR)) {
@@ -3685,6 +3686,21 @@ piglit_display(void)
 				     w, h, l, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
 			set_texture_binding(tex, texobj, w, h, l);
 
+		} else if (sscanf(line,
+				  "texture junk 2DMS %d ( %d , %d , %d )",
+				  &tex, &w, &h, &l) == 4) {
+			GLuint texobj;
+			glActiveTexture(GL_TEXTURE0 + tex);
+			glGenTextures(1, &texobj);
+			glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, texobj);
+			if (piglit_is_gles())
+				glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, l, GL_RGBA,
+				                          w, h, GL_FALSE);
+			else
+				glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, l, GL_RGBA,
+				                        w, h, GL_FALSE);
+			set_texture_binding(tex, texobj, w, h, 1);
+
 		} else if (parse_str(line, "texture storage ", &rest)) {
 			GLenum target, format;
 			GLuint tex_obj;
-- 
2.14.4



More information about the Piglit mailing list