aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-05-25 01:08:53 -0700
committerKenneth Graunke <[email protected]>2014-05-27 13:46:01 -0700
commitd9cac44a146377134bc883c676854e53fd87f5c4 (patch)
treef08defc12ac32c360e31362a05e24753e1133c42 /src
parente287f5937f0381a4ff24583a3cfd74ccaa37f423 (diff)
i965/sf: Move brw_compile::flag_value to brw_sf_compile.
This field is only used to track the current value of the flag register during the SF compile. It has no place in the common compiler code. While we're changing every call, drop the 'brw' prefix from the function since it's static. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf.h3
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf_emit.c41
3 files changed, 24 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index 43cd1728161..ce78c6bb4f2 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -60,7 +60,6 @@ struct brw_compile {
bool compressed_stack[BRW_EU_MAX_INSN_STACK];
struct brw_instruction *current;
- unsigned flag_value;
bool single_program_flow;
bool compressed;
struct brw_context *brw;
diff --git a/src/mesa/drivers/dri/i965/brw_sf.h b/src/mesa/drivers/dri/i965/brw_sf.h
index 971f5fb0a24..066adb95399 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.h
+++ b/src/mesa/drivers/dri/i965/brw_sf.h
@@ -94,6 +94,9 @@ struct brw_sf_compile {
GLuint nr_setup_regs;
int urb_entry_read_offset;
+ /** The last known value of the f0.0 flag register. */
+ unsigned flag_value;
+
struct brw_vue_map vue_map;
bool has_flat_shading;
};
diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c
index c5308a5af5f..45e6767b2c7 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c
@@ -414,15 +414,16 @@ calculate_point_sprite_mask(struct brw_sf_compile *c, GLuint reg)
}
static void
-brw_set_predicate_control_flag_value(struct brw_compile *p,
- unsigned value)
+set_predicate_control_flag_value(struct brw_compile *p,
+ struct brw_sf_compile *c,
+ unsigned value)
{
p->current->header.predicate_control = BRW_PREDICATE_NONE;
if (value != 0xff) {
- if (value != p->flag_value) {
+ if (value != c->flag_value) {
brw_MOV(p, brw_flag_reg(0, 0), brw_imm_uw(value));
- p->flag_value = value;
+ c->flag_value = value;
}
p->current->header.predicate_control = BRW_PREDICATE_NORMAL;
@@ -434,7 +435,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->flag_value = 0xff;
c->nr_verts = 3;
if (allocate)
@@ -462,7 +463,7 @@ void brw_emit_tri_setup(struct brw_sf_compile *c, bool allocate)
if (pc_persp)
{
- brw_set_predicate_control_flag_value(p, pc_persp);
+ set_predicate_control_flag_value(p, c, pc_persp);
brw_MUL(p, a0, a0, c->inv_w[0]);
brw_MUL(p, a1, a1, c->inv_w[1]);
brw_MUL(p, a2, a2, c->inv_w[2]);
@@ -473,7 +474,7 @@ void brw_emit_tri_setup(struct brw_sf_compile *c, bool allocate)
*/
if (pc_linear)
{
- brw_set_predicate_control_flag_value(p, pc_linear);
+ set_predicate_control_flag_value(p, c, pc_linear);
brw_ADD(p, c->a1_sub_a0, a1, negate(a0));
brw_ADD(p, c->a2_sub_a0, a2, negate(a0));
@@ -492,7 +493,7 @@ void brw_emit_tri_setup(struct brw_sf_compile *c, bool allocate)
}
{
- brw_set_predicate_control_flag_value(p, pc);
+ set_predicate_control_flag_value(p, c, pc);
/* start point for interpolation
*/
brw_MOV(p, c->m3C0, a0);
@@ -521,7 +522,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->flag_value = 0xff;
c->nr_verts = 2;
if (allocate)
@@ -544,7 +545,7 @@ void brw_emit_line_setup(struct brw_sf_compile *c, bool allocate)
if (pc_persp)
{
- brw_set_predicate_control_flag_value(p, pc_persp);
+ set_predicate_control_flag_value(p, c, pc_persp);
brw_MUL(p, a0, a0, c->inv_w[0]);
brw_MUL(p, a1, a1, c->inv_w[1]);
}
@@ -552,7 +553,7 @@ void brw_emit_line_setup(struct brw_sf_compile *c, bool allocate)
/* Calculate coefficients for position, color:
*/
if (pc_linear) {
- brw_set_predicate_control_flag_value(p, pc_linear);
+ set_predicate_control_flag_value(p, c, pc_linear);
brw_ADD(p, c->a1_sub_a0, a1, negate(a0));
@@ -564,7 +565,7 @@ void brw_emit_line_setup(struct brw_sf_compile *c, bool allocate)
}
{
- brw_set_predicate_control_flag_value(p, pc);
+ set_predicate_control_flag_value(p, c, pc);
/* start point for interpolation
*/
@@ -591,7 +592,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->flag_value = 0xff;
c->nr_verts = 1;
if (allocate)
@@ -608,7 +609,7 @@ void brw_emit_point_sprite_setup(struct brw_sf_compile *c, bool allocate)
pc_persp &= ~pc_coord_replace;
if (pc_persp) {
- brw_set_predicate_control_flag_value(p, pc_persp);
+ set_predicate_control_flag_value(p, c, pc_persp);
brw_MUL(p, a0, a0, c->inv_w[0]);
}
@@ -618,7 +619,7 @@ void brw_emit_point_sprite_setup(struct brw_sf_compile *c, bool allocate)
* point.
*/
if (pc_coord_replace) {
- brw_set_predicate_control_flag_value(p, pc_coord_replace);
+ set_predicate_control_flag_value(p, c, pc_coord_replace);
/* Caculate 1.0/PointWidth */
brw_math(&c->func,
c->tmp,
@@ -652,14 +653,14 @@ void brw_emit_point_sprite_setup(struct brw_sf_compile *c, bool allocate)
}
if (pc & ~pc_coord_replace) {
- brw_set_predicate_control_flag_value(p, pc & ~pc_coord_replace);
+ set_predicate_control_flag_value(p, c, pc & ~pc_coord_replace);
brw_MOV(p, c->m1Cx, brw_imm_ud(0));
brw_MOV(p, c->m2Cy, brw_imm_ud(0));
brw_MOV(p, c->m3C0, a0); /* constant value */
}
- brw_set_predicate_control_flag_value(p, pc);
+ set_predicate_control_flag_value(p, c, pc);
/* Copy m0..m3 to URB. */
brw_urb_WRITE(p,
brw_null_reg(),
@@ -682,7 +683,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->flag_value = 0xff;
c->nr_verts = 1;
if (allocate)
@@ -704,7 +705,7 @@ void brw_emit_point_setup(struct brw_sf_compile *c, bool allocate)
/* This seems odd as the values are all constant, but the
* fragment shader will be expecting it:
*/
- brw_set_predicate_control_flag_value(p, pc_persp);
+ set_predicate_control_flag_value(p, c, pc_persp);
brw_MUL(p, a0, a0, c->inv_w[0]);
}
@@ -714,7 +715,7 @@ void brw_emit_point_setup(struct brw_sf_compile *c, bool allocate)
* code in the fragment shader.
*/
{
- brw_set_predicate_control_flag_value(p, pc);
+ set_predicate_control_flag_value(p, c, pc);
brw_MOV(p, c->m3C0, a0); /* constant value */