From 2f93ecd654e9909c0371cc131ab0e26e6edcdda0 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 22 Jul 2019 20:11:04 -0700 Subject: [PATCH] panfrost: Fake CAPs for dEQP-GLES31 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 --- src/gallium/drivers/panfrost/pan_screen.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 7c513c94ecd..048d68ad991 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -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: -- 2.30.2