Files
funnygame/materialsystem/vulkan/commands/draw.cpp
2025-12-14 18:00:38 +02:00

23 lines
546 B
C++

#include "../vulkan_state.h"
#include "../commands.h"
DECLARE_VULKAN_COMMAND(ClearColor)
{
AddDependency(pImage, DEPENDENCY_MODE_COLOR_CLEAR_DESTINATION);
CVkImage *pImg;
if (pImage)
pImg = (CVkImage*)pImage;
if (ppImage)
pImg = (CVkImage*)*ppImage;
VkClearColorValue color = {.float32 = {r,g,b,a}};
VkImageSubresourceRange range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.levelCount = 1,
.layerCount = 1,
};
vkCmdClearColorImage(hCommandBuffer, pImg->m_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &color, 1, &range);
}