Module: Mesa Branch: main Commit: 7cda715ad62182da5e8fdc8cb2aaebe3d9a67470 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7cda715ad62182da5e8fdc8cb2aaebe3d9a67470
Author: Rhys Perry <[email protected]> Date: Mon May 1 17:38:11 2023 +0100 radv: fix bc optimization with POS_W_FLOAT_ENA(1) 0286CC_PERSP_CENTER_ENA is also set if: - No barycentrics are used - POS_W_FLOAT is enabled Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Qiang Yu <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Fixes: a4b60295a79 ("aco,ac/llvm,radv,radeonsi: handle ps bc optimization in nir for radv") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8928 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22782> --- src/amd/vulkan/radv_pipeline.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index a90a3627949..70d9fadb3fb 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -611,10 +611,10 @@ radv_postprocess_nir(struct radv_device *device, const struct radv_pipeline_layo .enable_mrt_output_nan_fixup = pipeline_key->ps.epilog.enable_mrt_output_nan_fixup, .no_color_export = stage->info.ps.has_epilog, - .bc_optimize_for_persp = - stage->info.ps.reads_persp_center && stage->info.ps.reads_persp_centroid, - .bc_optimize_for_linear = - stage->info.ps.reads_linear_center && stage->info.ps.reads_linear_centroid, + .bc_optimize_for_persp = G_0286CC_PERSP_CENTER_ENA(stage->info.ps.spi_ps_input) && + G_0286CC_PERSP_CENTROID_ENA(stage->info.ps.spi_ps_input), + .bc_optimize_for_linear = G_0286CC_LINEAR_CENTER_ENA(stage->info.ps.spi_ps_input) && + G_0286CC_LINEAR_CENTROID_ENA(stage->info.ps.spi_ps_input), }; NIR_PASS_V(stage->nir, ac_nir_lower_ps, &options);
