[surface, vk, pipeline, texture_cache] Texture Sampling Fix

This commit is contained in:
CamilleLaVey 2025-11-24 19:53:02 -04:00 committed by Caio Oliveira
parent 58fb3487d1
commit c4b0d116e9
No known key found for this signature in database
GPG key ID: AAAE6C7FD4186B0C
5 changed files with 65 additions and 10 deletions

View file

@ -443,6 +443,39 @@ std::optional<PixelFormat> NormalizedCompatibleFormat(PixelFormat format) {
}
}
std::optional<PixelFormat> IntegerCompatibleFormat(PixelFormat format) {
switch (format) {
case PixelFormat::A8B8G8R8_UNORM:
return PixelFormat::A8B8G8R8_UINT;
case PixelFormat::A8B8G8R8_SNORM:
return PixelFormat::A8B8G8R8_SINT;
case PixelFormat::A2B10G10R10_UNORM:
return PixelFormat::A2B10G10R10_UINT;
case PixelFormat::R8_UNORM:
return PixelFormat::R8_UINT;
case PixelFormat::R8_SNORM:
return PixelFormat::R8_SINT;
case PixelFormat::R8G8_UNORM:
return PixelFormat::R8G8_UINT;
case PixelFormat::R8G8_SNORM:
return PixelFormat::R8G8_SINT;
case PixelFormat::R16_UNORM:
return PixelFormat::R16_UINT;
case PixelFormat::R16_SNORM:
return PixelFormat::R16_SINT;
case PixelFormat::R16G16_UNORM:
return PixelFormat::R16G16_UINT;
case PixelFormat::R16G16_SNORM:
return PixelFormat::R16G16_SINT;
case PixelFormat::R16G16B16A16_UNORM:
return PixelFormat::R16G16B16A16_UINT;
case PixelFormat::R16G16B16A16_SNORM:
return PixelFormat::R16G16B16A16_SINT;
default:
return std::nullopt;
}
}
size_t PixelComponentSizeBitsInteger(PixelFormat format) {
switch (format) {
case PixelFormat::A8B8G8R8_SINT: