vulkan.h: Split attachment and image clears (#13914, v126)
authorChris Forbes <chrisf@ijw.co.nz>
Mon, 22 Jun 2015 05:21:59 +0000 (17:21 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Tue, 7 Jul 2015 02:54:05 +0000 (14:54 +1200)
- Add bit flags for image aspects.
- Replace VkRect with VkRect2D and VkRect3D.
- Rename vkCmdClearDepthStencil to vkCmdClearDepthStencilImage
- Add vkCmdClearColorAttachment and vkCmdClearDepthStencilAttachment

Remaining to be done:
- Actually implement vkCmdClearColorAttachment,
  vkCmdClearDepthStencilAttachment in the Intel ICD
- Enforce renderpass interactions: CmdClear*Attachment may only be
  called within a renderpass; CmdClear*Image may only be called outside
  a renderpass.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
demos/cube.c
demos/tri.c
include/vkLayer.h
include/vulkan.h
layers/draw_state.cpp
layers/mem_tracker.cpp
layers/param_checker.cpp
loader/gpa_helper.h
loader/table_ops.h
loader/trampoline.c
vulkan.py

index a346400849e0c76ece677981aaaaf3c420342ae5..5eca29e9226abbf61b2de2d73a3fda35529af019 100644 (file)
@@ -556,7 +556,7 @@ static void demo_draw_build_cmd(struct demo *demo, VkCmdBuffer cmd_buf)
     clear_range.baseArraySlice = 0;
     clear_range.arraySize = 1;
 
-    vkCmdClearDepthStencil(cmd_buf, demo->depth.image,
+    vkCmdClearDepthStencilImage(cmd_buf, demo->depth.image,
             VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
             clear_depth, 0, 1, &clear_range);
 
@@ -1490,7 +1490,7 @@ static void demo_prepare_dynamic_states(struct demo *demo)
     viewport.minDepth = (float) 0.0f;
     viewport.maxDepth = (float) 1.0f;
     viewport_create.pViewports = &viewport;
-    VkRect scissor;
+    VkRect2D scissor;
     memset(&scissor, 0, sizeof(scissor));
     scissor.extent.width = demo->width;
     scissor.extent.height = demo->height;
index 6dafe64ac767df5df9465a49dd5fd6c1e641a3db..7ebc490c1b18721d5c001c979edfe26038708b3a 100644 (file)
@@ -370,7 +370,7 @@ static void demo_draw_build_cmd(struct demo *demo)
             &clear_color, 1, &clear_range);
 
     clear_range.aspect = VK_IMAGE_ASPECT_DEPTH;
-    vkCmdClearDepthStencil(demo->draw_cmd,
+    vkCmdClearDepthStencilImage(demo->draw_cmd,
             demo->depth.image, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
             clear_depth, 0, 1, &clear_range);
 
@@ -1107,7 +1107,7 @@ static void demo_prepare_dynamic_states(struct demo *demo)
     viewport.minDepth = (float) 0.0f;
     viewport.maxDepth = (float) 1.0f;
     viewport_create.pViewports = &viewport;
-    VkRect scissor;
+    VkRect2D scissor;
     memset(&scissor, 0, sizeof(scissor));
     scissor.extent.width = demo->width;
     scissor.extent.height = demo->height;
index 64673545ae4de9d8330f55979fa31ddfd8e93dfd..85c41d6e53d4ed4a18fab39ac1f99d8bdd54f611 100644 (file)
@@ -107,7 +107,9 @@ typedef struct VkLayerDispatchTable_
     PFN_vkCmdUpdateBuffer CmdUpdateBuffer;
     PFN_vkCmdFillBuffer CmdFillBuffer;
     PFN_vkCmdClearColorImage CmdClearColorImage;
-    PFN_vkCmdClearDepthStencil CmdClearDepthStencil;
+    PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage;
+    PFN_vkCmdClearColorAttachment CmdClearColorAttachment;
+    PFN_vkCmdClearDepthStencilAttachment CmdClearDepthStencilAttachment;
     PFN_vkCmdResolveImage CmdResolveImage;
     PFN_vkCmdSetEvent CmdSetEvent;
     PFN_vkCmdResetEvent CmdResetEvent;
index 1517d4c819c447cb2c102c68c761387f8a4356b3..b023b69c7b1459b345869a491500b98e97f16aa9 100644 (file)
@@ -1073,6 +1073,15 @@ typedef enum {
 
 typedef VkFlags VkPipelineStageFlags;
 
+// Image aspect flags
+typedef VkFlags VkImageAspectFlags;
+typedef enum VkImageAspectFlagBits_
+{
+    VK_IMAGE_ASPECT_COLOR_BIT                               = VK_BIT(0),
+    VK_IMAGE_ASPECT_DEPTH_BIT                               = VK_BIT(1),
+    VK_IMAGE_ASPECT_STENCIL_BIT                             = VK_BIT(2),
+} VkImageAspectFlagBits;
+
 // Query control flags
 typedef VkFlags VkQueryControlFlags;
 typedef enum VkQueryControlFlagBits_
@@ -1179,11 +1188,17 @@ typedef struct VkViewport_
     float                                       maxDepth;
 } VkViewport;
 
-typedef struct VkRect_
+typedef struct VkRect2D_
 {
     VkOffset2D                                  offset;
     VkExtent2D                                  extent;
-} VkRect;
+} VkRect2D;
+
+typedef struct VkRect3D_
+{
+    VkOffset3D                                  offset;
+    VkExtent3D                                  extent;
+} VkRect3D;
 
 typedef struct VkChannelMapping_
 {
@@ -1975,7 +1990,7 @@ typedef struct VkDynamicVpStateCreateInfo_
     const void*                                 pNext;      // Pointer to next structure
     uint32_t                                    viewportAndScissorCount;  // number of entries in pViewports and pScissors
     const VkViewport*                           pViewports;
-    const VkRect*                               pScissors;
+    const VkRect2D*                             pScissors;
 } VkDynamicVpStateCreateInfo;
 
 typedef struct VkDynamicRsStateCreateInfo_
@@ -2052,7 +2067,7 @@ typedef struct VkRenderPassCreateInfo_
     VkStructureType                             sType;      // Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
     const void*                                 pNext;      // Pointer to next structure
 
-    VkRect                                      renderArea;
+    VkRect2D                                    renderArea;
     uint32_t                                    colorAttachmentCount;
     VkExtent2D                                  extent;
     uint32_t                                    sampleCount;
@@ -2239,7 +2254,9 @@ typedef void     (VKAPI *PFN_vkCmdCopyImageToBuffer)(VkCmdBuffer cmdBuffer, VkIm
 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 VkClearColor* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
-typedef void     (VKAPI *PFN_vkCmdClearDepthStencil)(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, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
+typedef void     (VKAPI *PFN_vkCmdClearColorAttachment)(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColor* pColor, uint32_t rectCount, const VkRect3D* pRects);
+typedef void     (VKAPI *PFN_vkCmdClearDepthStencilAttachment)(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, 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);
@@ -2823,7 +2840,7 @@ void VKAPI vkCmdClearColorImage(
     uint32_t                                    rangeCount,
     const VkImageSubresourceRange*              pRanges);
 
-void VKAPI vkCmdClearDepthStencil(
+void VKAPI vkCmdClearDepthStencilImage(
     VkCmdBuffer                                 cmdBuffer,
     VkImage                                     image,
     VkImageLayout                               imageLayout,
@@ -2832,6 +2849,23 @@ void VKAPI vkCmdClearDepthStencil(
     uint32_t                                    rangeCount,
     const VkImageSubresourceRange*              pRanges);
 
+void VKAPI vkCmdClearColorAttachment(
+    VkCmdBuffer                                 cmdBuffer,
+    uint32_t                                    colorAttachment,
+    VkImageLayout                               imageLayout,
+    const VkClearColor*                         pColor,
+    uint32_t                                    rectCount,
+    const VkRect3D*                             pRects);
+
+void VKAPI vkCmdClearDepthStencilAttachment(
+    VkCmdBuffer                                 cmdBuffer,
+    VkImageAspectFlags                          imageAspectMask,
+    VkImageLayout                               imageLayout,
+    float                                       depth,
+    uint32_t                                    stencil,
+    uint32_t                                    rectCount,
+    const VkRect3D*                             pRects);
+
 void VKAPI vkCmdResolveImage(
     VkCmdBuffer                                 cmdBuffer,
     VkImage                                     srcImage,
index b99a5b1957accf52a285e0923ecc9a3d1b57c0c4..3da7d54cbbb152e5b213868c8d30da67e6930877 100644 (file)
@@ -249,9 +249,9 @@ static void insertDynamicState(const VkDynamicStateObject state, const GENERIC_H
         case VK_STRUCTURE_TYPE_DYNAMIC_VP_STATE_CREATE_INFO:
             memcpy(&pStateNode->create_info, pCreateInfo, sizeof(VkDynamicVpStateCreateInfo));
             pVPCI = (VkDynamicVpStateCreateInfo*)pCreateInfo;
-            pStateNode->create_info.vpci.pScissors = new VkRect[pStateNode->create_info.vpci.viewportAndScissorCount];
+            pStateNode->create_info.vpci.pScissors = new VkRect2D[pStateNode->create_info.vpci.viewportAndScissorCount];
             pStateNode->create_info.vpci.pViewports = new VkViewport[pStateNode->create_info.vpci.viewportAndScissorCount];
-            scSize = pVPCI->viewportAndScissorCount * sizeof(VkRect);
+            scSize = pVPCI->viewportAndScissorCount * sizeof(VkRect2D);
             vpSize = pVPCI->viewportAndScissorCount * sizeof(VkViewport);
             memcpy((void*)pStateNode->create_info.vpci.pScissors, pVPCI->pScissors, scSize);
             memcpy((void*)pStateNode->create_info.vpci.pViewports, pVPCI->pViewports, vpSize);
@@ -2497,7 +2497,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage(
     }
 }
 
-VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencil(VkCmdBuffer cmdBuffer,
+VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(VkCmdBuffer cmdBuffer,
                                                      VkImage image, VkImageLayout imageLayout,
                                                      float depth, uint32_t stencil,
                                                      uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
@@ -2507,7 +2507,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencil(VkCmdBuffer cmdBuffer,
         if (pCB->state == CB_UPDATE_ACTIVE) {
             updateCBTracking(cmdBuffer);
             addCmd(pCB, CMD_CLEARDEPTHSTENCIL);
-            get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearDepthStencil(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
+            get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
         } else {
             report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
         }
@@ -2956,8 +2956,8 @@ VK_LAYER_EXPORT void* VKAPI vkGetDeviceProcAddr(VkDevice dev, const char* funcNa
         return (void*) vkCmdFillBuffer;
     if (!strcmp(funcName, "vkCmdClearColorImage"))
         return (void*) vkCmdClearColorImage;
-    if (!strcmp(funcName, "vkCmdClearDepthStencil"))
-        return (void*) vkCmdClearDepthStencil;
+    if (!strcmp(funcName, "vkCmdClearDepthStencilImage"))
+        return (void*) vkCmdClearDepthStencilImage;
     if (!strcmp(funcName, "vkCmdResolveImage"))
         return (void*) vkCmdResolveImage;
     if (!strcmp(funcName, "vkCmdSetEvent"))
index 6b5ead3a2f2eb579ab0282924f6c6ed68c0478fc..0411ca1064a4389f70c23c3f7e47f05c5f56ce34 100644 (file)
@@ -1938,7 +1938,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage(
     get_dispatch_table(mem_tracker_device_table_map, cmdBuffer)->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges);
 }
 
-VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencil(
+VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(
     VkCmdBuffer                    cmdBuffer,
     VkImage                        image,
     VkImageLayout                  imageLayout,
@@ -1952,10 +1952,10 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencil(
     VkDeviceMemory mem = get_mem_binding_from_object(cmdBuffer, image);
     if (VK_FALSE == update_cmd_buf_and_mem_references(cmdBuffer, mem)) {
         log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, cmdBuffer, 0, MEMTRACK_MEMORY_BINDING_ERROR, "MEM",
-                "In vkCmdClearDepthStencil() call unable to update binding of image buffer %p to cmdBuffer %p", image, cmdBuffer);
+                "In vkCmdClearDepthStencilImage() call unable to update binding of image buffer %p to cmdBuffer %p", image, cmdBuffer);
     }
     loader_platform_thread_unlock_mutex(&globalLock);
-    get_dispatch_table(mem_tracker_device_table_map, cmdBuffer)->CmdClearDepthStencil(
+    get_dispatch_table(mem_tracker_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(
         cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
 }
 
@@ -2267,8 +2267,8 @@ VK_LAYER_EXPORT void* VKAPI vkGetDeviceProcAddr(
         return (void*) vkCmdFillBuffer;
     if (!strcmp(funcName, "vkCmdClearColorImage"))
         return (void*) vkCmdClearColorImage;
-    if (!strcmp(funcName, "vkCmdClearDepthStencil"))
-        return (void*) vkCmdClearDepthStencil;
+    if (!strcmp(funcName, "vkCmdClearDepthStencilImage"))
+        return (void*) vkCmdClearDepthStencilImage;
     if (!strcmp(funcName, "vkCmdResolveImage"))
         return (void*) vkCmdResolveImage;
     if (!strcmp(funcName, "vkCmdBeginQuery"))
index 9b9252669d2966dfd44b42ae7fec9cb7f7edb063..643399a4680184095958c066ce84cc036f5b4e02 100644 (file)
@@ -8491,7 +8491,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage(
     PostCmdClearColorImage(cmdBuffer, image, imageLayout, rangeCount);
 }
 
-void PreCmdClearDepthStencil(
+void PreCmdClearDepthStencilImage(
     VkCmdBuffer cmdBuffer,
     const VkImageSubresourceRange* pRanges)
 {
@@ -8517,7 +8517,7 @@ void PreCmdClearDepthStencil(
     }
 }
 
-void PostCmdClearDepthStencil(
+void PostCmdClearDepthStencilImage(
     VkCmdBuffer cmdBuffer,
     VkImage image,
     VkImageLayout imageLayout,
@@ -8551,7 +8551,7 @@ void PostCmdClearDepthStencil(
 
 }
 
-VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencil(
+VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(
     VkCmdBuffer cmdBuffer,
     VkImage image,
     VkImageLayout imageLayout,
@@ -8560,10 +8560,10 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencil(
     uint32_t rangeCount,
     const VkImageSubresourceRange* pRanges)
 {
-    PreCmdClearDepthStencil(cmdBuffer, pRanges);
-    get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencil(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
+    PreCmdClearDepthStencilImage(cmdBuffer, pRanges);
+    get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
 
-    PostCmdClearDepthStencil(cmdBuffer, image, imageLayout, depth, stencil, rangeCount);
+    PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount);
 }
 
 void PreCmdResolveImage(
@@ -8991,8 +8991,6 @@ void PostCmdResetQueryPool(
         "vkCmdResetQueryPool parameter, VkQueryPool queryPool, is null pointer");
         return;
     }
-
-
 }
 
 VK_LAYER_EXPORT void VKAPI vkCmdResetQueryPool(
@@ -9688,8 +9686,8 @@ VK_LAYER_EXPORT void* VKAPI vkGetDeviceProcAddr(VkDevice device, const char* fun
         return (void*) vkCmdFillBuffer;
     if (!strcmp(funcName, "vkCmdClearColorImage"))
         return (void*) vkCmdClearColorImage;
-    if (!strcmp(funcName, "vkCmdClearDepthStencil"))
-        return (void*) vkCmdClearDepthStencil;
+    if (!strcmp(funcName, "vkCmdClearDepthStencilImage"))
+        return (void*) vkCmdClearDepthStencilImage;
     if (!strcmp(funcName, "vkCmdResolveImage"))
         return (void*) vkCmdResolveImage;
     if (!strcmp(funcName, "vkCmdSetEvent"))
index 1ead95c7923ed73339d60473d609d24b0b6e448c..26eefc6e81d7b564abfa3803a73c3fb80447d553 100644 (file)
@@ -223,8 +223,12 @@ static inline void* globalGetProcAddr(const char *name)
         return (void*) vkCmdFillBuffer;
     if (!strcmp(name, "CmdClearColorImage"))
         return (void*) vkCmdClearColorImage;
-    if (!strcmp(name, "CmdClearDepthStencil"))
-        return (void*) vkCmdClearDepthStencil;
+    if (!strcmp(name, "CmdClearDepthStencilImage"))
+        return (void*) vkCmdClearDepthStencilImage;
+    if (!strcmp(name, "CmdClearColorAttachment"))
+        return (void*) vkCmdClearColorAttachment;
+    if (!strcmp(name, "CmdClearDepthStencilAttachment"))
+        return (void*) vkCmdClearDepthStencilAttachment;
     if (!strcmp(name, "CmdResolveImage"))
         return (void*) vkCmdResolveImage;
     if (!strcmp(name, "CmdSetEvent"))
index 52cb9c124a2c2f503b9d987759f23cc1e82799ac..39370f367180d9dcb2247343b0145acc20dafa38 100644 (file)
@@ -116,7 +116,9 @@ static inline void loader_init_device_dispatch_table(VkLayerDispatchTable *table
     table->CmdUpdateBuffer = (PFN_vkCmdUpdateBuffer) gpa(dev, "vkCmdUpdateBuffer");
     table->CmdFillBuffer = (PFN_vkCmdFillBuffer) gpa(dev, "vkCmdFillBuffer");
     table->CmdClearColorImage = (PFN_vkCmdClearColorImage) gpa(dev, "vkCmdClearColorImage");
-    table->CmdClearDepthStencil = (PFN_vkCmdClearDepthStencil) gpa(dev, "vkCmdClearDepthStencil");
+    table->CmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage) gpa(dev, "vkCmdClearDepthStencilImage");
+    table->CmdClearColorAttachment = (PFN_vkCmdClearColorAttachment) gpa(dev, "vkCmdClearColorAttachment");
+    table->CmdClearDepthStencilAttachment = (PFN_vkCmdClearDepthStencilAttachment) gpa(dev, "vkCmdClearDepthStencilAttachment");
     table->CmdResolveImage = (PFN_vkCmdResolveImage) gpa(dev, "vkCmdResolveImage");
     table->CmdSetEvent = (PFN_vkCmdSetEvent) gpa(dev, "vkCmdSetEvent");
     table->CmdResetEvent = (PFN_vkCmdResetEvent) gpa(dev, "vkCmdResetEvent");
@@ -309,8 +311,12 @@ static inline void *loader_lookup_device_dispatch_table(
         return (void *) table->CmdFillBuffer;
     if (!strcmp(name, "CmdClearColorImage"))
         return (void *) table->CmdClearColorImage;
-    if (!strcmp(name, "CmdClearDepthStencil"))
-        return (void *) table->CmdClearDepthStencil;
+    if (!strcmp(name, "CmdClearDepthStencilImage"))
+        return (void *) table->CmdClearDepthStencilImage;
+    if (!strcmp(name, "CmdClearColorAttachment"))
+        return (void *) table->CmdClearColorAttachment;
+    if (!strcmp(name, "CmdClearDepthStencilAttachment"))
+        return (void *) table->CmdClearDepthStencilAttachment;
     if (!strcmp(name, "CmdResolveImage"))
         return (void *) table->CmdResolveImage;
     if (!strcmp(name, "CmdSetEvent"))
index 242f04e00a69d5f58c3720734702612639df738f..ef8e4f5ef2fb2815534723eaf1a2c3bafd472c81 100644 (file)
@@ -999,13 +999,31 @@ LOADER_EXPORT void VKAPI vkCmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage ima
     disp->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges);
 }
 
-LOADER_EXPORT void VKAPI vkCmdClearDepthStencil(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, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges)
 {
     const VkLayerDispatchTable *disp;
 
     disp = loader_get_dispatch(cmdBuffer);
 
-    disp->CmdClearDepthStencil(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
+    disp->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
+}
+
+LOADER_EXPORT void VKAPI vkCmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColor* pColor, uint32_t rectCount, const VkRect3D* pRects)
+{
+    const VkLayerDispatchTable *disp;
+
+    disp = loader_get_dispatch(cmdBuffer);
+
+    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)
+{
+    const VkLayerDispatchTable *disp;
+
+    disp = loader_get_dispatch(cmdBuffer);
+
+    disp->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects);
 }
 
 LOADER_EXPORT void VKAPI vkCmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions)
index 95ad639e8770d73e4c16545d9819f9c0187f22d7..c8e9b8f459db918254a0a0836d574407f1d39968 100755 (executable)
--- a/vulkan.py
+++ b/vulkan.py
@@ -738,7 +738,7 @@ core = Extension(
              Param("uint32_t", "rangeCount"),
              Param("const VkImageSubresourceRange*", "pRanges")]),
 
-        Proto("void", "CmdClearDepthStencil",
+        Proto("void", "CmdClearDepthStencilImage",
             [Param("VkCmdBuffer", "cmdBuffer"),
              Param("VkImage", "image"),
              Param("VkImageLayout", "imageLayout"),
@@ -747,6 +747,23 @@ core = Extension(
              Param("uint32_t", "rangeCount"),
              Param("const VkImageSubresourceRange*", "pRanges")]),
 
+        Proto("void", "CmdClearColorAttachment",
+            [Param("VkCmdBuffer", "cmdBuffer"),
+             Param("uint32_t", "colorAttachment"),
+             Param("VkImageLayout", "imageLayout"),
+             Param("const VkClearColor*", "pColor"),
+             Param("uint32_t", "rectCount"),
+             Param("const VkRect3D*", "pRects")]),
+
+        Proto("void", "CmdClearDepthStencilAttachment",
+            [Param("VkCmdBuffer", "cmdBuffer"),
+             Param("VkImageAspectFlags", "imageAspectMask"),
+             Param("VkImageLayout", "imageLayout"),
+             Param("float", "depth"),
+             Param("uint32_t", "stencil"),
+             Param("uint32_t", "rectCount"),
+             Param("const VkRect3D*", "pRects")]),
+
         Proto("void", "CmdResolveImage",
             [Param("VkCmdBuffer", "cmdBuffer"),
              Param("VkImage", "srcImage"),