Bug 14643: use VkClearDepthStencilValue
authorCourtney Goeltzenleuchter <courtney@LunarG.com>
Wed, 16 Sep 2015 00:03:22 +0000 (18:03 -0600)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 17 Sep 2015 21:32:11 +0000 (15:32 -0600)
icd/nulldrv/nulldrv.c
include/vulkan.h
layers/draw_state.cpp
layers/mem_tracker.cpp
layers/param_checker.cpp
loader/trampoline.c
vulkan.py

index 68014411831a3b466799a6b3b5f08dd42e95bbfa..bb67967b22c4ec3e3b7dcfe671947c7821134078 100644 (file)
@@ -1056,13 +1056,12 @@ ICD_EXPORT void VKAPI vkCmdFillBuffer(
 }
 
 ICD_EXPORT void VKAPI vkCmdClearDepthStencilImage(
-    VkCmdBuffer                              cmdBuffer,
-    VkImage                                   image,
-    VkImageLayout                            imageLayout,
-    float                                       depth,
-    uint32_t                                    stencil,
+    VkCmdBuffer                                 cmdBuffer,
+    VkImage                                     image,
+    VkImageLayout                               imageLayout,
+    const VkClearDepthStencilValue*             pDepthStencil,
     uint32_t                                    rangeCount,
-    const VkImageSubresourceRange*          pRanges)
+    const VkImageSubresourceRange*              pRanges)
 {
     NULLDRV_LOG_FUNC;
 }
