vulkan: Remove VkDescriptorSetLayoutChain from vkCmdBindDescriptorSets
authorChia-I Wu <olv@lunarg.com>
Thu, 16 Apr 2015 18:00:54 +0000 (02:00 +0800)
committerTony Barbour <tony@LunarG.com>
Fri, 17 Apr 2015 01:35:00 +0000 (19:35 -0600)
This is part of r30446 on vulkan.h, discussed in bug 13632.

Meaty chunks of this commit done by Olv, basic hook up and testing by Cody.

demos/cube.c
demos/tri.c
icd/nulldrv/nulldrv.c
include/vulkan.h
layers/draw_state.cpp
layers/mem_tracker.cpp
layers/param_checker.cpp
layers/shader_checker.cpp
vulkan.py

index 5522c1f..71181e5 100644 (file)
@@ -430,7 +430,7 @@ static void demo_draw_build_cmd(struct demo *demo, VkCmdBuffer cmd_buf)
     vkCmdBindPipeline(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS,
                                   demo->pipeline);
     vkCmdBindDescriptorSets(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS,
-            demo->desc_layout_chain, 0, 1, &demo->desc_set, NULL);
+            0, 1, &demo->desc_set, NULL);
 
     vkCmdBindDynamicStateObject(cmd_buf, VK_STATE_BIND_POINT_VIEWPORT, demo->viewport);
     vkCmdBindDynamicStateObject(cmd_buf, VK_STATE_BIND_POINT_RASTER, demo->raster);
index bea3a7d..b799468 100644 (file)
@@ -259,7 +259,7 @@ static void demo_draw_build_cmd(struct demo *demo)
     vkCmdBindPipeline(demo->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
                                   demo->pipeline);
     vkCmdBindDescriptorSets(demo->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
-            demo->desc_layout_chain, 0, 1, & demo->desc_set, NULL);
+            0, 1, & demo->desc_set, NULL);
 
     vkCmdBindDynamicStateObject(demo->cmd, VK_STATE_BIND_POINT_VIEWPORT, demo->viewport);
     vkCmdBindDynamicStateObject(demo->cmd, VK_STATE_BIND_POINT_RASTER, demo->raster);
index 8c44cc3..8171604 100644 (file)
@@ -1060,7 +1060,6 @@ ICD_EXPORT void VKAPI vkCmdBindDynamicStateObject(
 ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
     VkCmdBuffer                              cmdBuffer,
     VkPipelineBindPoint                     pipelineBindPoint,
-    VkDescriptorSetLayoutChain             layoutChain,
     uint32_t                                    layoutChainSlot,
     uint32_t                                    count,
     const VkDescriptorSet*                   pDescriptorSets,
index 6a30234..d7748ce 100644 (file)
@@ -2145,7 +2145,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 state);
-typedef void     (VKAPI *PFN_vkCmdBindDescriptorSets)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkDescriptorSetLayoutChain layoutChain, uint32_t layoutChainSlot, uint32_t count, const VkDescriptorSet* pDescriptorSets, const uint32_t* pUserData);
+typedef void     (VKAPI *PFN_vkCmdBindDescriptorSets)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t layoutChainSlot, uint32_t count, const VkDescriptorSet* pDescriptorSets, const uint32_t* pUserData);
 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);
@@ -2640,7 +2640,6 @@ void VKAPI vkCmdBindDynamicStateObject(
 void VKAPI vkCmdBindDescriptorSets(
     VkCmdBuffer                                 cmdBuffer,
     VkPipelineBindPoint                         pipelineBindPoint,
-    VkDescriptorSetLayoutChain                  layoutChain,
     uint32_t                                    layoutChainSlot,
     uint32_t                                    count,
     const VkDescriptorSet*                      pDescriptorSets,
index 4d6620a..3510370 100644 (file)
@@ -1997,7 +1997,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicStateObject(VkCmdBuffer cmdBuffer, Vk
     nextTable.CmdBindDynamicStateObject(cmdBuffer, stateBindPoint, state);
 }
 
-VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkDescriptorSetLayoutChain layoutChain, uint32_t layoutChainSlot, uint32_t count, const VkDescriptorSet* pDescriptorSets, const uint32_t* pUserData)
+VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t layoutChainSlot, uint32_t count, const VkDescriptorSet* pDescriptorSets, const uint32_t* pUserData)
 {
     GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
     if (pCB) {
@@ -2034,7 +2034,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipe
         sprintf(str, "Attempt to use CmdBuffer %p that doesn't exist!", (void*)cmdBuffer);
         layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, cmdBuffer, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS", str);
     }
-    nextTable.CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layoutChain, layoutChainSlot, count, pDescriptorSets, pUserData);
+    nextTable.CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layoutChainSlot, count, pDescriptorSets, pUserData);
 }
 
 VK_LAYER_EXPORT void VKAPI vkCmdBindIndexBuffer(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType)
