diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2014-05-25 01:08:47 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2014-05-27 13:46:00 -0700 |
commit | a5bb24d7692367a38f46449141bc57397d33dfc2 (patch) | |
tree | a52b815907705ee09a4bd6d51aa961a78c3e5960 /src/mesa/drivers/dri/i965/brw_sf_emit.c | |
parent | b3ad853a2c9d40064b6e8c65ade4b671f1b8d8ad (diff) | |
download | external_mesa3d-a5bb24d7692367a38f46449141bc57397d33dfc2.zip external_mesa3d-a5bb24d7692367a38f46449141bc57397d33dfc2.tar.gz external_mesa3d-a5bb24d7692367a38f46449141bc57397d33dfc2.tar.bz2 |
i965/sf: Reset flag_value to 0xff before emitting SF subroutines.
When compiling any of the SF program variants, flag_value starts off as
0xff and will be modified when generating code.
brw_emit_anyprim_setup emits several subroutines, saving and restoring
flag_value across each of them. Since it starts out as 0xff, this is
equivalent to simply setting it to 0xff at the start of each subroutine.
Resetting the value makes more logical sense; each subroutine doesn't
know whether one of the others even executed, much less what it did
to the flag register.
This also lets us to drop the brw_set_predicate_control_flag_value call
from brw_init_compile: predicate is already initialized to
BRW_PREDICATE_NONE by the memset, and the value of flag_value is
irrelevant (as it's only used by the SF compiler).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_sf_emit.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_sf_emit.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c index 2488a01..96be91a 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_emit.c +++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c @@ -422,6 +422,7 @@ void brw_emit_tri_setup(struct brw_sf_compile *c, bool allocate) struct brw_compile *p = &c->func; GLuint i; + p->flag_value = 0xff; c->nr_verts = 3; if (allocate) @@ -508,7 +509,7 @@ void brw_emit_line_setup(struct brw_sf_compile *c, bool allocate) struct brw_compile *p = &c->func; GLuint i; - + p->flag_value = 0xff; c->nr_verts = 2; if (allocate) @@ -578,6 +579,7 @@ void brw_emit_point_sprite_setup(struct brw_sf_compile *c, bool allocate) struct brw_compile *p = &c->func; GLuint i; + p->flag_value = 0xff; c->nr_verts = 1; if (allocate) @@ -668,6 +670,7 @@ void brw_emit_point_setup(struct brw_sf_compile *c, bool allocate) struct brw_compile *p = &c->func; GLuint i; + p->flag_value = 0xff; c->nr_verts = 1; if (allocate) @@ -745,8 +748,6 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) int jmp; struct brw_reg v1_null_ud = vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD)); - GLuint saveflag; - c->nr_verts = 3; alloc_regs(c); @@ -765,15 +766,9 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) (1<<_3DPRIM_TRIFAN_NOSTIPPLE))); jmp = brw_JMPI(p, ip, ip, brw_imm_d(0)) - p->store; { - saveflag = p->flag_value; brw_push_insn_state(p); brw_emit_tri_setup( c, false ); brw_pop_insn_state(p); - p->flag_value = saveflag; - /* note - thread killed in subroutine, so must - * restore the flag which is changed when building - * the subroutine. fix #13240 - */ } brw_land_fwd_jump(p, jmp); @@ -786,12 +781,9 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) (1<<_3DPRIM_LINESTRIP_CONT_BF))); jmp = brw_JMPI(p, ip, ip, brw_imm_d(0)) - p->store; { - saveflag = p->flag_value; brw_push_insn_state(p); brw_emit_line_setup( c, false ); brw_pop_insn_state(p); - p->flag_value = saveflag; - /* note - thread killed in subroutine */ } brw_land_fwd_jump(p, jmp); @@ -799,11 +791,9 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) brw_AND(p, v1_null_ud, payload_attr, brw_imm_ud(1<<BRW_SPRITE_POINT_ENABLE)); jmp = brw_JMPI(p, ip, ip, brw_imm_d(0)) - p->store; { - saveflag = p->flag_value; brw_push_insn_state(p); brw_emit_point_sprite_setup( c, false ); brw_pop_insn_state(p); - p->flag_value = saveflag; } brw_land_fwd_jump(p, jmp); |