panfrost: Fake CAPs for dEQP-GLES31
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 23 Jul 2019 03:11:04 +0000 (20:11 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 23 Jul 2019 13:36:48 +0000 (06:36 -0700)
We still have some big ticket items left on GLES 3.0, but it's often
helpful to be able to access higher dEQP levels for debugging features
that just don't quite match a particular API.

Plus, this opens up a whole slew of new features to poke at if boredom
overtakes, ahem.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_screen.c

index 7c513c94ecd4bf09b216d9b2c83f312da4ae66bd..048d68ad99148b582dba4e9c2c361656ae25f3a0 100644 (file)
@@ -98,6 +98,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
         case PIPE_CAP_MAX_RENDER_TARGETS:
                 return is_deqp ? 4 : 1;
 
+
         case PIPE_CAP_OCCLUSION_QUERY:
                 return 1;
         case PIPE_CAP_QUERY_TIME_ELAPSED:
@@ -135,6 +136,13 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
         case PIPE_CAP_CUBE_MAP_ARRAY:
                 return is_deqp;
 
+        /* For faking GLES 3.1 for dEQP-GLES31 */
+        case PIPE_CAP_TEXTURE_MULTISAMPLE:
+        case PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS:
+        case PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS:
+        case PIPE_CAP_IMAGE_LOAD_FORMATTED:
+                return is_deqp;
+
         /* TODO: Where does this req come from in practice? */
         case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
                 return 1;
@@ -230,6 +238,8 @@ panfrost_get_shader_param(struct pipe_screen *screen,
                 return 0;
         }
 
+        bool is_deqp = pan_debug & PAN_DBG_DEQP;
+
         /* this is probably not totally correct.. but it's a start: */
         switch (param) {
         case PIPE_SHADER_CAP_SCALAR_ISA:
@@ -307,10 +317,12 @@ panfrost_get_shader_param(struct pipe_screen *screen,
 
         case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
         case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
-        case PIPE_SHADER_CAP_LOWER_IF_THRESHOLD:
-        case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
         case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
         case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
+                return is_deqp;
+
+        case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
+        case PIPE_SHADER_CAP_LOWER_IF_THRESHOLD:
                 return 0;
 
         default: