[Piglit] [PATCH 2/2] ext_framebuffer_multisample_blit_scaled: Add 16x samples support

Anuj Phogat anuj.phogat at gmail.com
Thu Jun 2 18:30:23 UTC 2016


Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 .../blit-scaled.cpp                                | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp b/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
index b1c1f1c..91a57b9 100644
--- a/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
+++ b/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
@@ -132,7 +132,11 @@ compile_shader(GLenum target)
 	const char*sample_number, *sample_map = "";
 	float x_scale, y_scale;
 
-	x_scale = 2;
+	if (samples == 16)
+		x_scale = 4;
+	else
+		x_scale = 2;
+
 	y_scale = samples / x_scale;
 
 	/* Below switch is used to setup the shader expression, which computes
@@ -166,6 +170,17 @@ compile_shader(GLenum target)
 	 *           ---------                      ---------
 	 *           | 6 | 7 |                      | 7 | 1 |
 	 *           ---------                      ---------
+	 *
+	 * 16X MSAA sample index layout  16x MSAA sample number layout
+	 *         -----------------            -----------------
+	 *         | 0 | 1 | 2 | 3 |            |15 |10 | 9 | 7 |
+	 *         -----------------            -----------------
+	 *         | 4 | 5 | 6 | 7 |            | 4 | 1 | 3 |13 |
+	 *         -----------------            -----------------
+	 *         | 8 | 9 |10 |11 |            |12 | 2 | 0 | 6 |
+	 *         -----------------            -----------------
+	 *         |12 |13 |14 |15 |            |11 | 8 | 5 |14 |
+	 *         -----------------            -----------------
 	 */
 	switch(samples) {
 	case 2:
@@ -178,6 +193,11 @@ compile_shader(GLenum target)
 		sample_map = "  const int sample_map[8] = int[8](5 , 2, 4, 6, 0, 3, 7, 1);\n";
 		sample_number = "sample_map[int(2 * fract(coord.x) + 8 * fract(coord.y))]";
 		break;
+	case 16:
+		sample_map = "  const int sample_map[16] = int[16](15, 10, 9, 7, 4, 1, 3, 13,\n"
+			     "                                     12, 2, 0, 6, 11, 8, 5, 14);\n";
+		sample_number = "sample_map[int(4 * fract(coord.x) + 16 * fract(coord.y))]";
+		break;
 	default:
 		printf("Unsupported sample count %d\n", samples);
 		piglit_report_result(PIGLIT_SKIP);
-- 
2.5.5



More information about the Piglit mailing list