From 7cda715ad62182da5e8fdc8cb2aaebe3d9a67470 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 1 May 2023 17:38:11 +0100 Subject: [PATCH] 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 Reviewed-by: Qiang Yu Reviewed-by: Samuel Pitoiset 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: --- 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);