[Mesa-dev] [PATCH 3/9] ac: pack legacy_surf_level better

Marek Olšák maraeo at gmail.com
Tue Nov 21 17:30:30 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

r600_texture: 1488 -> 1248 bytes
---
 src/amd/common/ac_surface.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/common/ac_surface.h b/src/amd/common/ac_surface.h
index ec89f6b..f18548f 100644
--- a/src/amd/common/ac_surface.h
+++ b/src/amd/common/ac_surface.h
@@ -67,23 +67,23 @@ enum radeon_micro_mode {
 #define RADEON_SURF_TC_COMPATIBLE_HTILE         (1 << 23)
 #define RADEON_SURF_IMPORTED                    (1 << 24)
 #define RADEON_SURF_OPTIMIZE_FOR_SPACE          (1 << 25)
 #define RADEON_SURF_SHAREABLE                   (1 << 26)
 
 struct legacy_surf_level {
     uint64_t                    offset;
     uint32_t                    slice_size_dw; /* in dwords; max = 4GB / 4. */
     uint32_t                    dcc_offset; /* relative offset within DCC mip tree */
     uint32_t                    dcc_fast_clear_size;
-    uint16_t                    nblk_x;
-    uint16_t                    nblk_y;
-    enum radeon_surf_mode       mode;
+    unsigned                    nblk_x:15;
+    unsigned                    nblk_y:15;
+    enum radeon_surf_mode       mode:2;
 };
 
 struct legacy_surf_layout {
     unsigned                    bankw:4;  /* max 8 */
     unsigned                    bankh:4;  /* max 8 */
     unsigned                    mtilea:4; /* max 8 */
     unsigned                    tile_split:13;         /* max 4K */
     unsigned                    stencil_tile_split:13; /* max 4K */
     unsigned                    pipe_config:5;      /* max 17 */
     unsigned                    num_banks:5;        /* max 16 */
-- 
2.7.4



More information about the mesa-dev mailing list