From 896c1c65d67089417709f567c03e6930fc7af958 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 14 Oct 2015 19:00:17 -0700 Subject: [PATCH] anv: Get rid of the descriptor_set_binding struct We no longer need it as we have a better way to deal with dynamic offsets. --- src/vulkan/anv_cmd_buffer.c | 8 ++++---- src/vulkan/anv_meta.c | 4 ++-- src/vulkan/anv_private.h | 7 +------ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index 718499d60c8..df076d0cac6 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -478,8 +478,8 @@ void anv_CmdBindDescriptorSets( ANV_FROM_HANDLE(anv_descriptor_set, set, pDescriptorSets[i]); set_layout = layout->set[firstSet + i].layout; - if (cmd_buffer->state.descriptors[firstSet + i].set != set) { - cmd_buffer->state.descriptors[firstSet + i].set = set; + if (cmd_buffer->state.descriptors[firstSet + i] != set) { + cmd_buffer->state.descriptors[firstSet + i] = set; cmd_buffer->state.descriptors_dirty |= set_layout->shader_stages; } @@ -598,7 +598,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, struct anv_pipeline_binding *binding = &layout->stage[stage].surface_to_descriptor[s]; struct anv_descriptor_set *set = - cmd_buffer->state.descriptors[binding->set].set; + cmd_buffer->state.descriptors[binding->set]; struct anv_descriptor *desc = &set->descriptors[binding->offset]; const struct anv_state *surface_state; @@ -654,7 +654,7 @@ anv_cmd_buffer_emit_samplers(struct anv_cmd_buffer *cmd_buffer, struct anv_pipeline_binding *binding = &layout->stage[stage].sampler_to_descriptor[s]; struct anv_descriptor_set *set = - cmd_buffer->state.descriptors[binding->set].set; + cmd_buffer->state.descriptors[binding->set]; struct anv_descriptor *desc = &set->descriptors[binding->offset]; if (desc->type != ANV_DESCRIPTOR_TYPE_SAMPLER) diff --git a/src/vulkan/anv_meta.c b/src/vulkan/anv_meta.c index 565575ab219..56a0d4b9d18 100644 --- a/src/vulkan/anv_meta.c +++ b/src/vulkan/anv_meta.c @@ -303,7 +303,7 @@ anv_cmd_buffer_save(struct anv_cmd_buffer *cmd_buffer, uint32_t dynamic_state) { state->old_pipeline = cmd_buffer->state.pipeline; - state->old_descriptor_set0 = cmd_buffer->state.descriptors[0].set; + state->old_descriptor_set0 = cmd_buffer->state.descriptors[0]; memcpy(state->old_vertex_bindings, cmd_buffer->state.vertex_bindings, sizeof(state->old_vertex_bindings)); state->dynamic_flags = dynamic_state; @@ -316,7 +316,7 @@ anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer, const struct anv_saved_state *state) { cmd_buffer->state.pipeline = state->old_pipeline; - cmd_buffer->state.descriptors[0].set = state->old_descriptor_set0; + cmd_buffer->state.descriptors[0] = state->old_descriptor_set0; memcpy(cmd_buffer->state.vertex_bindings, state->old_vertex_bindings, sizeof(state->old_vertex_bindings)); diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index 523e6dfa747..757a149289f 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -790,11 +790,6 @@ struct anv_vertex_binding { VkDeviceSize offset; }; -struct anv_descriptor_set_binding { - struct anv_descriptor_set * set; - uint32_t dynamic_offsets[128]; -}; - struct anv_push_constants { /* Current allocated size of this push constants data structure. * Because a decent chunk of it may not be used (images on SKL, for @@ -883,7 +878,7 @@ struct anv_cmd_state { struct anv_subpass * subpass; uint32_t state_vf[GEN8_3DSTATE_VF_length]; struct anv_vertex_binding vertex_bindings[MAX_VBS]; - struct anv_descriptor_set_binding descriptors[MAX_SETS]; + struct anv_descriptor_set * descriptors[MAX_SETS]; struct anv_push_constants * push_constants[VK_SHADER_STAGE_NUM]; struct anv_dynamic_state dynamic; -- 2.30.2