From 169dc86e74335dfaaef7820047c0cdf329700e38 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 13 Jun 2024 21:55:07 +0200 Subject: [PATCH] gallium: properly type fields of pipe_resource.usage This gets rid of most of the pointless bitfields and also moves away from unsigned, which we really should stop using :) Acked-by: Mike Blumenkrantz Reviewed-by: Alyssa Rosenzweig Reviewed-by: Adam Jackson Part-of: --- src/gallium/include/pipe/p_state.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index b296598d8fd..3a5b751c665 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -556,34 +556,34 @@ struct pipe_resource /* Put the refcount on its own cache line to prevent "False sharing". */ EXCLUSIVE_CACHELINE(struct pipe_reference reference); - unsigned width0; /**< Used by both buffers and textures. */ + uint32_t width0; /**< Used by both buffers and textures. */ uint16_t height0; /* Textures: The maximum height/depth/array_size is 16k. */ uint16_t depth0; uint16_t array_size; enum pipe_format format:16; /**< PIPE_FORMAT_x */ enum pipe_texture_target target:8; /**< PIPE_TEXTURE_x */ - unsigned last_level:8; /**< Index of last mipmap level present/defined */ + uint8_t last_level; /**< Index of last mipmap level present/defined */ /** Number of samples determining quality, driving rasterizer, shading, * and framebuffer. */ - unsigned nr_samples:8; + uint8_t nr_samples; /** Multiple samples within a pixel can have the same value. * nr_storage_samples determines how many slots for different values * there are per pixel. Only color buffers can set this lower than * nr_samples. */ - unsigned nr_storage_samples:8; + uint8_t nr_storage_samples; - unsigned nr_sparse_levels:8; /**< Mipmap levels support partial resident */ + uint8_t nr_sparse_levels; /**< Mipmap levels support partial resident */ unsigned compression_rate:4; /**< Fixed-rate compresion bitrate if any */ enum pipe_resource_usage usage:4; - unsigned bind; /**< bitmask of PIPE_BIND_x */ - unsigned flags; /**< bitmask of PIPE_RESOURCE_FLAG_x */ + uint32_t bind; /**< bitmask of PIPE_BIND_x */ + uint32_t flags; /**< bitmask of PIPE_RESOURCE_FLAG_x */ /** * For planar images, ie. YUV EGLImage external, etc, pointer to the