anv: move more PS_EXTRA programming to runtime

All the stuff related to fs_msaa_flags.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27803>
This commit is contained in:
Lionel Landwerlin 2024-04-02 13:20:15 +03:00 committed by Marge Bot
parent 355549e7b0
commit 3a336a98e9
3 changed files with 23 additions and 11 deletions

View file

@ -1555,7 +1555,10 @@ struct anv_gfx_dynamic_state {
/* 3DSTATE_PS_EXTRA */
struct {
bool PixelShaderIsPerSample;
bool PixelShaderKillsPixel;
bool PixelShaderIsPerCoarsePixel;
bool EnablePSDependencyOnCPsizeChange;
} ps_extra;
/* 3DSTATE_PS_BLEND */

View file

@ -580,6 +580,19 @@ genX(cmd_buffer_flush_gfx_runtime_state)(struct anv_cmd_buffer *cmd_buffer)
if ((gfx->dirty & ANV_CMD_DIRTY_PIPELINE) ||
(gfx->dirty & ANV_CMD_DIRTY_FS_MSAA_FLAGS)) {
if (wm_prog_data) {
SET(PS_EXTRA, ps_extra.PixelShaderIsPerSample,
brw_wm_prog_data_is_persample(wm_prog_data, gfx->fs_msaa_flags));
#if GFX_VER >= 11
SET(PS_EXTRA, ps_extra.PixelShaderIsPerCoarsePixel,
brw_wm_prog_data_is_coarse(wm_prog_data, gfx->fs_msaa_flags));
#endif
#if GFX_VERx10 >= 125
/* TODO: We should only require this when the last geometry shader
* uses a fragment shading rate that is not constant.
*/
SET(PS_EXTRA, ps_extra.EnablePSDependencyOnCPsizeChange,
brw_wm_prog_data_is_coarse(wm_prog_data, gfx->fs_msaa_flags));
#endif
SET(WM, wm.BarycentricInterpolationMode,
wm_prog_data_barycentric_modes(wm_prog_data, gfx->fs_msaa_flags));
}
@ -1644,6 +1657,13 @@ cmd_buffer_gfx_state_emission(struct anv_cmd_buffer *cmd_buffer)
if (BITSET_TEST(hw_state->dirty, ANV_GFX_STATE_PS_EXTRA)) {
anv_batch_emit_merge(&cmd_buffer->batch, GENX(3DSTATE_PS_EXTRA),
pipeline, partial.ps_extra, pse) {
SET(pse, ps_extra, PixelShaderIsPerSample);
#if GFX_VER >= 11
SET(pse, ps_extra, PixelShaderIsPerCoarsePixel);
#endif
#if GFX_VERx10 >= 125
SET(pse, ps_extra, EnablePSDependencyOnCPsizeChange);
#endif
SET(pse, ps_extra, PixelShaderKillsPixel);
}
}

View file

@ -1666,8 +1666,6 @@ emit_3dstate_ps_extra(struct anv_graphics_pipeline *pipeline,
ps.AttributeEnable = wm_prog_data->num_varying_inputs > 0;
#endif
ps.oMaskPresenttoRenderTarget = wm_prog_data->uses_omask;
ps.PixelShaderIsPerSample =
brw_wm_prog_data_is_persample(wm_prog_data, pipeline->fs_msaa_flags);
ps.PixelShaderComputedDepthMode = wm_prog_data->computed_depth_mode;
ps.PixelShaderUsesSourceDepth = wm_prog_data->uses_src_depth;
ps.PixelShaderUsesSourceW = wm_prog_data->uses_src_w;
@ -1693,15 +1691,6 @@ emit_3dstate_ps_extra(struct anv_graphics_pipeline *pipeline,
#if GFX_VER >= 11
ps.PixelShaderRequiresSourceDepthandorWPlaneCoefficients =
wm_prog_data->uses_depth_w_coefficients;
ps.PixelShaderIsPerCoarsePixel =
brw_wm_prog_data_is_coarse(wm_prog_data, pipeline->fs_msaa_flags);
#endif
#if GFX_VERx10 >= 125
/* TODO: We should only require this when the last geometry shader uses
* a fragment shading rate that is not constant.
*/
ps.EnablePSDependencyOnCPsizeChange =
brw_wm_prog_data_is_coarse(wm_prog_data, pipeline->fs_msaa_flags);
#endif
}
}