@@ -1082,8 +1081,7 @@ ICD_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(
     VkCmdBuffer                             cmdBuffer,
     VkImageAspectFlags                      imageAspectMask,
     VkImageLayout                           imageLayout,
-    float                                   depth,
-    uint32_t                                stencil,
+    const VkClearDepthStencilValue*         pDepthStencil,
     uint32_t                                rectCount,
     const VkRect3D                         *pRects)
 {
index 89c93a26632e0f954b314af05041b2fc1a47308d..b8c75853a95254793f71b82908dd70112c426201 100644 (file)
@@ -2005,6 +2005,11 @@ typedef union {
     uint32_t                                    uint32[4];
 } VkClearColorValue;
 
+typedef struct {
+    float                                       depth;
+    uint32_t                                    stencil;
+} VkClearDepthStencilValue;
+
 typedef struct {
     VkOffset3D                                  offset;
     VkExtent3D                                  extent;
@@ -2018,11 +2023,6 @@ typedef struct {
     VkExtent3D                                  extent;
 } VkImageResolve;
 
-typedef struct {
-    float                                       depth;
-    uint32_t                                    stencil;
-} VkClearDepthStencilValue;
-
 typedef union {
     VkClearColorValue                           color;
     VkClearDepthStencilValue                    depthStencil;
@@ -2228,9 +2228,9 @@ typedef void (VKAPI *PFN_vkCmdCopyImageToBuffer)(VkCmdBuffer cmdBuffer, VkImage
 typedef void (VKAPI *PFN_vkCmdUpdateBuffer)(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData);
 typedef void (VKAPI *PFN_vkCmdFillBuffer)(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data);
 typedef void (VKAPI *PFN_vkCmdClearColorImage)(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
-typedef void (VKAPI *PFN_vkCmdClearDepthStencilImage)(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
+typedef void (VKAPI *PFN_vkCmdClearDepthStencilImage)(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
 typedef void (VKAPI *PFN_vkCmdClearColorAttachment)(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects);
-typedef void (VKAPI *PFN_vkCmdClearDepthStencilAttachment)(VkCmdBuffer cmdBuffer, VkImageAspectFlags aspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects);
+typedef void (VKAPI *PFN_vkCmdClearDepthStencilAttachment)(VkCmdBuffer cmdBuffer, VkImageAspectFlags aspectMask, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rectCount, const VkRect3D* pRects);
 typedef void (VKAPI *PFN_vkCmdResolveImage)(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions);
 typedef void (VKAPI *PFN_vkCmdSetEvent)(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask);
 typedef void (VKAPI *PFN_vkCmdResetEvent)(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask);
@@ -2955,8 +2955,7 @@ void VKAPI vkCmdClearDepthStencilImage(
     VkCmdBuffer                                 cmdBuffer,
     VkImage                                     image,
     VkImageLayout                               imageLayout,
-    float                                       depth,
-    uint32_t                                    stencil,
+    const VkClearDepthStencilValue*             pDepthStencil,
     uint32_t                                    rangeCount,
     const VkImageSubresourceRange*              pRanges);
 
@@ -2972,8 +2971,7 @@ void VKAPI vkCmdClearDepthStencilAttachment(
     VkCmdBuffer                                 cmdBuffer,
     VkImageAspectFlags                          aspectMask,
     VkImageLayout                               imageLayout,
-    float                                       depth,
-    uint32_t                                    stencil,
+    const VkClearDepthStencilValue*             pDepthStencil,
     uint32_t                                    rectCount,
     const VkRect3D*                             pRects);
 
index a831869a7e9dc3ce810b4f88d67114a45d1d51cc..172260eb7be85529dae02f3bf4115b15f7e105fc 100644 (file)
@@ -2715,8 +2715,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(
     VkCmdBuffer                                 cmdBuffer,
     VkImageAspectFlags                          imageAspectMask,
     VkImageLayout                               imageLayout,
-    float                                       depth,
-    uint32_t                                    stencil,
+    const VkClearDepthStencilValue*             pDepthStencil,
     uint32_t                                    rectCount,
     const VkRect3D*                             pRects)
 {
@@ -2744,7 +2743,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(
         }
     }
     if (VK_FALSE == skipCall)
-        get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects);
+        get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
 }
 
 VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage(
@@ -2773,10 +2772,12 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage(
         get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges);
 }
 
-VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(VkCmdBuffer cmdBuffer,
-                                                     VkImage image, VkImageLayout imageLayout,
-                                                     float depth, uint32_t stencil,
-                                                     uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
+VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(
+        VkCmdBuffer cmdBuffer,
+        VkImage image, VkImageLayout imageLayout,
+        const VkClearDepthStencilValue *pDepthStencil,
+        uint32_t rangeCount,
+        const VkImageSubresourceRange* pRanges)
 {
     VkBool32 skipCall = VK_FALSE;
     GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
@@ -2795,7 +2796,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(VkCmdBuffer cmdBuffer,
         }
     }
     if (VK_FALSE == skipCall)
-        get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
+        get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
 }
 
 VK_LAYER_EXPORT void VKAPI vkCmdResolveImage(VkCmdBuffer cmdBuffer,
index 0b2d7a61251a45fcfd20d643b84bfa186a0c63d8..29b10d44728447cd4640f6e86f5e15f1b65197cf 100644 (file)
@@ -2903,13 +2903,12 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage(
 }
 
 VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(
-    VkCmdBuffer                    cmdBuffer,
-    VkImage                        image,
-    VkImageLayout                  imageLayout,
-    float                          depth,
-    uint32_t                       stencil,
-    uint32_t                       rangeCount,
-    const VkImageSubresourceRange *pRanges)
+    VkCmdBuffer                         cmdBuffer,
+    VkImage                             image,
+    VkImageLayout                       imageLayout,
+    const VkClearDepthStencilValue*     pDepthStencil,
+    uint32_t                            rangeCount,
+    const VkImageSubresourceRange*      pRanges)
 {
     // TODO : Verify memory is in VK_IMAGE_STATE_CLEAR state
     VkDeviceMemory mem;
@@ -2920,7 +2919,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(
     loader_platform_thread_unlock_mutex(&globalLock);
     if (VK_FALSE == skipCall) {
         get_dispatch_table(mem_tracker_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(
-            cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
+            cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
     }
 }
 
index c93f4875966dc9c2f702fa4864a079d846af6105..ea31546c017089047be81f05fddfe4cd32c15ff2 100644 (file)
@@ -6655,8 +6655,7 @@ bool PostCmdClearDepthStencilImage(
     VkCmdBuffer cmdBuffer,
     VkImage image,
     VkImageLayout imageLayout,
-    float depth,
-    uint32_t stencil,
+    const VkClearDepthStencilValue* pDepthStencil,
     uint32_t rangeCount)
 {
 
@@ -6679,16 +6678,15 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(
     VkCmdBuffer cmdBuffer,
     VkImage image,
     VkImageLayout imageLayout,
-    float depth,
-    uint32_t stencil,
+    const VkClearDepthStencilValue* pDepthStencil,
     uint32_t rangeCount,
     const VkImageSubresourceRange* pRanges)
 {
     PreCmdClearDepthStencilImage(cmdBuffer, pRanges);
 
-    get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
+    get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
 
-    PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount);
+    PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount);
 }
 
 bool PreCmdClearColorAttachment(
@@ -6757,8 +6755,7 @@ bool PostCmdClearDepthStencilAttachment(
     VkCmdBuffer cmdBuffer,
     VkImageAspectFlags imageAspectMask,
     VkImageLayout imageLayout,
-    float depth,
-    uint32_t stencil,
+    const VkClearDepthStencilValue* pDepthStencil,
     uint32_t rectCount)
 {
 
@@ -6781,16 +6778,15 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(
     VkCmdBuffer cmdBuffer,
     VkImageAspectFlags imageAspectMask,
     VkImageLayout imageLayout,
-    float depth,
-    uint32_t stencil,
+    const VkClearDepthStencilValue* pDepthStencil,
     uint32_t rectCount,
     const VkRect3D* pRects)
 {
     PreCmdClearDepthStencilAttachment(cmdBuffer, pRects);
 
-    get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects);
+    get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
 
-    PostCmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount);
+    PostCmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount);
 }
 
 bool PreCmdResolveImage(
index b1a8390bbcd3c905472b5e4419d08a042881febe..b24e82256c15ad1f4f49a85ddc47f9641648f05e 100644 (file)
@@ -1427,13 +1427,13 @@ LOADER_EXPORT void VKAPI vkCmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage ima
     disp->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges);
 }
 
-LOADER_EXPORT void VKAPI vkCmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
+LOADER_EXPORT void VKAPI vkCmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
 {
     const VkLayerDispatchTable *disp;
 
     disp = loader_get_dispatch(cmdBuffer);
 
-    disp->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
+    disp->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
 }
 
 LOADER_EXPORT void VKAPI vkCmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects)
@@ -1445,13 +1445,13 @@ LOADER_EXPORT void VKAPI vkCmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32
     disp->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects);
 }
 
-LOADER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects)
+LOADER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, const VkClearDepthStencilValue *pDepthStencil, uint32_t rectCount, const VkRect3D* pRects)
 {
     const VkLayerDispatchTable *disp;
 
     disp = loader_get_dispatch(cmdBuffer);
 
-    disp->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects);
+    disp->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
 }
 
 LOADER_EXPORT void VKAPI vkCmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions)
index 5d8601de4aa3ecebd4012493938111a0db6b134b..d6479892529f2647174ee239f2c04dec051eff55 100755 (executable)
--- a/vulkan.py
+++ b/vulkan.py
@@ -901,8 +901,7 @@ core = Extension(
             [Param("VkCmdBuffer", "cmdBuffer"),
              Param("VkImage", "image"),
              Param("VkImageLayout", "imageLayout"),
-             Param("float", "depth"),
-             Param("uint32_t", "stencil"),
+             Param("const VkClearDepthStencilValue*", "pDepthStencil"),
              Param("uint32_t", "rangeCount"),
              Param("const VkImageSubresourceRange*", "pRanges")]),
 
@@ -918,8 +917,7 @@ core = Extension(
             [Param("VkCmdBuffer", "cmdBuffer"),
              Param("VkImageAspectFlags", "imageAspectMask"),
              Param("VkImageLayout", "imageLayout"),
-             Param("float", "depth"),
-             Param("uint32_t", "stencil"),
+             Param("const VkClearDepthStencilValue*", "pDepthStencil"),
              Param("uint32_t", "rectCount"),
              Param("const VkRect3D*", "pRects")]),