vk/vulkan.h: Add a PipelineLayout parameter to BindDescriptorSets
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 8 Jul 2015 00:06:10 +0000 (17:06 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 8 Jul 2015 00:06:10 +0000 (17:06 -0700)
include/vulkan/vulkan.h
src/vulkan/device.c
src/vulkan/meta.c

index 80edb316cc7bba223c4b7e3c4e3062934ade8d03..856dbe499df930a18332922a96e4a424b3f069aa 100644 (file)
@@ -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,
index 69fd335634b62c975961abf53c570769ae7a58ce..a43bd04b645a0350eafb3c970b9f950a20b34d9e 100644 (file)
@@ -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];
index 7e22269e36898a53f3ca687160bc4e82fdb1e567..37c8421a46eff4aaaea2c6f87022fe778445d6a5 100644 (file)
@@ -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);