diff options
author | Iago Toral Quiroga <[email protected]> | 2018-01-25 11:54:35 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2018-01-26 14:06:47 +0100 |
commit | 75a4802060095da87283e6de8239cdb03147c8d8 (patch) | |
tree | 166a518988e7d78514d93aec8b3d6311204ce14f /src/intel/vulkan/anv_cmd_buffer.c | |
parent | e1a49f974bc086c54b567471908f78c53b467072 (diff) |
anv/cmd_buffer: add the pipeline layout to the pipeline state
We need to access the pipeline layout to compute correct dynamic
offsets for dyamic UBO/SSBO descriptors when we emit draw commands.
Instead of taking it from the pipeline object, store the layout
in the command buffer pipeline state.
Suggested-by: Jason Ekstrand <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_cmd_buffer.c')
-rw-r--r-- | src/intel/vulkan/anv_cmd_buffer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 521cf6b6a54..d703d7a8335 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -547,6 +547,14 @@ anv_cmd_buffer_bind_descriptor_set(struct anv_cmd_buffer *cmd_buffer, cmd_buffer->state.descriptors_dirty |= set_layout->shader_stages & VK_SHADER_STAGE_ALL_GRAPHICS; } + + /* Pipeline layout objects are required to live at least while any command + * buffers that use them are in recording state. We need to grab a reference + * to the pipeline layout being bound here so we can compute correct dynamic + * offsets for VK_DESCRIPTOR_TYPE_*_DYNAMIC in dynamic_offset_for_binding() + * when we record draw commands that come after this. + */ + pipe_state->layout = layout; } void anv_CmdBindDescriptorSets( |