diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-10-19 19:41:57 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:31 +0100 |
commit | 826a350e2b6aadb4f123189c28f065b0e7926264 (patch) | |
tree | 313ea78b62cee597b3c6f36ff2ca2bd37f29319d /src/video_core/surface.cpp | |
parent | Texture cache: fix Intel with rescaler. (diff) | |
download | yuzu-826a350e2b6aadb4f123189c28f065b0e7926264.tar yuzu-826a350e2b6aadb4f123189c28f065b0e7926264.tar.gz yuzu-826a350e2b6aadb4f123189c28f065b0e7926264.tar.bz2 yuzu-826a350e2b6aadb4f123189c28f065b0e7926264.tar.lz yuzu-826a350e2b6aadb4f123189c28f065b0e7926264.tar.xz yuzu-826a350e2b6aadb4f123189c28f065b0e7926264.tar.zst yuzu-826a350e2b6aadb4f123189c28f065b0e7926264.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/surface.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 64941a486..58d262446 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -306,6 +306,53 @@ bool IsPixelFormatInteger(PixelFormat format) { } } +bool IsPixelFormatSignedInteger(PixelFormat format) { + switch (format) { + case PixelFormat::A8B8G8R8_SINT: + case PixelFormat::R8_SINT: + case PixelFormat::R16G16B16A16_SINT: + case PixelFormat::R32G32B32A32_SINT: + case PixelFormat::R32G32_SINT: + case PixelFormat::R16_SINT: + case PixelFormat::R16G16_SINT: + case PixelFormat::R8G8_SINT: + case PixelFormat::R32_SINT: + return true; + default: + return false; + } +} + +size_t PixelComponentSizeBitsInteger(PixelFormat format) { + switch (format) { + case PixelFormat::A8B8G8R8_SINT: + case PixelFormat::A8B8G8R8_UINT: + case PixelFormat::R8_SINT: + case PixelFormat::R8_UINT: + case PixelFormat::R8G8_SINT: + case PixelFormat::R8G8_UINT: + return 8; + case PixelFormat::A2B10G10R10_UINT: + return 10; + case PixelFormat::R16G16B16A16_SINT: + case PixelFormat::R16G16B16A16_UINT: + case PixelFormat::R16_UINT: + case PixelFormat::R16_SINT: + case PixelFormat::R16G16_UINT: + case PixelFormat::R16G16_SINT: + return 16; + case PixelFormat::R32G32B32A32_UINT: + case PixelFormat::R32G32B32A32_SINT: + case PixelFormat::R32G32_SINT: + case PixelFormat::R32G32_UINT: + case PixelFormat::R32_UINT: + case PixelFormat::R32_SINT: + return 32; + default: + return 0; + } +} + std::pair<u32, u32> GetASTCBlockSize(PixelFormat format) { return {DefaultBlockWidth(format), DefaultBlockHeight(format)}; } |