panfrost: Deduplicate shader properties
Between Midgard and Bifrost.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7446>
diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c
index a850159..b4974e4 100644
--- a/src/gallium/drivers/panfrost/pan_assemble.c
+++ b/src/gallium/drivers/panfrost/pan_assemble.c
@@ -53,16 +53,10 @@
* conformant on gles3 */
state->properties.midgard.fp_mode = MALI_FP_MODE_GL_INF_NAN_SUPPRESSED;
- if (stage == MESA_SHADER_FRAGMENT) {
- /* Work register count, early-z, reads at draw-time */
- state->properties.stencil_from_shader = state->writes_stencil;
- state->properties.shader_contains_barrier = state->helper_invocations;
- state->properties.depth_source = state->writes_depth ?
- MALI_DEPTH_SOURCE_SHADER :
- MALI_DEPTH_SOURCE_FIXED_FUNCTION;
- } else {
+ /* For fragment shaders, work register count, early-z, reads at draw-time */
+
+ if (stage != MESA_SHADER_FRAGMENT)
state->properties.midgard.work_register_count = state->work_reg_count;
- }
}
static void
@@ -86,7 +80,6 @@
/* Early-Z set at draw-time */
state->properties.bifrost.zs_update_operation = MALI_PIXEL_KILL_STRONG_EARLY;
state->properties.uniform_buffer_count = state->ubo_count;
- state->properties.shader_contains_barrier = state->helper_invocations;
state->properties.bifrost.shader_modifies_coverage = state->can_discard;
pan_prepare(&state->preload, PRELOAD);
@@ -393,6 +386,12 @@
else
pan_prepare_midgard_props(state, stage);
+ state->properties.stencil_from_shader = state->writes_stencil;
+ state->properties.shader_contains_barrier = state->helper_invocations;
+ state->properties.depth_source = state->writes_depth ?
+ MALI_DEPTH_SOURCE_SHADER :
+ MALI_DEPTH_SOURCE_FIXED_FUNCTION;
+
if (stage != MESA_SHADER_FRAGMENT)
pan_upload_shader_descriptor(ctx, state);