diff options
author | Ben Widawsky <[email protected]> | 2015-03-31 15:49:42 -0700 |
---|---|---|
committer | Ben Widawsky <[email protected]> | 2015-04-14 15:22:47 -0700 |
commit | 38707e1478a4b6f4687c583d06fbd68e22900735 (patch) | |
tree | ddd62abb9144b5c6119dd7adedc925ce5a74aa20 /src/mesa/drivers | |
parent | 28d9e90428282a5e0a6aa31ad858a5cf514d1264 (diff) |
i965/fs: Create a has_side_effects for fs_inst
When an instruction has a side effect, it impacts the available options when
reordering an instruction. As the EOT flag is an implied write to the render
target in the FS, it can be considered a side effect.
This patch shouldn't actually have any impact on the current code since the EOT
flag implies that the opcode is already one with side effects,
FS_OPCODE_FB_WRITE. The next patch however will introduce an optimization
whereby the EOT flag can occur with an opcode SHADER_OPCODE_TEX, and as that
instruction will perform the same implied write to the render target, it cannot
be reordered.
v2: Remove extra whitespace (Matt)
Signed-off-by: Ben Widawsky <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_ir_fs.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 8bd8da2389d..aea1ebb7dea 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -531,6 +531,12 @@ fs_inst::can_do_source_mods(struct brw_context *brw) return true; } +bool +fs_inst::has_side_effects() const +{ + return this->eot || backend_instruction::has_side_effects(); +} + void fs_reg::init() { diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h index 9ef1261ab3b..30c19f41a31 100644 --- a/src/mesa/drivers/dri/i965/brw_ir_fs.h +++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h @@ -225,6 +225,7 @@ public: bool is_partial_write() const; int regs_read(int arg) const; bool can_do_source_mods(struct brw_context *brw); + bool has_side_effects() const; bool reads_flag() const; bool writes_flag() const; |