intel/fs: Set src0 alpha present bit in header when provided in message payload.
Currently the "Source0 Alpha Present to RenderTarget" bit of the RT write message header is derived from brw_wm_prog_data::replicate_alpha. However the src0_alpha payload is provided anytime it's specified to the logical message. This could theoretically lead to an inconsistency if somebody provided a src0_alpha value while brw_wm_prog_data::replicate_alpha was false, as I'm planning to do in a future commit in order to implement a hardware workaround. Instead calculate the header bit based on whether a src0_alpha value was provided to the logical message, which guarantees the same behavior on pre-ICL and ICL+ (the latter used an extended descriptor bit for this which didn't suffer from the same issue). Remove the brw_wm_prog_data::replicate_alpha flag. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -493,7 +493,7 @@ fs_visitor::emit_fb_writes()
|
||||
* so we compute if we need replicate alpha and emit alpha to coverage
|
||||
* workaround here.
|
||||
*/
|
||||
prog_data->replicate_alpha = key->alpha_test_replicate_alpha ||
|
||||
const bool replicate_alpha = key->alpha_test_replicate_alpha ||
|
||||
(key->nr_color_regions > 1 && key->alpha_to_coverage &&
|
||||
(sample_mask.file == BAD_FILE || devinfo->gen == 6));
|
||||
|
||||
@@ -506,7 +506,7 @@ fs_visitor::emit_fb_writes()
|
||||
ralloc_asprintf(this->mem_ctx, "FB write target %d", target));
|
||||
|
||||
fs_reg src0_alpha;
|
||||
if (devinfo->gen >= 6 && prog_data->replicate_alpha && target != 0)
|
||||
if (devinfo->gen >= 6 && replicate_alpha && target != 0)
|
||||
src0_alpha = offset(outputs[0], bld, 3);
|
||||
|
||||
inst = emit_single_fb_write(abld, this->outputs[target],
|
||||
|
Reference in New Issue
Block a user