From: Jason Ekstrand Date: Wed, 8 Jul 2015 00:06:10 +0000 (-0700) Subject: vk/vulkan.h: Add a PipelineLayout parameter to BindDescriptorSets X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=435b062b2616124df4d4352b78799e42a9f6a621;p=mesa.git vk/vulkan.h: Add a PipelineLayout parameter to BindDescriptorSets --- diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 80edb316cc7..856dbe499df 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -1971,7 +1971,7 @@ typedef VkResult (VKAPI *PFN_vkEndCommandBuffer)(VkCmdBuffer cmdBuffer); typedef VkResult (VKAPI *PFN_vkResetCommandBuffer)(VkCmdBuffer cmdBuffer); typedef void (VKAPI *PFN_vkCmdBindPipeline)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); typedef void (VKAPI *PFN_vkCmdBindDynamicStateObject)(VkCmdBuffer cmdBuffer, VkStateBindPoint stateBindPoint, VkDynamicStateObject dynamicState); -typedef void (VKAPI *PFN_vkCmdBindDescriptorSets)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets); +typedef void (VKAPI *PFN_vkCmdBindDescriptorSets)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets); typedef void (VKAPI *PFN_vkCmdBindIndexBuffer)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); typedef void (VKAPI *PFN_vkCmdBindVertexBuffers)(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets); typedef void (VKAPI *PFN_vkCmdDraw)(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount); @@ -2398,6 +2398,7 @@ void VKAPI vkCmdBindDynamicStateObject( void VKAPI vkCmdBindDescriptorSets( VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 69fd335634b..a43bd04b645 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -2665,6 +2665,7 @@ anv_cmd_buffer_new_surface_state_bo(struct anv_cmd_buffer *cmd_buffer) void anv_CmdBindDescriptorSets( VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout _layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, @@ -2672,17 +2673,12 @@ void anv_CmdBindDescriptorSets( const uint32_t* pDynamicOffsets) { struct anv_cmd_buffer *cmd_buffer = (struct anv_cmd_buffer *) cmdBuffer; - struct anv_pipeline_layout *layout; + struct anv_pipeline_layout *layout = (struct anv_pipeline_layout *) _layout; struct anv_descriptor_set *set; struct anv_descriptor_set_layout *set_layout; assert(firstSet + setCount < MAX_SETS); - if (pipelineBindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS) - layout = cmd_buffer->pipeline->layout; - else - layout = cmd_buffer->compute_pipeline->layout; - uint32_t dynamic_slot = 0; for (uint32_t i = 0; i < setCount; i++) { set = (struct anv_descriptor_set *) pDescriptorSets[i]; diff --git a/src/vulkan/meta.c b/src/vulkan/meta.c index 7e22269e368..37c8421a46e 100644 --- a/src/vulkan/meta.c +++ b/src/vulkan/meta.c @@ -643,7 +643,8 @@ meta_emit_blit(struct anv_cmd_buffer *cmd_buffer, VK_STATE_BIND_POINT_VIEWPORT, fb->vp_state); anv_CmdBindDescriptorSets((VkCmdBuffer) cmd_buffer, - VK_PIPELINE_BIND_POINT_GRAPHICS, 0, 1, + VK_PIPELINE_BIND_POINT_GRAPHICS, + device->meta_state.blit.pipeline_layout, 0, 1, &set, 0, NULL); anv_CmdDraw((VkCmdBuffer) cmd_buffer, 0, 3, 0, 1);