index 207b408..5884eda 100644 (file)
@@ -1606,14 +1606,13 @@ VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicStateObject(VkCmdBuffer cmdBuffer, Vk
 VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets(
     VkCmdBuffer                              cmdBuffer,
     VkPipelineBindPoint                     pipelineBindPoint,
-    VkDescriptorSetLayoutChain             layoutChain,
     uint32_t                                    layoutChainSlot,
     uint32_t                                    count,
     const VkDescriptorSet*                   pDescriptorSets,
     const uint32_t*                             pUserData)
 {
     // TODO : Somewhere need to verify that all textures referenced by shaders in DS are in some type of *SHADER_READ* state
-    nextTable.CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layoutChain, layoutChainSlot, count, pDescriptorSets, pUserData);
+    nextTable.CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layoutChainSlot, count, pDescriptorSets, pUserData);
 }
 
 VK_LAYER_EXPORT void VKAPI vkCmdBindVertexBuffers(
index 5635bfd..da93382 100644 (file)
@@ -1204,14 +1204,14 @@ VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicStateObject(VkCmdBuffer cmdBuffer, Vk
     nextTable.CmdBindDynamicStateObject(cmdBuffer, stateBindPoint, state);
 }
 
-VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkDescriptorSetLayoutChain layoutChain, uint32_t layoutChainSlot, uint32_t count, const VkDescriptorSet* pDescriptorSets, const uint32_t* pUserData)
+VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t layoutChainSlot, uint32_t count, const VkDescriptorSet* pDescriptorSets, const uint32_t* pUserData)
 {
     char str[1024];
     if (!validate_VkPipelineBindPoint(pipelineBindPoint)) {
         sprintf(str, "Parameter pipelineBindPoint to function CmdBindDescriptorSets has invalid value of %i.", (int)pipelineBindPoint);
         layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
     }
-    nextTable.CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layoutChain, layoutChainSlot, count, pDescriptorSets, pUserData);
+    nextTable.CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layoutChainSlot, count, pDescriptorSets, pUserData);
 }
 
 VK_LAYER_EXPORT void VKAPI vkCmdBindVertexBuffers(
index bffcf20..1cc72ee 100644 (file)
@@ -143,13 +143,13 @@ static VkLayerDispatchTable * initLayerTable(const VkBaseLayerObject *gpuw)
         return it->second;
     }
 
-    layer_initialize_dispatch_table(pTable, gpuw->pGPA, (VkPhysicalGpu) gpuw->nextObject);
+    layer_initialize_dispatch_table(pTable, gpuw->pGPA, (VkPhysicalDevice) gpuw->nextObject);
 
     return pTable;
 }
 
 
-VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalGpu gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice)
+VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice)
 {
     VkLayerDispatchTable* pTable = tableMap[gpu];
     VkResult result = pTable->CreateDevice(gpu, pCreateInfo, pDevice);
@@ -161,7 +161,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalGpu gpu, const VkDeviceC
 }
 
 
-VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
+VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
 {
     if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pOutLayers[1] == NULL || pReserved == NULL)
         return VK_ERROR_INVALID_POINTER;
