Module: Mesa
Branch: master
Commit: 26d22b094bb7b2f37d4bc8edfeb1b2a9a1c96d88
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=26d22b094bb7b2f37d4bc8edfeb1b2a9a1c96d88

Author: Brian Paul <bri...@vmware.com>
Date:   Thu Oct 29 16:02:35 2009 -0600

i965: make brw_sf_prog_key::sprite_origin_lower_left one bit

Shrinks size of key to 8 bytes from 12.
Note that progs/demos/spriteblast.c is still broken.

---

 src/mesa/drivers/dri/i965/brw_sf.c      |    2 +-
 src/mesa/drivers/dri/i965/brw_sf.h      |    4 ++--
 src/mesa/drivers/dri/i965/brw_sf_emit.c |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_sf.c 
b/src/mesa/drivers/dri/i965/brw_sf.c
index e1c2c77..f350cbd 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -161,7 +161,7 @@ static void upload_sf_prog(struct brw_context *brw)
    }
 
    key.do_point_sprite = ctx->Point.PointSprite;
-   key.SpriteOrigin = ctx->Point.SpriteOrigin;
+   key.sprite_origin_lower_left = (ctx->Point.SpriteOrigin == GL_LOWER_LEFT);
    /* _NEW_LIGHT */
    key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
    key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide);
diff --git a/src/mesa/drivers/dri/i965/brw_sf.h 
b/src/mesa/drivers/dri/i965/brw_sf.h
index 6426b6d..e415bbd 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.h
+++ b/src/mesa/drivers/dri/i965/brw_sf.h
@@ -52,8 +52,8 @@ struct brw_sf_prog_key {
    GLuint frontface_ccw:1;
    GLuint do_point_sprite:1;
    GLuint linear_color:1;  /**< linear interp vs. perspective interp */
-   GLuint pad:25;
-   GLenum SpriteOrigin;
+   GLuint sprite_origin_lower_left:1;
+   GLuint pad:24;
 };
 
 struct brw_sf_point_tex {
diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c 
b/src/mesa/drivers/dri/i965/brw_sf_emit.c
index ca8f97f..561fcd5 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c
@@ -551,7 +551,7 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, 
GLboolean allocate)
                  BRW_MATH_DATA_SCALAR,
                  BRW_MATH_PRECISION_FULL);
 
-         if (c->key.SpriteOrigin == GL_LOWER_LEFT) {
+         if (c->key.sprite_origin_lower_left) {
                brw_MUL(p, c->m1Cx, c->tmp, c->inv_w[0]);
                brw_MOV(p, vec1(suboffset(c->m1Cx, 1)), brw_imm_f(0.0));
                brw_MUL(p, c->m2Cy, c->tmp, negate(c->inv_w[0]));
@@ -570,7 +570,7 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, 
GLboolean allocate)
       {
         brw_set_predicate_control_flag_value(p, pc); 
         if (tex->CoordReplace) {
-            if (c->key.SpriteOrigin == GL_LOWER_LEFT) {
+            if (c->key.sprite_origin_lower_left) {
                 brw_MUL(p, c->m3C0, c->inv_w[0], brw_imm_f(1.0));
                 brw_MOV(p, vec1(suboffset(c->m3C0, 0)), brw_imm_f(0.0));
             }

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to