panfrost: Refactor sample shading state
Moves the decision to evaluate per-sample to link time instead of draw-time, with an explicit property. No functional change. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
This commit is contained in:
@@ -350,6 +350,9 @@ panfrost_shader_compile(struct panfrost_context *ctx,
|
||||
|
||||
state->outputs_read = outputs_read >> FRAG_RESULT_DATA0;
|
||||
|
||||
/* EXT_shader_framebuffer_fetch requires per-sample */
|
||||
state->sample_shading = outputs_read;
|
||||
|
||||
/* List of reasons we need to execute frag shaders when things
|
||||
* are masked off */
|
||||
|
||||
|
||||
@@ -527,9 +527,9 @@ panfrost_prepare_fs_state(struct panfrost_context *ctx,
|
||||
state->multisample_misc.multisample_enable = msaa;
|
||||
state->multisample_misc.sample_mask = (msaa ? ctx->sample_mask : ~0) & 0xFFFF;
|
||||
|
||||
/* EXT_shader_framebuffer_fetch requires per-sample */
|
||||
bool per_sample = ctx->min_samples > 1 || fs->outputs_read;
|
||||
state->multisample_misc.evaluate_per_sample = msaa && per_sample;
|
||||
state->multisample_misc.evaluate_per_sample =
|
||||
msaa && (ctx->min_samples > 1 || fs->sample_shading);
|
||||
|
||||
state->multisample_misc.depth_function = zsa->base.depth_enabled ?
|
||||
panfrost_translate_compare_func(zsa->base.depth_func) :
|
||||
MALI_FUNC_ALWAYS;
|
||||
|
||||
@@ -216,6 +216,7 @@ struct panfrost_shader_state {
|
||||
|
||||
/* Non-descript information */
|
||||
unsigned work_reg_count;
|
||||
bool sample_shading;
|
||||
bool can_discard;
|
||||
bool writes_point_size;
|
||||
bool writes_depth;
|
||||
|
||||
Reference in New Issue
Block a user