mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 11:00:11 +01:00
zink: apply zink_shader::uses_sample to fs variant updating
not actually doing the shader rewriting yet also add a helper for checking this value Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28113>
This commit is contained in:
parent
b061ab7198
commit
4bc1bf1625
2 changed files with 10 additions and 3 deletions
|
|
@ -1839,8 +1839,7 @@ zink_update_fs_key_samples(struct zink_context *ctx)
|
|||
{
|
||||
if (!ctx->gfx_stages[MESA_SHADER_FRAGMENT])
|
||||
return;
|
||||
shader_info *info = &ctx->gfx_stages[MESA_SHADER_FRAGMENT]->info;
|
||||
if (info->outputs_written & (1 << FRAG_RESULT_SAMPLE_MASK)) {
|
||||
if (zink_shader_uses_samples(ctx->gfx_stages[MESA_SHADER_FRAGMENT])) {
|
||||
bool samples = zink_get_fs_base_key(ctx)->samples;
|
||||
if (samples != (ctx->fb_state.samples > 1))
|
||||
zink_set_fs_base_key(ctx)->samples = ctx->fb_state.samples > 1;
|
||||
|
|
|
|||
|
|
@ -429,6 +429,14 @@ zink_driver_thread_add_job(struct pipe_screen *pscreen, void *data,
|
|||
equals_gfx_pipeline_state_func
|
||||
zink_get_gfx_pipeline_eq_func(struct zink_screen *screen, struct zink_gfx_program *prog);
|
||||
|
||||
/* determines whether the 'samples' shader key is valid */
|
||||
static inline bool
|
||||
zink_shader_uses_samples(const struct zink_shader *zs)
|
||||
{
|
||||
assert(zs->info.stage == MESA_SHADER_FRAGMENT);
|
||||
return zs->uses_sample || zs->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
zink_sanitize_optimal_key(struct zink_shader **shaders, uint32_t val)
|
||||
{
|
||||
|
|
@ -437,7 +445,7 @@ zink_sanitize_optimal_key(struct zink_shader **shaders, uint32_t val)
|
|||
k.val = val;
|
||||
else
|
||||
k.val = zink_shader_key_optimal_no_tcs(val);
|
||||
if (!(shaders[MESA_SHADER_FRAGMENT]->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK)))
|
||||
if (!zink_shader_uses_samples(shaders[MESA_SHADER_FRAGMENT]))
|
||||
k.fs.samples = false;
|
||||
if (!(shaders[MESA_SHADER_FRAGMENT]->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_DATA1)))
|
||||
k.fs.force_dual_color_blend = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue