From 5a0bb5b856161d7e74342da2790a3bdbe3eb5cc1 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sat, 17 Jan 2026 20:46:06 +0200 Subject: [PATCH] anv: pack bind_map further Signed-off-by: Lionel Landwerlin Reviewed-by: Alyssa Rosenzweig Part-of: --- src/intel/vulkan/anv_private.h | 6 +++--- src/intel/vulkan/anv_shader.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 85eb12729e3..691d8192fda 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1163,9 +1163,9 @@ struct anv_pipeline_bind_map { /* enum anv_pipeline_bind_mask */ uint16_t binding_mask; - uint32_t surface_count; - uint32_t sampler_count; - uint32_t embedded_sampler_count; + uint8_t surface_count; + uint8_t sampler_count; + uint16_t embedded_sampler_count; struct anv_pipeline_binding * surface_to_descriptor; struct anv_pipeline_binding * sampler_to_descriptor; diff --git a/src/intel/vulkan/anv_shader.c b/src/intel/vulkan/anv_shader.c index 47f2cf0e15c..cec1eeb30f0 100644 --- a/src/intel/vulkan/anv_shader.c +++ b/src/intel/vulkan/anv_shader.c @@ -71,9 +71,9 @@ anv_shader_deserialize(struct vk_device *vk_device, blob_copy_bytes(blob, data.bind_map.push_sha1, sizeof(data.bind_map.push_sha1)); data.bind_map.layout_type = blob_read_uint16(blob); data.bind_map.binding_mask = blob_read_uint16(blob); - data.bind_map.surface_count = blob_read_uint32(blob); - data.bind_map.sampler_count = blob_read_uint32(blob); - data.bind_map.embedded_sampler_count = blob_read_uint32(blob); + data.bind_map.surface_count = blob_read_uint8(blob); + data.bind_map.sampler_count = blob_read_uint8(blob); + data.bind_map.embedded_sampler_count = blob_read_uint16(blob); data.bind_map.surface_to_descriptor = (void *) blob_read_bytes(blob, data.bind_map.surface_count * sizeof(*data.bind_map.surface_to_descriptor)); @@ -151,9 +151,9 @@ anv_shader_serialize(struct vk_device *device, sizeof(shader->bind_map.push_sha1)); blob_write_uint16(blob, shader->bind_map.layout_type); blob_write_uint16(blob, shader->bind_map.binding_mask); - blob_write_uint32(blob, shader->bind_map.surface_count); - blob_write_uint32(blob, shader->bind_map.sampler_count); - blob_write_uint32(blob, shader->bind_map.embedded_sampler_count); + blob_write_uint8(blob, shader->bind_map.surface_count); + blob_write_uint8(blob, shader->bind_map.sampler_count); + blob_write_uint16(blob, shader->bind_map.embedded_sampler_count); blob_write_bytes(blob, shader->bind_map.surface_to_descriptor, shader->bind_map.surface_count * sizeof(*shader->bind_map.surface_to_descriptor));