@@ -539,41 +539,41 @@ enum FORMAT_TYPE {
 static unsigned
 get_format_type(VkFormat fmt) {
     switch (fmt) {
-    case VK_FMT_UNDEFINED:
+    case VK_FORMAT_UNDEFINED:
         return FORMAT_TYPE_UNDEFINED;
-    case VK_FMT_R8_SINT:
-    case VK_FMT_R8G8_SINT:
-    case VK_FMT_R8G8B8_SINT:
-    case VK_FMT_R8G8B8A8_SINT:
-    case VK_FMT_R16_SINT:
-    case VK_FMT_R16G16_SINT:
-    case VK_FMT_R16G16B16_SINT:
-    case VK_FMT_R16G16B16A16_SINT:
-    case VK_FMT_R32_SINT:
-    case VK_FMT_R32G32_SINT:
-    case VK_FMT_R32G32B32_SINT:
-    case VK_FMT_R32G32B32A32_SINT:
-    case VK_FMT_B8G8R8_SINT:
-    case VK_FMT_B8G8R8A8_SINT:
-    case VK_FMT_R10G10B10A2_SINT:
-    case VK_FMT_B10G10R10A2_SINT:
+    case VK_FORMAT_R8_SINT:
+    case VK_FORMAT_R8G8_SINT:
+    case VK_FORMAT_R8G8B8_SINT:
+    case VK_FORMAT_R8G8B8A8_SINT:
+    case VK_FORMAT_R16_SINT:
+    case VK_FORMAT_R16G16_SINT:
+    case VK_FORMAT_R16G16B16_SINT:
+    case VK_FORMAT_R16G16B16A16_SINT:
+    case VK_FORMAT_R32_SINT:
+    case VK_FORMAT_R32G32_SINT:
+    case VK_FORMAT_R32G32B32_SINT:
+    case VK_FORMAT_R32G32B32A32_SINT:
+    case VK_FORMAT_B8G8R8_SINT:
+    case VK_FORMAT_B8G8R8A8_SINT:
+    case VK_FORMAT_R10G10B10A2_SINT:
+    case VK_FORMAT_B10G10R10A2_SINT:
         return FORMAT_TYPE_SINT;
-    case VK_FMT_R8_UINT:
-    case VK_FMT_R8G8_UINT:
-    case VK_FMT_R8G8B8_UINT:
-    case VK_FMT_R8G8B8A8_UINT:
-    case VK_FMT_R16_UINT:
-    case VK_FMT_R16G16_UINT:
-    case VK_FMT_R16G16B16_UINT:
-    case VK_FMT_R16G16B16A16_UINT:
-    case VK_FMT_R32_UINT:
-    case VK_FMT_R32G32_UINT:
-    case VK_FMT_R32G32B32_UINT:
-    case VK_FMT_R32G32B32A32_UINT:
-    case VK_FMT_B8G8R8_UINT:
-    case VK_FMT_B8G8R8A8_UINT:
-    case VK_FMT_R10G10B10A2_UINT:
-    case VK_FMT_B10G10R10A2_UINT:
+    case VK_FORMAT_R8_UINT:
+    case VK_FORMAT_R8G8_UINT:
+    case VK_FORMAT_R8G8B8_UINT:
+    case VK_FORMAT_R8G8B8A8_UINT:
+    case VK_FORMAT_R16_UINT:
+    case VK_FORMAT_R16G16_UINT:
+    case VK_FORMAT_R16G16B16_UINT:
+    case VK_FORMAT_R16G16B16A16_UINT:
+    case VK_FORMAT_R32_UINT:
+    case VK_FORMAT_R32G32_UINT:
+    case VK_FORMAT_R32G32B32_UINT:
+    case VK_FORMAT_R32G32B32A32_UINT:
+    case VK_FORMAT_B8G8R8_UINT:
+    case VK_FORMAT_B8G8R8A8_UINT:
+    case VK_FORMAT_R10G10B10A2_UINT:
+    case VK_FORMAT_B10G10R10A2_UINT:
         return FORMAT_TYPE_UINT;
     default:
         return FORMAT_TYPE_FLOAT;
@@ -744,7 +744,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(VkDevice device,
 }
 
 
-VK_LAYER_EXPORT void * VKAPI vkGetProcAddr(VkPhysicalGpu gpu, const char* pName)
+VK_LAYER_EXPORT void * VKAPI vkGetProcAddr(VkPhysicalDevice gpu, const char* pName)
 {
     if (gpu == NULL)
         return NULL;
@@ -766,5 +766,5 @@ VK_LAYER_EXPORT void * VKAPI vkGetProcAddr(VkPhysicalGpu gpu, const char* pName)
     VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu;
     if (gpuw->pGPA == NULL)
         return NULL;
-    return gpuw->pGPA((VkPhysicalGpu) gpuw->nextObject, pName);
+    return gpuw->pGPA((VkPhysicalDevice) gpuw->nextObject, pName);
 }
index 18b6793..6f14c28 100755 (executable)
--- a/vulkan.py
+++ b/vulkan.py
@@ -625,7 +625,6 @@ core = Extension(
         Proto("void", "CmdBindDescriptorSets",
             [Param("VkCmdBuffer", "cmdBuffer"),
              Param("VkPipelineBindPoint", "pipelineBindPoint"),
-             Param("VkDescriptorSetLayoutChain", "layoutChain"),
              Param("uint32_t", "layoutChainSlot"),
              Param("uint32_t", "count"),
              Param("const VkDescriptorSet*", "pDescriptorSets"),