uint32_t layers;
} VkFramebufferCreateInfo;
-typedef union VkClearColorValue_
-{
- float floatColor[4];
- uint32_t rawColor[4];
+typedef union {
+ float f32[4];
+ int32_t s32[4];
+ uint32_t u32[4];
} VkClearColorValue;
-typedef struct {
- VkClearColorValue color;
- bool32_t useRawValue;
-} VkClearColor;
-
typedef struct {
VkStructureType sType;
const void* pNext;
const VkImageLayout* pColorLayouts;
const VkAttachmentLoadOp* pColorLoadOps;
const VkAttachmentStoreOp* pColorStoreOps;
- const VkClearColor* pColorLoadClearValues;
+ const VkClearColorValue* pColorLoadClearValues;
VkFormat depthStencilFormat;
VkImageLayout depthStencilLayout;
VkAttachmentLoadOp depthLoadOp;
typedef void (VKAPI *PFN_vkCmdCopyImageToBuffer)(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions);
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, VkClearColor color, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
+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_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 imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects);
VkCmdBuffer cmdBuffer,
VkImage image,
VkImageLayout imageLayout,
- VkClearColor color,
+ const VkClearColorValue* pColor,
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges);
.ViewportIndex = 0,
.PointWidth = 0.0
},
- .color = pass->layers[i].clear_color.color,
+ .color = pass->layers[i].clear_color,
};
}
}
.pColorLayouts = (VkImageLayout[]) { VK_IMAGE_LAYOUT_GENERAL },
.pColorLoadOps = (VkAttachmentLoadOp[]) { VK_ATTACHMENT_LOAD_OP_LOAD },
.pColorStoreOps = (VkAttachmentStoreOp[]) { VK_ATTACHMENT_STORE_OP_STORE },
- .pColorLoadClearValues = (VkClearColor[]) {
- { .color = { .floatColor = { 1.0, 0.0, 0.0, 1.0 } }, .useRawValue = false }
+ .pColorLoadClearValues = (VkClearColorValue[]) {
+ { .f32 = { 1.0, 0.0, 0.0, 1.0 } }
},
.depthStencilFormat = VK_FORMAT_UNDEFINED,
}, &pass);
VkCmdBuffer cmdBuffer,
VkImage _image,
VkImageLayout imageLayout,
- VkClearColor color,
+ const VkClearColorValue* pColor,
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges)
{
.pColorLayouts = (VkImageLayout[]) { imageLayout },
.pColorLoadOps = (VkAttachmentLoadOp[]) { VK_ATTACHMENT_LOAD_OP_DONT_CARE },
.pColorStoreOps = (VkAttachmentStoreOp[]) { VK_ATTACHMENT_STORE_OP_STORE },
- .pColorLoadClearValues = &color,
+ .pColorLoadClearValues = pColor,
.depthStencilFormat = VK_FORMAT_UNDEFINED,
}, &pass);
.ViewportIndex = 0,
.PointWidth = 0.0
},
- .color = color.color,
+ .color = *pColor,
};
meta_emit_clear(cmd_buffer, 1, &instance_data);