mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-07-31 04:28:56 +00:00
Set VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT for planar formats
This allows creating separate image views for the planes of the image if desired.
This commit is contained in:
@@ -832,6 +832,11 @@ static VkResult VULKAN_AllocateImage(VULKAN_RenderData *rendererData, SDL_Proper
|
||||
imageCreateInfo.queueFamilyIndexCount = 0;
|
||||
imageCreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
|
||||
// Set VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT for planar formats
|
||||
if (VULKAN_VkFormatGetNumPlanes(format) > 1) {
|
||||
imageCreateInfo.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
||||
}
|
||||
|
||||
result = vkCreateImage(rendererData->device, &imageCreateInfo, NULL, &imageOut->image);
|
||||
if (result != VK_SUCCESS) {
|
||||
VULKAN_DestroyImage(rendererData, imageOut);
|
||||
|
||||
Reference in New Issue
Block a user