anv: Get rid of the descriptor_set_binding struct
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Oct 2015 02:00:17 +0000 (19:00 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Oct 2015 02:02:29 +0000 (19:02 -0700)
We no longer need it as we have a better way to deal with dynamic offsets.

src/vulkan/anv_cmd_buffer.c
src/vulkan/anv_meta.c
src/vulkan/anv_private.h

index 718499d60c8133f19398c6d9da1a500267558aec..df076d0cac604c4a0babe08b67581a494142a992 100644 (file)
@@ -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)
index 565575ab21923ca8e4eed8cc62d99748bc93a9fd..56a0d4b9d1858fe62ab1c7f818d76b296317c8d9 100644 (file)
@@ -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));
 
index 523e6dfa74749b72ce7ed164efe554603da181fd..757a149289f577b0eea0a8aaffc8cfaeee57c7f5 100644 (file)
@@ -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;