summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_context.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-12-02 12:28:13 -0800
committerMatt Turner <mattst88@gmail.com>2014-12-05 09:49:42 -0800
commit2881b123d00562fee8b7d2b4f7825f89a73e0d9f (patch)
treee89036c38d6dcd5a89858711319a1a91fb0041ca /src/mesa/drivers/dri/i965/brw_context.c
parent05e2578cac608ba703d188fdff4903b92dec4aed (diff)
downloadexternal_mesa3d-2881b123d00562fee8b7d2b4f7825f89a73e0d9f.zip
external_mesa3d-2881b123d00562fee8b7d2b4f7825f89a73e0d9f.tar.gz
external_mesa3d-2881b123d00562fee8b7d2b4f7825f89a73e0d9f.tar.bz2
i965: Use ~0 to represent true on all generations.
Jason realized that we could fix the result of the CMP instruction on Gen <= 5 by doing -(result & 1). Also do the resolves in the vec4 backend before use, rather than when the bool was created. The FS does this and it saves some unnecessary resolves. On Ironlake: total instructions in shared programs: 4289762 -> 4287277 (-0.06%) instructions in affected programs: 619430 -> 616945 (-0.40%) Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_context.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 5830b6e..ee9684b 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -516,18 +516,10 @@ brw_initialize_context_constants(struct brw_context *brw)
* contains meaning [sic] data, software should make sure all higher bits
* are masked out (e.g. by 'and-ing' an [sic] 0x01 constant)."
*
- * We select the representation of a true boolean uniform to match what the
- * CMP instruction returns.
- *
- * The Sandybridge BSpec's description of the CMP instruction matches that
- * of the Ivybridge PRM. (The description in the Sandybridge PRM is seems
- * to have not been updated from Ironlake). Its CMP instruction behaves like
- * Ivybridge and newer.
+ * We select the representation of a true boolean uniform to be ~0, and fix
+ * the results of Gen <= 5 CMP instruction's with -(result & 1).
*/
- if (brw->gen >= 6)
- ctx->Const.UniformBooleanTrue = ~0;
- else
- ctx->Const.UniformBooleanTrue = 1;
+ ctx->Const.UniformBooleanTrue = ~0;
/* From the gen4 PRM, volume 4 page 127:
*