diff options
| author | 2018-11-13 03:34:54 +0100 | |
|---|---|---|
| committer | 2018-11-12 18:34:54 -0800 | |
| commit | c8b3f09876e796f3c249f17f7f39e78bc1e3de74 (patch) | |
| tree | f472a868f338f3ed37def141165b75ff2bca5f25 /src/video_core/renderer_opengl | |
| parent | Merge pull request #1650 from FreddyFunk/cast (diff) | |
| download | yuzu-c8b3f09876e796f3c249f17f7f39e78bc1e3de74.tar.gz yuzu-c8b3f09876e796f3c249f17f7f39e78bc1e3de74.tar.xz yuzu-c8b3f09876e796f3c249f17f7f39e78bc1e3de74.zip | |
Implement ASTC_2D_10X8 & ASTC_2D_10X8_SRGB (#1666)
* Implement ASTC_2D_10X8 & ASTC_2D_10X8_SRGB
( needed by Mario+Rabbids Kingdom Battle )
* Small placement correction
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 894f4f294..24cd88d06 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -314,6 +314,8 @@ static constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex | |||
| 314 | {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_5X4_SRGB | 314 | {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_5X4_SRGB |
| 315 | {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_5X5 | 315 | {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_5X5 |
| 316 | {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_5X5_SRGB | 316 | {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_5X5_SRGB |
| 317 | {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_10X8 | ||
| 318 | {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_10X8_SRGB | ||
| 317 | 319 | ||
| 318 | // Depth formats | 320 | // Depth formats |
| 319 | {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, ComponentType::Float, false}, // Z32F | 321 | {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, ComponentType::Float, false}, // Z32F |
| @@ -456,6 +458,8 @@ static constexpr GLConversionArray morton_to_gl_fns = { | |||
| 456 | MortonCopy<true, PixelFormat::ASTC_2D_5X4_SRGB>, | 458 | MortonCopy<true, PixelFormat::ASTC_2D_5X4_SRGB>, |
| 457 | MortonCopy<true, PixelFormat::ASTC_2D_5X5>, | 459 | MortonCopy<true, PixelFormat::ASTC_2D_5X5>, |
| 458 | MortonCopy<true, PixelFormat::ASTC_2D_5X5_SRGB>, | 460 | MortonCopy<true, PixelFormat::ASTC_2D_5X5_SRGB>, |
| 461 | MortonCopy<true, PixelFormat::ASTC_2D_10X8>, | ||
| 462 | MortonCopy<true, PixelFormat::ASTC_2D_10X8_SRGB>, | ||
| 459 | MortonCopy<true, PixelFormat::Z32F>, | 463 | MortonCopy<true, PixelFormat::Z32F>, |
| 460 | MortonCopy<true, PixelFormat::Z16>, | 464 | MortonCopy<true, PixelFormat::Z16>, |
| 461 | MortonCopy<true, PixelFormat::Z24S8>, | 465 | MortonCopy<true, PixelFormat::Z24S8>, |
| @@ -526,6 +530,8 @@ static constexpr GLConversionArray gl_to_morton_fns = { | |||
| 526 | nullptr, | 530 | nullptr, |
| 527 | nullptr, | 531 | nullptr, |
| 528 | nullptr, | 532 | nullptr, |
| 533 | nullptr, | ||
| 534 | nullptr, | ||
| 529 | MortonCopy<false, PixelFormat::Z32F>, | 535 | MortonCopy<false, PixelFormat::Z32F>, |
| 530 | MortonCopy<false, PixelFormat::Z16>, | 536 | MortonCopy<false, PixelFormat::Z16>, |
| 531 | MortonCopy<false, PixelFormat::Z24S8>, | 537 | MortonCopy<false, PixelFormat::Z24S8>, |
| @@ -932,7 +938,9 @@ static void ConvertFormatAsNeeded_LoadGLBuffer(std::vector<u8>& data, PixelForma | |||
| 932 | case PixelFormat::ASTC_2D_8X8_SRGB: | 938 | case PixelFormat::ASTC_2D_8X8_SRGB: |
| 933 | case PixelFormat::ASTC_2D_8X5_SRGB: | 939 | case PixelFormat::ASTC_2D_8X5_SRGB: |
| 934 | case PixelFormat::ASTC_2D_5X4_SRGB: | 940 | case PixelFormat::ASTC_2D_5X4_SRGB: |
| 935 | case PixelFormat::ASTC_2D_5X5_SRGB: { | 941 | case PixelFormat::ASTC_2D_5X5_SRGB: |
| 942 | case PixelFormat::ASTC_2D_10X8: | ||
| 943 | case PixelFormat::ASTC_2D_10X8_SRGB: { | ||
| 936 | // Convert ASTC pixel formats to RGBA8, as most desktop GPUs do not support ASTC. | 944 | // Convert ASTC pixel formats to RGBA8, as most desktop GPUs do not support ASTC. |
| 937 | u32 block_width{}; | 945 | u32 block_width{}; |
| 938 | u32 block_height{}; | 946 | u32 block_height{}; |
| @@ -967,7 +975,11 @@ static void ConvertFormatAsNeeded_FlushGLBuffer(std::vector<u8>& data, PixelForm | |||
| 967 | case PixelFormat::ASTC_2D_4X4: | 975 | case PixelFormat::ASTC_2D_4X4: |
| 968 | case PixelFormat::ASTC_2D_8X8: | 976 | case PixelFormat::ASTC_2D_8X8: |
| 969 | case PixelFormat::ASTC_2D_4X4_SRGB: | 977 | case PixelFormat::ASTC_2D_4X4_SRGB: |
| 970 | case PixelFormat::ASTC_2D_8X8_SRGB: { | 978 | case PixelFormat::ASTC_2D_8X8_SRGB: |
| 979 | case PixelFormat::ASTC_2D_5X5: | ||
| 980 | case PixelFormat::ASTC_2D_5X5_SRGB: | ||
| 981 | case PixelFormat::ASTC_2D_10X8: | ||
| 982 | case PixelFormat::ASTC_2D_10X8_SRGB: { | ||
| 971 | LOG_CRITICAL(HW_GPU, "Conversion of format {} after texture flushing is not implemented", | 983 | LOG_CRITICAL(HW_GPU, "Conversion of format {} after texture flushing is not implemented", |
| 972 | static_cast<u32>(pixel_format)); | 984 | static_cast<u32>(pixel_format)); |
| 973 | UNREACHABLE(); | 985 | UNREACHABLE(); |