[Piglit] [PATCH 4/4] arb_shader_atomic_counters/max-counters: Run the combined atomic buffer test in more cases.

Francisco Jerez currojerez at riseup.net
Tue Sep 29 10:53:46 PDT 2015


The subtest with at most the maximum number of atomic counter buffers
can be run whenever the combined limit is at least one more than the
limit for the FS stage.  The subtest exceeding the maximum number of
combined atomic counter buffers can be run whenever the sum of the
limits for the VS and FS stages is greater than the combined limit.
---
 .../spec/arb_shader_atomic_counters/max-counters.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/tests/spec/arb_shader_atomic_counters/max-counters.c b/tests/spec/arb_shader_atomic_counters/max-counters.c
index 7014c7b..8209f0d 100644
--- a/tests/spec/arb_shader_atomic_counters/max-counters.c
+++ b/tests/spec/arb_shader_atomic_counters/max-counters.c
@@ -441,29 +441,31 @@ piglit_init(int argc, char **argv)
                                 !run_test_vertex_max_buffers,
                                 ls.vertex_buffers + 1);
 
-        if (ls.vertex_buffers + ls.fragment_buffers > ls.combined_buffers) {
-                int max_safe_vs = MIN2(ls.vertex_buffers,
-				       ls.combined_buffers -
-				       ls.fragment_buffers);
+        const int combined_test_max_vs_bufs =
+           MIN2(ls.vertex_buffers, ls.combined_buffers - ls.fragment_buffers);
+
+        if (combined_test_max_vs_bufs > 0) {
                 atomic_counters_subtest(&status, GL_NONE,
                                         "Combined test under maximum "
                                         "number of atomic counter buffers",
                                         run_test_combined_max_buffers,
                                         ls.fragment_buffers,
-                                        max_safe_vs);
+                                        combined_test_max_vs_bufs);
+        } else {
+                piglit_report_subtest_result(
+                        PIGLIT_SKIP, "Combined test under maximum "
+                        "number of atomic counter buffers");
+        }
 
+        if (combined_test_max_vs_bufs < ls.vertex_buffers) {
                 atomic_counters_subtest(&status, GL_NONE,
                                         "Combined test above maximum "
                                         "number of atomic counter buffers",
                                         !run_test_combined_max_buffers,
                                         ls.fragment_buffers,
-                                        max_safe_vs + 1);
-
+                                        combined_test_max_vs_bufs + 1);
         } else {
                 piglit_report_subtest_result(
-                        PIGLIT_SKIP, "Combined test under maximum "
-                        "number of atomic counter buffers");
-                piglit_report_subtest_result(
                         PIGLIT_SKIP, "Combined test above maximum "
                         "number of atomic counter buffers");
         }
-- 
2.5.1



More information about the Piglit mailing list