From de5220c7ce97d6aa72b84bf60f65886139e48eaf Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 11 Sep 2015 10:41:57 -0700 Subject: [PATCH] vk/pipeline_layout: Move surface/sampler start from SoA to AoS This makes more sense to me and it's more consistent with anv_descriptor_set_layout. --- src/vulkan/anv_cmd_buffer.c | 4 ++-- src/vulkan/anv_pipeline.c | 4 ++-- src/vulkan/anv_private.h | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index 17857d9759a..c2024e4dd60 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -449,7 +449,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, struct anv_descriptor_slot *surface_slots = set_layout->stage[stage].surface_start; - uint32_t start = bias + layout->set[set].surface_start[stage]; + uint32_t start = bias + layout->set[set].stage[stage].surface_start; for (uint32_t b = 0; b < set_layout->stage[stage].surface_count; b++) { struct anv_surface_view *view = @@ -515,7 +515,7 @@ anv_cmd_buffer_emit_samplers(struct anv_cmd_buffer *cmd_buffer, struct anv_descriptor_slot *sampler_slots = set_layout->stage[stage].sampler_start; - uint32_t start = layout->set[set].sampler_start[stage]; + uint32_t start = layout->set[set].stage[stage].sampler_start; for (uint32_t b = 0; b < set_layout->stage[stage].sampler_count; b++) { struct anv_sampler *sampler = diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c index 9372fb318df..dba2a5e7b46 100644 --- a/src/vulkan/anv_pipeline.c +++ b/src/vulkan/anv_pipeline.c @@ -395,9 +395,9 @@ VkResult anv_CreatePipelineLayout( layout->set[i].layout = set_layout; for (uint32_t s = 0; s < VK_SHADER_STAGE_NUM; s++) { - layout->set[i].surface_start[s] = surface_start[s]; + layout->set[i].stage[s].surface_start = surface_start[s]; surface_start[s] += set_layout->stage[s].surface_count; - layout->set[i].sampler_start[s] = sampler_start[s]; + layout->set[i].stage[s].sampler_start = sampler_start[s]; sampler_start[s] += set_layout->stage[s].sampler_count; layout->stage[s].surface_count += set_layout->stage[s].surface_count; diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index 53eb0b30526..f556161679f 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -664,8 +664,10 @@ anv_descriptor_set_destroy(struct anv_device *device, struct anv_pipeline_layout { struct { struct anv_descriptor_set_layout *layout; - uint32_t surface_start[VK_SHADER_STAGE_NUM]; - uint32_t sampler_start[VK_SHADER_STAGE_NUM]; + struct { + uint32_t surface_start; + uint32_t sampler_start; + } stage[VK_SHADER_STAGE_NUM]; } set[MAX_SETS]; uint32_t num_sets; -- 2.30.2