diff options
Diffstat (limited to 'src/intel/vulkan/genX_cmd_buffer.c')
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 479f75b3b1a..e25d2e1e3d2 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1463,32 +1463,32 @@ cmd_buffer_alloc_push_constants(struct anv_cmd_buffer *cmd_buffer) } static const struct anv_descriptor * -anv_descriptor_for_binding(const struct anv_cmd_buffer *cmd_buffer, +anv_descriptor_for_binding(const struct anv_cmd_pipeline_state *pipe_state, const struct anv_pipeline_binding *binding) { assert(binding->set < MAX_SETS); const struct anv_descriptor_set *set = - cmd_buffer->state.descriptors[binding->set]; + pipe_state->descriptors[binding->set]; const uint32_t offset = set->layout->binding[binding->binding].descriptor_index; return &set->descriptors[offset + binding->index]; } static uint32_t -dynamic_offset_for_binding(const struct anv_cmd_buffer *cmd_buffer, +dynamic_offset_for_binding(const struct anv_cmd_pipeline_state *pipe_state, const struct anv_pipeline *pipeline, const struct anv_pipeline_binding *binding) { assert(binding->set < MAX_SETS); const struct anv_descriptor_set *set = - cmd_buffer->state.descriptors[binding->set]; + pipe_state->descriptors[binding->set]; uint32_t dynamic_offset_idx = pipeline->layout->set[binding->set].dynamic_offset_start + set->layout->binding[binding->binding].dynamic_offset_index + binding->index; - return cmd_buffer->state.dynamic_offsets[dynamic_offset_idx]; + return pipe_state->dynamic_offsets[dynamic_offset_idx]; } static VkResult @@ -1596,7 +1596,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer, } const struct anv_descriptor *desc = - anv_descriptor_for_binding(cmd_buffer, binding); + anv_descriptor_for_binding(pipe_state, binding); switch (desc->type) { case VK_DESCRIPTOR_TYPE_SAMPLER: @@ -1672,7 +1672,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer, case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: { /* Compute the offset within the buffer */ uint32_t dynamic_offset = - dynamic_offset_for_binding(cmd_buffer, pipeline, binding); + dynamic_offset_for_binding(pipe_state, pipeline, binding); uint64_t offset = desc->offset + dynamic_offset; /* Clamp to the buffer size */ offset = MIN2(offset, desc->buffer->size); @@ -1753,7 +1753,7 @@ emit_samplers(struct anv_cmd_buffer *cmd_buffer, for (uint32_t s = 0; s < map->sampler_count; s++) { struct anv_pipeline_binding *binding = &map->sampler_to_descriptor[s]; const struct anv_descriptor *desc = - anv_descriptor_for_binding(cmd_buffer, binding); + anv_descriptor_for_binding(pipe_state, binding); if (desc->type != VK_DESCRIPTOR_TYPE_SAMPLER && desc->type != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) @@ -1877,7 +1877,8 @@ static void cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer, VkShaderStageFlags dirty_stages) { - const struct anv_pipeline *pipeline = cmd_buffer->state.gfx.base.pipeline; + const struct anv_cmd_graphics_state *gfx_state = &cmd_buffer->state.gfx; + const struct anv_pipeline *pipeline = gfx_state->base.pipeline; static const uint32_t push_constant_opcodes[] = { [MESA_SHADER_VERTEX] = 21, @@ -1930,7 +1931,7 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer, &bind_map->surface_to_descriptor[surface]; const struct anv_descriptor *desc = - anv_descriptor_for_binding(cmd_buffer, binding); + anv_descriptor_for_binding(&gfx_state->base, binding); struct anv_address read_addr; uint32_t read_len; @@ -1946,7 +1947,8 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer, assert(desc->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC); uint32_t dynamic_offset = - dynamic_offset_for_binding(cmd_buffer, pipeline, binding); + dynamic_offset_for_binding(&gfx_state->base, + pipeline, binding); uint32_t buf_offset = MIN2(desc->offset + dynamic_offset, desc->buffer->size); uint32_t buf_range = |