mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 13:30:44 +00:00
Vulkan: Add FormatImageAspects to get VkImageAspectFlags from VkFormat
Change-Id: I82c13d0e106dcd579096f0a4e0e5ffe50bae3092
This commit is contained in:
committed by
Baldur Karlsson
parent
2e578ee418
commit
bc9f84f61b
@@ -2903,6 +2903,22 @@ VkFormat MakeVkFormat(ResourceFormat fmt)
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkImageAspectFlags FormatImageAspects(VkFormat fmt)
|
||||
{
|
||||
if(IsStencilOnlyFormat(fmt))
|
||||
return VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
else if(IsDepthOnlyFormat(fmt))
|
||||
return VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
else if(IsDepthAndStencilFormat(fmt))
|
||||
return VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
else if(GetYUVPlaneCount(fmt) == 3)
|
||||
return VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT | VK_IMAGE_ASPECT_PLANE_2_BIT;
|
||||
else if(GetYUVPlaneCount(fmt) == 2)
|
||||
return VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT;
|
||||
else
|
||||
return VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
}
|
||||
|
||||
VkResourceRecord::~VkResourceRecord()
|
||||
{
|
||||
VkResourceType resType = Resource != NULL ? IdentifyTypeByPtr(Resource) : eResUnknown;
|
||||
|
||||
@@ -1344,6 +1344,7 @@ bool IsUIntFormat(VkFormat f);
|
||||
bool IsDoubleFormat(VkFormat f);
|
||||
bool IsSIntFormat(VkFormat f);
|
||||
bool IsYUVFormat(VkFormat f);
|
||||
VkImageAspectFlags FormatImageAspects(VkFormat f);
|
||||
|
||||
uint32_t GetYUVPlaneCount(VkFormat f);
|
||||
uint32_t GetYUVNumRows(VkFormat f, uint32_t height);
|
||||
|
||||
Reference in New Issue
Block a user