diff options
author | Francisco Jerez <[email protected]> | 2015-07-15 17:05:27 +0300 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2015-07-29 14:12:46 +0300 |
commit | 6bd991a1377862e3b1b9c05e835289fff9d6785f (patch) | |
tree | eef563506b67a1ba1198b52bd2ff1699d6cc85a9 /src | |
parent | 1ad928ed9f4e7723f709f91d18d17726c92f0b7b (diff) |
i965/fs: Simplify control flow in emit_single_fb_write().
Flatten the if ladder to match the way that the ordering of these
fields is specified in the hardware documentation a bit more closely.
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index b267e8cf015..e91e3edffc9 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -1551,19 +1551,23 @@ fs_visitor::emit_single_fb_write(const fs_builder &bld, payload_header_size = length; - if (color1.file == BAD_FILE) { - if (src0_alpha.file != BAD_FILE) { - setup_color_payload(&sources[length], src0_alpha, 1, exec_size, false); - length++; - } + if (src0_alpha.file != BAD_FILE) { + /* FIXME: This is being passed at the wrong location in the payload and + * doesn't work when gl_SampleMask and MRTs are used simultaneously. + * It's supposed to be immediately before oMask but there seems to be no + * reasonable way to pass them in the correct order because LOAD_PAYLOAD + * requires header sources to form a contiguous segment at the beginning + * of the message and src0_alpha has per-channel semantics. + */ + setup_color_payload(&sources[length], src0_alpha, 1, exec_size, false); + length++; + } - setup_color_payload(&sources[length], color0, components, - exec_size, use_2nd_half); - length += 4; - } else { - setup_color_payload(&sources[length], color0, components, - exec_size, use_2nd_half); - length += 4; + setup_color_payload(&sources[length], color0, components, + exec_size, use_2nd_half); + length += 4; + + if (color1.file != BAD_FILE) { setup_color_payload(&sources[length], color1, components, exec_size, use_2nd_half); length += 4; |