aboutsummaryrefslogtreecommitdiff
path: root/layers/param_checker.cpp
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-10-15 16:51:05 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-10-23 17:31:13 -0600
commit21eb93d89a7ac0cd281d7bb3ca277c7fc7163380 (patch)
treeed2b12c9c8e9ba82ce9360cb1c15be6b2083d5a6 /layers/param_checker.cpp
parent0db2c910ea48122e229ea45ad3301bf9a70a5331 (diff)
downloadusermoji-21eb93d89a7ac0cd281d7bb3ca277c7fc7163380.tar.xz
bug-14291: combine color and depth/stencil clears
Diffstat (limited to 'layers/param_checker.cpp')
-rw-r--r--layers/param_checker.cpp90
1 files changed, 10 insertions, 80 deletions
diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp
index b78c19ec..c400d36f 100644
--- a/layers/param_checker.cpp
+++ b/layers/param_checker.cpp
@@ -6361,7 +6361,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage(
PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount);
}
-bool PreCmdClearColorAttachment(
+bool PreCmdClearAttachments(
VkCmdBuffer cmdBuffer,
const VkClearColorValue* pColor,
const VkRect3D* pRects)
@@ -6377,88 +6377,18 @@ bool PreCmdClearColorAttachment(
return true;
}
-bool PostCmdClearColorAttachment(
- VkCmdBuffer cmdBuffer,
- uint32_t colorAttachment,
- VkImageLayout imageLayout,
- uint32_t rectCount)
-{
-
-
- if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE ||
- imageLayout > VK_IMAGE_LAYOUT_END_RANGE)
- {
- log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK",
- "vkCmdClearColorAttachment parameter, VkImageLayout imageLayout, is an unrecognized enumerator");
- return false;
- }
-
-
- return true;
-}
-
-VK_LAYER_EXPORT void VKAPI vkCmdClearColorAttachment(
- VkCmdBuffer cmdBuffer,
- uint32_t colorAttachment,
- VkImageLayout imageLayout,
- const VkClearColorValue* pColor,
- uint32_t rectCount,
- const VkRect3D* pRects)
-{
- PreCmdClearColorAttachment(cmdBuffer, pColor, pRects);
-
- get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects);
-
- PostCmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, rectCount);
-}
-
-bool PreCmdClearDepthStencilAttachment(
- VkCmdBuffer cmdBuffer,
- const VkRect3D* pRects)
-{
- if(pRects != nullptr)
- {
- }
-
- return true;
-}
-
-bool PostCmdClearDepthStencilAttachment(
- VkCmdBuffer cmdBuffer,
- VkImageAspectFlags imageAspectMask,
- VkImageLayout imageLayout,
- const VkClearDepthStencilValue* pDepthStencil,
- uint32_t rectCount)
+VK_LAYER_EXPORT void VKAPI vkCmdClearAttachments(
+ VkCmdBuffer cmdBuffer,
+ uint32_t attachmentCount,
+ const VkClearAttachment* pAttachments,
+ uint32_t rectCount,
+ const VkRect3D* pRects)
{
-
-
- if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE ||
- imageLayout > VK_IMAGE_LAYOUT_END_RANGE)
- {
- log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK",
- "vkCmdClearDepthStencilAttachment parameter, VkImageLayout imageLayout, is an unrecognized enumerator");
- return false;
+ for (uint32_t i = 0; i < attachmentCount; i++) {
+ PreCmdClearAttachments(cmdBuffer, &pAttachments[i].clearValue.color, pRects);
}
-
-
-
- return true;
-}
-
-VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(
- VkCmdBuffer cmdBuffer,
- VkImageAspectFlags imageAspectMask,
- VkImageLayout imageLayout,
- const VkClearDepthStencilValue* pDepthStencil,
- uint32_t rectCount,
- const VkRect3D* pRects)
-{
- PreCmdClearDepthStencilAttachment(cmdBuffer, pRects);
-
- get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
-
- PostCmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount);
+ get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearAttachments(cmdBuffer, attachmentCount, pAttachments, rectCount, pRects);
}
bool PreCmdResolveImage(