Repository: libsdl-org/SDL
File: src/render/vulkan/SDL_render_vulkan.c (C)

Code before:
        return 4;
    case VK_FORMAT_R16G16B16A16_SFLOAT:
        return 8;
    default:
        return 4;
    }
}

static VkFormat SDLPixelFormatToVkTextureFormat(Uint32 format, Uint32 colorspace)
{
    switch (format) {
    case SDL_PIXELFORMAT_RGBA64_FLOAT:
        return VK_FORMAT_R16G16B16A16_SFLOAT;
    case SDL_PIXELFORMAT_XBGR2101010:
        return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
    case SDL_PIXELFORMAT_RGBA32:
        if (colorspace == SDL_COLORSPACE_SRGB_LINEAR) {
            return VK_FORMAT_R8G8B8A8_SRGB;
        }
        return VK_FORMAT_R8G8B8A8_UNORM;
    case SDL_PIXELFORMAT_BGRA32:
        if (colorspace == SDL_COLORSPACE_SRGB_LINEAR) {
            return VK_FORMAT_B8G8R8A8_SRGB;
        }
        return VK_FORMAT_B8G8R8A8_UNORM;
#if SDL_BYTEORDER != SDL_LIL_ENDIAN
    case SDL_PIXELFORMAT_ABGR8888:
        if (colorspace == SDL_COLORSPACE_SRGB_LINEAR) {
            return VK_FORMAT_A8B8G8R8_SRGB_PACK32;
        }
        return VK_FORMAT_A8B8G8R8_UNORM_PACK32;
#endif
    case SDL_PIXELFORMAT_RGB24:
        if (colorspace == SDL_COLORSPACE_SRGB_LINEAR) {
            return VK_FORMAT_R8G8B8_SRGB;
        }
        return VK_FORMAT_R8G8B8_UNORM;
    case SDL_PIXELFORMAT_BGR24:
        if (colorspace == SDL_COLORSPACE_SRGB_LINEAR) {
            return VK_FORMAT_B8G8R8_SRGB;
        }
        return VK_FORMAT_B8G8R8_UNORM;
    case SDL_PIXELFORMAT_YUY2:
        return VK_FORMAT_G8B8G8R8_422_UNORM;
    case SDL_PIXELFORMAT_UYVY:
        return VK_FORMAT_B8G8R8G8_422_UNORM;
    case SDL_PIXELFORMAT_YV12:
    case SDL_PIXELFORMAT_IYUV:
        return VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM;
    case SDL_PIXELFORMAT_NV12:
    case SDL_PIXELFORMAT_NV21:

Review comment (suggestion):
```suggestion
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
```
The same below, if we keep that code.

Code after:
    default:
        return 1;
    }
}

static VkDeviceSize VULKAN_GetBytesPerPixel(VkFormat vkFormat, int plane)
{
    switch (vkFormat) {
    case VK_FORMAT_R8_UNORM:
        return 1;
    case VK_FORMAT_R8G8_UNORM:
        return 2;
    case VK_FORMAT_R16G16_UNORM:
        return 4;
    case VK_FORMAT_R8G8B8A8_SRGB:
    case VK_FORMAT_R8G8B8A8_UNORM:
    case VK_FORMAT_B8G8R8A8_SRGB:
    case VK_FORMAT_B8G8R8A8_UNORM:
    case VK_FORMAT_A8B8G8R8_SRGB_PACK32:
    case VK_FORMAT_A8B8G8R8_UNORM_PACK32:
    case VK_FORMAT_A2R10G10B10_UNORM_PACK32:
        return 4;
    case VK_FORMAT_R16G16B16A16_SFLOAT:
        return 8;
    case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
        return 1;
    case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
        return (plane == 0) ? 1 : 2;
    case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:
        return (plane == 0) ? 2 : 4;
    default:
        return 4;
    }
}

static VkFormat SDLPixelFormatToVkTextureFormat(Uint32 format, Uint32 output_colorspace)
{
    switch (format) {
    case SDL_PIXELFORMAT_RGBA64_FLOAT:
        return VK_FORMAT_R16G16B16A16_SFLOAT;
    case SDL_PIXELFORMAT_ABGR2101010:
        return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
    case SDL_PIXELFORMAT_RGBA32:
        if (output_colorspace == SDL_COLORSPACE_SRGB_LINEAR) {
            return VK_FORMAT_R8G8B8A8_SRGB;
        }
        return VK_FORMAT_R8G8B8A8_UNORM;
    case SDL_PIXELFORMAT_BGRA32:
        if (output_colorspace == SDL_COLORSPACE_SRGB_LINEAR) {
            return VK_FORMAT_B8G8R8A8_SRGB;
        }