mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
i965/fs: Fix slight layering violation in emit_single_fb_writes().
In cases where the color0 argument wasn't being provided, emit_single_fb_writes() would take the alpha channel directly from the visitor state instead of taking it from its arguments. This sort of hack didn't fit nicely into the logical send-message approach because all parameters of the instruction have to be visible to the SIMD lowering pass for it to be able to split them into halves at all. Fix it by using LOAD_PAYLOAD in fs_visitor::emit_fb_writes() to provide an actual color0 vector with undefined contents except for the alpha component to match the previous behavior when no color buffers are enabled. Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
f68ec2baf4
commit
1ad928ed9f
1 changed files with 10 additions and 12 deletions
|
|
@ -1551,17 +1551,7 @@ fs_visitor::emit_single_fb_write(const fs_builder &bld,
|
|||
|
||||
payload_header_size = length;
|
||||
|
||||
if (color0.file == BAD_FILE) {
|
||||
/* 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.
|
||||
*/
|
||||
if (this->outputs[0].file != BAD_FILE)
|
||||
setup_color_payload(&sources[length + 3],
|
||||
offset(this->outputs[0], bld, 3),
|
||||
1, exec_size, false);
|
||||
length += 4;
|
||||
} else if (color1.file == BAD_FILE) {
|
||||
if (color1.file == BAD_FILE) {
|
||||
if (src0_alpha.file != BAD_FILE) {
|
||||
setup_color_payload(&sources[length], src0_alpha, 1, exec_size, false);
|
||||
length++;
|
||||
|
|
@ -1709,7 +1699,15 @@ fs_visitor::emit_fb_writes()
|
|||
* alpha out the pipeline to our null renderbuffer to support
|
||||
* alpha-testing, alpha-to-coverage, and so on.
|
||||
*/
|
||||
inst = emit_single_fb_write(bld, reg_undef, reg_undef, reg_undef, 0,
|
||||
/* FINISHME: Factor out this frequently recurring pattern into a
|
||||
* helper function.
|
||||
*/
|
||||
const fs_reg srcs[] = { reg_undef, reg_undef,
|
||||
reg_undef, offset(this->outputs[0], bld, 3) };
|
||||
const fs_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UD, 4);
|
||||
bld.LOAD_PAYLOAD(tmp, srcs, 4, 0);
|
||||
|
||||
inst = emit_single_fb_write(bld, tmp, reg_undef, reg_undef, 4,
|
||||
dispatch_width);
|
||||
inst->target = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue