Mesa (master): mesa: Remove gratuitous padding in prog_dst_register.

Eric Anholt anholt at kemper.freedesktop.org
Thu Nov 19 11:17:19 UTC 2009


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Nov 18 03:05:14 2009 -0800

mesa: Remove gratuitous padding in prog_dst_register.

The padding was there to indicate the amount of space left from the
number of expected bytes in the struct minus allocated bits.  But
uint bitfields get packed so that they don't cross uint boundaries, and we
ended up allocating an extra dword to hold the pad field!

---

 src/mesa/drivers/dri/i965/brw_wm_fp.c |    1 -
 src/mesa/main/ffvertex_prog.c         |    1 -
 src/mesa/shader/prog_instruction.h    |    1 -
 3 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c
index 7d03179..3737faf 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_fp.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c
@@ -138,7 +138,6 @@ static struct prog_dst_register dst_reg(GLuint file, GLuint idx)
    reg.CondMask = COND_TR;
    reg.CondSwizzle = 0;
    reg.CondSrc = 0;
-   reg.pad = 0;
    return reg;
 }
 
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index fe2416d..5cfa898 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -523,7 +523,6 @@ static void emit_dst( struct prog_dst_register *dst,
    dst->CondMask = COND_TR;  /* always pass cond test */
    dst->CondSwizzle = SWIZZLE_NOOP;
    dst->CondSrc = 0;
-   dst->pad = 0;
    /* Check that bitfield sizes aren't exceeded */
    ASSERT(dst->Index == reg.idx);
 }
diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h
index 1c687bc..224350c 100644
--- a/src/mesa/shader/prog_instruction.h
+++ b/src/mesa/shader/prog_instruction.h
@@ -312,7 +312,6 @@ struct prog_dst_register
     */
    GLuint CondSrc:1;
    /*@}*/
-   GLuint pad:28;
 };
 
 




More information about the mesa-commit mailing list