[Piglit] [PATCH] arb_sample_shading: make sure gl_SampleMask has no effect when no ms
Ilia Mirkin
imirkin at alum.mit.edu
Tue Jun 10 17:11:02 PDT 2014
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
.../arb_sample_shading/execution/builtin-gl-sample-mask-simple.cpp | 5 ++++-
tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-simple.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-simple.cpp
index 42f2f0f..5119582 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-simple.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-simple.cpp
@@ -190,12 +190,15 @@ piglit_display()
else
assert(0 && "Unimplemented");
- for (i = 0; i < (1 << multisampled_tex.config.num_samples); i++) {
+ for (i = 0; i < multisampled_tex.config.width; i++) {
float color[4];
unsigned full_mask = (1 << samples) - 1;
unsigned expected_mask = i & full_mask;
unsigned observed_mask = 0;
+ if (multisampled_tex.config.num_samples == 0)
+ expected_mask = full_mask;
+
glReadPixels((i % 16) * 8 + 4,
(i / 16) * 8 + 4,
1, 1, GL_RGBA, GL_FLOAT, color);
diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp
index 6585ab4..ce9b519 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp
@@ -93,6 +93,7 @@ compile_shader(void)
" (int(gl_FragCoord.y) * 0x01010101);\n"
" vec4 green = vec4(0.0, 1.0, 0.0, 1.0);\n"
" vec4 black = vec4(0.0, 0.0, 0.0, 0.0);\n"
+ " if (samples == 0) mask = 1;\n"
/* Use do-while to include 'samples = 0' case. */
" do {\n"
" bool is_sample_mask_set = ((mask >> i) & 0x1) == 0x1;\n"
--
1.8.5.5
More information about the Piglit
mailing list