From ef2b763d9c7f35661dc0154450c80b86122a026b Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Tue, 30 May 2023 18:10:53 +0200 Subject: [PATCH] anv: fix incorrect asserts when combining CPS and per sample interpolation CPS is dynamically turned off when per sample interpolation is active. Update the asserts to reflect this. Signed-off-by: Rohan Garg Reviewed-by: Lionel Landwerlin Fixes: 5644011f06 ("intel/compiler: Convert wm_prog_key::persample_interp to a tri-state") Part-of: --- src/intel/compiler/brw_fs.cpp | 11 +++++++++-- src/intel/compiler/brw_fs_visitor.cpp | 4 +--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 0eefc5fd7b6..92d038a4ea6 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -7405,8 +7405,15 @@ brw_nir_populate_wm_prog_data(const nir_shader *shader, (prog_data->barycentric_interp_modes & BRW_BARYCENTRIC_NONPERSPECTIVE_BITS) != 0; - /* You can't be coarse and per-sample */ - assert(!key->coarse_pixel || !key->persample_interp); + /* The current VK_EXT_graphics_pipeline_library specification requires + * coarse to specified at compile time. But per sample interpolation can be + * dynamic. So we should never be in a situation where coarse & + * persample_interp are both respectively true & BRW_ALWAYS. + * + * Coarse will dynamically turned off when persample_interp is active. + */ + assert(!key->coarse_pixel || key->persample_interp != BRW_ALWAYS); + prog_data->coarse_pixel_dispatch = brw_sometimes_invert(prog_data->persample_dispatch); if (!key->coarse_pixel || diff --git a/src/intel/compiler/brw_fs_visitor.cpp b/src/intel/compiler/brw_fs_visitor.cpp index c1e7b913c3f..53c6158727b 100644 --- a/src/intel/compiler/brw_fs_visitor.cpp +++ b/src/intel/compiler/brw_fs_visitor.cpp @@ -577,10 +577,8 @@ fs_visitor::emit_interpolation_setup_gfx6() abld.MAD(coarse_z, coarse_z, z_cy, float_pixel_y); } - if (wm_prog_data->uses_src_depth) { - assert(!wm_prog_data->uses_depth_w_coefficients); + if (wm_prog_data->uses_src_depth) this->pixel_z = fetch_payload_reg(bld, fs_payload().source_depth_reg); - } if (wm_prog_data->uses_depth_w_coefficients || wm_prog_data->uses_src_depth) {