ac/surface: pack gfx9_surf_layout:resource_type better to save 8 bytes
authorMarek Olšák <marek.olsak@amd.com>
Fri, 2 Apr 2021 18:11:26 +0000 (14:11 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 12 Apr 2021 20:53:45 +0000 (20:53 +0000)
Yes, this saves 8 bytes. See pahole for yourself.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10083>

src/amd/common/ac_surface.h

index 8b5b0d3..3fe07ac 100644 (file)
@@ -175,7 +175,7 @@ struct gfx9_surf_layout {
    uint16_t fmask_epitch;     /* gfx9 only, not on gfx10 */
    uint16_t stencil_epitch;   /* gfx9 only, not on gfx10 */
 
-   enum gfx9_resource_type resource_type; /* 1D, 2D or 3D */
+   enum gfx9_resource_type resource_type:8; /* 1D, 2D or 3D */
    uint16_t surf_pitch;                   /* in blocks */
    uint16_t surf_height;