diff options
| author | 2022-06-30 22:04:23 -0400 | |
|---|---|---|
| committer | 2022-07-05 20:33:43 -0400 | |
| commit | aec129c1ab333292c37e28bd6b76670e9d0a1acf (patch) | |
| tree | a2a537d2f04c4a7d6924064b93ad348d398f67a5 | |
| parent | Merge pull request #8486 from liushuyu/github-actions-verify (diff) | |
| download | yuzu-aec129c1ab333292c37e28bd6b76670e9d0a1acf.tar.gz yuzu-aec129c1ab333292c37e28bd6b76670e9d0a1acf.tar.xz yuzu-aec129c1ab333292c37e28bd6b76670e9d0a1acf.zip | |
renderer_(gl/vk): Implement ASTC_10x6_UNORM
- Used by Monster Hunter Rise Update 10.0.2
| -rw-r--r-- | src/video_core/compatible_formats.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/maxwell_to_vk.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/surface.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/surface.h | 4 | ||||
| -rw-r--r-- | src/video_core/texture_cache/format_lookup_table.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/texture_cache/formatter.h | 2 |
7 files changed, 16 insertions, 1 deletions
diff --git a/src/video_core/compatible_formats.cpp b/src/video_core/compatible_formats.cpp index 014d880e2..4e75f33ca 100644 --- a/src/video_core/compatible_formats.cpp +++ b/src/video_core/compatible_formats.cpp | |||
| @@ -131,9 +131,12 @@ constexpr std::array VIEW_CLASS_ASTC_8x8_RGBA{ | |||
| 131 | // PixelFormat::ASTC_2D_10X5_SRGB | 131 | // PixelFormat::ASTC_2D_10X5_SRGB |
| 132 | 132 | ||
| 133 | // Missing formats: | 133 | // Missing formats: |
| 134 | // PixelFormat::ASTC_2D_10X6_UNORM | ||
| 135 | // PixelFormat::ASTC_2D_10X6_SRGB | 134 | // PixelFormat::ASTC_2D_10X6_SRGB |
| 136 | 135 | ||
| 136 | constexpr std::array VIEW_CLASS_ASTC_10x6_RGBA{ | ||
| 137 | PixelFormat::ASTC_2D_10X6_UNORM, | ||
| 138 | }; | ||
| 139 | |||
| 137 | constexpr std::array VIEW_CLASS_ASTC_10x8_RGBA{ | 140 | constexpr std::array VIEW_CLASS_ASTC_10x8_RGBA{ |
| 138 | PixelFormat::ASTC_2D_10X8_UNORM, | 141 | PixelFormat::ASTC_2D_10X8_UNORM, |
| 139 | PixelFormat::ASTC_2D_10X8_SRGB, | 142 | PixelFormat::ASTC_2D_10X8_SRGB, |
| @@ -226,6 +229,7 @@ constexpr Table MakeViewTable() { | |||
| 226 | EnableRange(view, VIEW_CLASS_ASTC_6x6_RGBA); | 229 | EnableRange(view, VIEW_CLASS_ASTC_6x6_RGBA); |
| 227 | EnableRange(view, VIEW_CLASS_ASTC_8x5_RGBA); | 230 | EnableRange(view, VIEW_CLASS_ASTC_8x5_RGBA); |
| 228 | EnableRange(view, VIEW_CLASS_ASTC_8x8_RGBA); | 231 | EnableRange(view, VIEW_CLASS_ASTC_8x8_RGBA); |
| 232 | EnableRange(view, VIEW_CLASS_ASTC_10x6_RGBA); | ||
| 229 | EnableRange(view, VIEW_CLASS_ASTC_10x8_RGBA); | 233 | EnableRange(view, VIEW_CLASS_ASTC_10x8_RGBA); |
| 230 | EnableRange(view, VIEW_CLASS_ASTC_10x10_RGBA); | 234 | EnableRange(view, VIEW_CLASS_ASTC_10x10_RGBA); |
| 231 | EnableRange(view, VIEW_CLASS_ASTC_12x12_RGBA); | 235 | EnableRange(view, VIEW_CLASS_ASTC_12x12_RGBA); |
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index 644b60d73..9a72d0d6d 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -98,6 +98,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> FORMAT_TAB | |||
| 98 | {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR}, // ASTC_2D_10X8_SRGB | 98 | {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR}, // ASTC_2D_10X8_SRGB |
| 99 | {GL_COMPRESSED_RGBA_ASTC_6x6_KHR}, // ASTC_2D_6X6_UNORM | 99 | {GL_COMPRESSED_RGBA_ASTC_6x6_KHR}, // ASTC_2D_6X6_UNORM |
| 100 | {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR}, // ASTC_2D_6X6_SRGB | 100 | {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR}, // ASTC_2D_6X6_SRGB |
| 101 | {GL_COMPRESSED_RGBA_ASTC_10x6_KHR}, // ASTC_2D_10X6_UNORM | ||
| 101 | {GL_COMPRESSED_RGBA_ASTC_10x10_KHR}, // ASTC_2D_10X10_UNORM | 102 | {GL_COMPRESSED_RGBA_ASTC_10x10_KHR}, // ASTC_2D_10X10_UNORM |
| 102 | {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR}, // ASTC_2D_10X10_SRGB | 103 | {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR}, // ASTC_2D_10X10_SRGB |
| 103 | {GL_COMPRESSED_RGBA_ASTC_12x12_KHR}, // ASTC_2D_12X12_UNORM | 104 | {GL_COMPRESSED_RGBA_ASTC_12x12_KHR}, // ASTC_2D_12X12_UNORM |
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index 193cbe15e..689164a6a 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp | |||
| @@ -195,6 +195,7 @@ struct FormatTuple { | |||
| 195 | {VK_FORMAT_ASTC_10x8_SRGB_BLOCK}, // ASTC_2D_10X8_SRGB | 195 | {VK_FORMAT_ASTC_10x8_SRGB_BLOCK}, // ASTC_2D_10X8_SRGB |
| 196 | {VK_FORMAT_ASTC_6x6_UNORM_BLOCK}, // ASTC_2D_6X6_UNORM | 196 | {VK_FORMAT_ASTC_6x6_UNORM_BLOCK}, // ASTC_2D_6X6_UNORM |
| 197 | {VK_FORMAT_ASTC_6x6_SRGB_BLOCK}, // ASTC_2D_6X6_SRGB | 197 | {VK_FORMAT_ASTC_6x6_SRGB_BLOCK}, // ASTC_2D_6X6_SRGB |
| 198 | {VK_FORMAT_ASTC_10x6_UNORM_BLOCK}, // ASTC_2D_10X6_UNORM | ||
| 198 | {VK_FORMAT_ASTC_10x10_UNORM_BLOCK}, // ASTC_2D_10X10_UNORM | 199 | {VK_FORMAT_ASTC_10x10_UNORM_BLOCK}, // ASTC_2D_10X10_UNORM |
| 199 | {VK_FORMAT_ASTC_10x10_SRGB_BLOCK}, // ASTC_2D_10X10_SRGB | 200 | {VK_FORMAT_ASTC_10x10_SRGB_BLOCK}, // ASTC_2D_10X10_SRGB |
| 200 | {VK_FORMAT_ASTC_12x12_UNORM_BLOCK}, // ASTC_2D_12X12_UNORM | 201 | {VK_FORMAT_ASTC_12x12_UNORM_BLOCK}, // ASTC_2D_12X12_UNORM |
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 69c1b1e6d..eecd0deff 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp | |||
| @@ -247,6 +247,7 @@ bool IsPixelFormatASTC(PixelFormat format) { | |||
| 247 | case PixelFormat::ASTC_2D_10X8_SRGB: | 247 | case PixelFormat::ASTC_2D_10X8_SRGB: |
| 248 | case PixelFormat::ASTC_2D_6X6_UNORM: | 248 | case PixelFormat::ASTC_2D_6X6_UNORM: |
| 249 | case PixelFormat::ASTC_2D_6X6_SRGB: | 249 | case PixelFormat::ASTC_2D_6X6_SRGB: |
| 250 | case PixelFormat::ASTC_2D_10X6_UNORM: | ||
| 250 | case PixelFormat::ASTC_2D_10X10_UNORM: | 251 | case PixelFormat::ASTC_2D_10X10_UNORM: |
| 251 | case PixelFormat::ASTC_2D_10X10_SRGB: | 252 | case PixelFormat::ASTC_2D_10X10_SRGB: |
| 252 | case PixelFormat::ASTC_2D_12X12_UNORM: | 253 | case PixelFormat::ASTC_2D_12X12_UNORM: |
diff --git a/src/video_core/surface.h b/src/video_core/surface.h index 75e055592..0175432ff 100644 --- a/src/video_core/surface.h +++ b/src/video_core/surface.h | |||
| @@ -94,6 +94,7 @@ enum class PixelFormat { | |||
| 94 | ASTC_2D_10X8_SRGB, | 94 | ASTC_2D_10X8_SRGB, |
| 95 | ASTC_2D_6X6_UNORM, | 95 | ASTC_2D_6X6_UNORM, |
| 96 | ASTC_2D_6X6_SRGB, | 96 | ASTC_2D_6X6_SRGB, |
| 97 | ASTC_2D_10X6_UNORM, | ||
| 97 | ASTC_2D_10X10_UNORM, | 98 | ASTC_2D_10X10_UNORM, |
| 98 | ASTC_2D_10X10_SRGB, | 99 | ASTC_2D_10X10_SRGB, |
| 99 | ASTC_2D_12X12_UNORM, | 100 | ASTC_2D_12X12_UNORM, |
| @@ -227,6 +228,7 @@ constexpr std::array<u8, MaxPixelFormat> BLOCK_WIDTH_TABLE = {{ | |||
| 227 | 10, // ASTC_2D_10X8_SRGB | 228 | 10, // ASTC_2D_10X8_SRGB |
| 228 | 6, // ASTC_2D_6X6_UNORM | 229 | 6, // ASTC_2D_6X6_UNORM |
| 229 | 6, // ASTC_2D_6X6_SRGB | 230 | 6, // ASTC_2D_6X6_SRGB |
| 231 | 10, // ASTC_2D_10X6_UNORM | ||
| 230 | 10, // ASTC_2D_10X10_UNORM | 232 | 10, // ASTC_2D_10X10_UNORM |
| 231 | 10, // ASTC_2D_10X10_SRGB | 233 | 10, // ASTC_2D_10X10_SRGB |
| 232 | 12, // ASTC_2D_12X12_UNORM | 234 | 12, // ASTC_2D_12X12_UNORM |
| @@ -329,6 +331,7 @@ constexpr std::array<u8, MaxPixelFormat> BLOCK_HEIGHT_TABLE = {{ | |||
| 329 | 8, // ASTC_2D_10X8_SRGB | 331 | 8, // ASTC_2D_10X8_SRGB |
| 330 | 6, // ASTC_2D_6X6_UNORM | 332 | 6, // ASTC_2D_6X6_UNORM |
| 331 | 6, // ASTC_2D_6X6_SRGB | 333 | 6, // ASTC_2D_6X6_SRGB |
| 334 | 6, // ASTC_2D_10X6_UNORM | ||
| 332 | 10, // ASTC_2D_10X10_UNORM | 335 | 10, // ASTC_2D_10X10_UNORM |
| 333 | 10, // ASTC_2D_10X10_SRGB | 336 | 10, // ASTC_2D_10X10_SRGB |
| 334 | 12, // ASTC_2D_12X12_UNORM | 337 | 12, // ASTC_2D_12X12_UNORM |
| @@ -431,6 +434,7 @@ constexpr std::array<u8, MaxPixelFormat> BITS_PER_BLOCK_TABLE = {{ | |||
| 431 | 128, // ASTC_2D_10X8_SRGB | 434 | 128, // ASTC_2D_10X8_SRGB |
| 432 | 128, // ASTC_2D_6X6_UNORM | 435 | 128, // ASTC_2D_6X6_UNORM |
| 433 | 128, // ASTC_2D_6X6_SRGB | 436 | 128, // ASTC_2D_6X6_SRGB |
| 437 | 128, // ASTC_2D_10X6_UNORM | ||
| 434 | 128, // ASTC_2D_10X10_UNORM | 438 | 128, // ASTC_2D_10X10_UNORM |
| 435 | 128, // ASTC_2D_10X10_SRGB | 439 | 128, // ASTC_2D_10X10_SRGB |
| 436 | 128, // ASTC_2D_12X12_UNORM | 440 | 128, // ASTC_2D_12X12_UNORM |
diff --git a/src/video_core/texture_cache/format_lookup_table.cpp b/src/video_core/texture_cache/format_lookup_table.cpp index 0937768d6..1412aa076 100644 --- a/src/video_core/texture_cache/format_lookup_table.cpp +++ b/src/video_core/texture_cache/format_lookup_table.cpp | |||
| @@ -206,6 +206,8 @@ PixelFormat PixelFormatFromTextureInfo(TextureFormat format, ComponentType red, | |||
| 206 | return PixelFormat::ASTC_2D_6X6_UNORM; | 206 | return PixelFormat::ASTC_2D_6X6_UNORM; |
| 207 | case Hash(TextureFormat::ASTC_2D_6X6, UNORM, SRGB): | 207 | case Hash(TextureFormat::ASTC_2D_6X6, UNORM, SRGB): |
| 208 | return PixelFormat::ASTC_2D_6X6_SRGB; | 208 | return PixelFormat::ASTC_2D_6X6_SRGB; |
| 209 | case Hash(TextureFormat::ASTC_2D_10X6, UNORM, LINEAR): | ||
| 210 | return PixelFormat::ASTC_2D_10X6_UNORM; | ||
| 209 | case Hash(TextureFormat::ASTC_2D_10X10, UNORM, LINEAR): | 211 | case Hash(TextureFormat::ASTC_2D_10X10, UNORM, LINEAR): |
| 210 | return PixelFormat::ASTC_2D_10X10_UNORM; | 212 | return PixelFormat::ASTC_2D_10X10_UNORM; |
| 211 | case Hash(TextureFormat::ASTC_2D_10X10, UNORM, SRGB): | 213 | case Hash(TextureFormat::ASTC_2D_10X10, UNORM, SRGB): |
diff --git a/src/video_core/texture_cache/formatter.h b/src/video_core/texture_cache/formatter.h index 1b78ed445..95a572604 100644 --- a/src/video_core/texture_cache/formatter.h +++ b/src/video_core/texture_cache/formatter.h | |||
| @@ -175,6 +175,8 @@ struct fmt::formatter<VideoCore::Surface::PixelFormat> : fmt::formatter<fmt::str | |||
| 175 | return "ASTC_2D_6X6_UNORM"; | 175 | return "ASTC_2D_6X6_UNORM"; |
| 176 | case PixelFormat::ASTC_2D_6X6_SRGB: | 176 | case PixelFormat::ASTC_2D_6X6_SRGB: |
| 177 | return "ASTC_2D_6X6_SRGB"; | 177 | return "ASTC_2D_6X6_SRGB"; |
| 178 | case PixelFormat::ASTC_2D_10X6_UNORM: | ||
| 179 | return "ASTC_2D_10X6_UNORM"; | ||
| 178 | case PixelFormat::ASTC_2D_10X10_UNORM: | 180 | case PixelFormat::ASTC_2D_10X10_UNORM: |
| 179 | return "ASTC_2D_10X10_UNORM"; | 181 | return "ASTC_2D_10X10_UNORM"; |
| 180 | case PixelFormat::ASTC_2D_10X10_SRGB: | 182 | case PixelFormat::ASTC_2D_10X10_SRGB: |