Mesa (master): i965/fs: Move FB write default state mashing in a level.
Kenneth Graunke
kwg at kemper.freedesktop.org
Thu Jun 12 08:07:04 UTC 2014
Module: Mesa
Branch: master
Commit: b207caf9bc9ba489f8f5c36bf93fa144c5e55658
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b207caf9bc9ba489f8f5c36bf93fa144c5e55658
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Tue Jun 10 18:54:09 2014 -0700
i965/fs: Move FB write default state mashing in a level.
We only need to alter the default state if we're emitting MOVs for
header related fields. So, we can simply move the push/pop of state in
to the if (header_present) block, bypassing it in the common case.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79903
---
src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index d21b4e2..5e1174c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -148,12 +148,12 @@ fs_generator::generate_fb_write(fs_inst *inst)
/* Header is 2 regs, g0 and g1 are the contents. g0 will be implied
* move, here's g1.
*/
- brw_push_insn_state(p);
- brw_set_default_mask_control(p, BRW_MASK_DISABLE);
- brw_set_default_predicate_control(p, BRW_PREDICATE_NONE);
- brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
-
if (inst->header_present) {
+ brw_push_insn_state(p);
+ brw_set_default_mask_control(p, BRW_MASK_DISABLE);
+ brw_set_default_predicate_control(p, BRW_PREDICATE_NONE);
+ brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
+
/* On HSW, the GPU will use the predicate on SENDC, unless the header is
* present.
*/
@@ -197,12 +197,12 @@ fs_generator::generate_fb_write(fs_inst *inst)
} else {
implied_header = retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW);
}
+
+ brw_pop_insn_state(p);
} else {
implied_header = brw_null_reg();
}
- brw_pop_insn_state(p);
-
if (!runtime_check_aads_emit) {
fire_fb_write(inst, inst->base_mrf, implied_header, inst->mlen);
} else {
More information about the mesa-commit
mailing list