summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_eu.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-04-09 08:29:59 -1000
committerEric Anholt <eric@anholt.net>2011-04-13 17:57:53 -0700
commit4847f802c28e595130bda14055cd52c9b1f51cd7 (patch)
treeba3193d017e5ded507c65dc8809e12dcd3ec6e15 /src/mesa/drivers/dri/i965/brw_eu.c
parent811c147220d2630b769e505ce4d40ef9108fe034 (diff)
downloadexternal_mesa3d-4847f802c28e595130bda14055cd52c9b1f51cd7.zip
external_mesa3d-4847f802c28e595130bda14055cd52c9b1f51cd7.tar.gz
external_mesa3d-4847f802c28e595130bda14055cd52c9b1f51cd7.tar.bz2
i965/fs: Constant-fold immediates in src0 of SEL instructions.
This is like what we do for add/mul, but we have to invert the predicate to choose the other source instead. This removes 5 extra moves of constants in nexuiz shaders. No statistically significant performance difference on my Sandybridge laptop (n=5). Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_eu.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index b59d6b2..7e63482 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -82,6 +82,11 @@ void brw_set_predicate_control( struct brw_compile *p, GLuint pc )
p->current->header.predicate_control = pc;
}
+void brw_set_predicate_inverse(struct brw_compile *p, bool predicate_inverse)
+{
+ p->current->header.predicate_inverse = predicate_inverse;
+}
+
void brw_set_conditionalmod( struct brw_compile *p, GLuint conditional )
{
p->current->header.destreg__conditionalmod = conditional;