brw: disable null_rt only if color output does not affect other outputs
We found out that some HW changes on Xe2 make the HW avoid reading the blend state if we're using the null_rt bit in the extended descriptor. Since the alpha_to_coverage bit resides in the blend state, that state is ignored and writes are going through to the depth/stencil buffers. Disable null_rt in the color outputs if the color outputs can affect other outputs (through alpha_to_coverage & omask). Fixes tests in this pattern on Xe2 : dEQP-VK.pipeline.*.multisample.alpha_to_coverage_no_color_attachment.* Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Backport-to: 24.2 Reviewed-by: Ivan Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31196>
This commit is contained in:
committed by
Marge Bot
parent
b45ce7d43e
commit
35ea8b6cd2
@@ -82,6 +82,17 @@ brw_do_emit_fb_writes(fs_visitor &s, int nr_color_regions, bool replicate_alpha)
|
||||
}
|
||||
|
||||
if (inst == NULL) {
|
||||
struct brw_wm_prog_key *key = (brw_wm_prog_key*) s.key;
|
||||
struct brw_wm_prog_data *prog_data = brw_wm_prog_data(s.prog_data);
|
||||
/* Disable null_rt if any non color output is written or if
|
||||
* alpha_to_coverage can be enabled. Since the alpha_to_coverage bit is
|
||||
* coming from the BLEND_STATE structure and the HW will avoid reading
|
||||
* it if null_rt is enabled.
|
||||
*/
|
||||
const bool use_null_rt =
|
||||
key->alpha_to_coverage == BRW_NEVER &&
|
||||
!prog_data->uses_omask;
|
||||
|
||||
/* Even if there's no color buffers enabled, we still need to send
|
||||
* alpha out the pipeline to our null renderbuffer to support
|
||||
* alpha-testing, alpha-to-coverage, and so on.
|
||||
@@ -95,7 +106,7 @@ brw_do_emit_fb_writes(fs_visitor &s, int nr_color_regions, bool replicate_alpha)
|
||||
bld.LOAD_PAYLOAD(tmp, srcs, 4, 0);
|
||||
|
||||
inst = brw_emit_single_fb_write(s, bld, tmp, reg_undef, reg_undef, 4,
|
||||
true);
|
||||
use_null_rt);
|
||||
inst->target = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user