diff options
| author | 2018-08-13 00:34:20 -0400 | |
|---|---|---|
| committer | 2018-08-13 18:20:07 -0400 | |
| commit | 6e52f37d5ba4a11bcbcfbc2840554e3b7705a2c7 (patch) | |
| tree | d8aac4d2816df99c2f1244d00ec806a9ae8571d5 | |
| parent | Merge pull request #1052 from ogniK5377/xeno (diff) | |
| download | yuzu-6e52f37d5ba4a11bcbcfbc2840554e3b7705a2c7.tar.gz yuzu-6e52f37d5ba4a11bcbcfbc2840554e3b7705a2c7.tar.xz yuzu-6e52f37d5ba4a11bcbcfbc2840554e3b7705a2c7.zip | |
renderer_opengl: Implement RenderTargetFormat::RGBA16_UNORM.
- Used by Breath of the Wild.
| -rw-r--r-- | src/video_core/gpu.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 80 |
4 files changed, 48 insertions, 37 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index c9f6b82b7..5a593c1f7 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -47,6 +47,7 @@ u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { | |||
| 47 | case RenderTargetFormat::RGBA32_UINT: | 47 | case RenderTargetFormat::RGBA32_UINT: |
| 48 | return 16; | 48 | return 16; |
| 49 | case RenderTargetFormat::RGBA16_UINT: | 49 | case RenderTargetFormat::RGBA16_UINT: |
| 50 | case RenderTargetFormat::RGBA16_UNORM: | ||
| 50 | case RenderTargetFormat::RGBA16_FLOAT: | 51 | case RenderTargetFormat::RGBA16_FLOAT: |
| 51 | case RenderTargetFormat::RG32_FLOAT: | 52 | case RenderTargetFormat::RG32_FLOAT: |
| 52 | case RenderTargetFormat::RG32_UINT: | 53 | case RenderTargetFormat::RG32_UINT: |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 8a90a3a66..97dcccb92 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -20,6 +20,7 @@ enum class RenderTargetFormat : u32 { | |||
| 20 | NONE = 0x0, | 20 | NONE = 0x0, |
| 21 | RGBA32_FLOAT = 0xC0, | 21 | RGBA32_FLOAT = 0xC0, |
| 22 | RGBA32_UINT = 0xC2, | 22 | RGBA32_UINT = 0xC2, |
| 23 | RGBA16_UNORM = 0xC6, | ||
| 23 | RGBA16_UINT = 0xC9, | 24 | RGBA16_UINT = 0xC9, |
| 24 | RGBA16_FLOAT = 0xCA, | 25 | RGBA16_FLOAT = 0xCA, |
| 25 | RG32_FLOAT = 0xCB, | 26 | RG32_FLOAT = 0xCB, |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 4b48ab8e2..b6329d2dc 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -101,6 +101,7 @@ static constexpr std::array<FormatTuple, SurfaceParams::MaxPixelFormat> tex_form | |||
| 101 | {GL_R8, GL_RED, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // R8 | 101 | {GL_R8, GL_RED, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // R8 |
| 102 | {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, ComponentType::UInt, false}, // R8UI | 102 | {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, ComponentType::UInt, false}, // R8UI |
| 103 | {GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, ComponentType::Float, false}, // RGBA16F | 103 | {GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, ComponentType::Float, false}, // RGBA16F |
| 104 | {GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // RGBA16U | ||
| 104 | {GL_RGBA16UI, GL_RGBA, GL_UNSIGNED_SHORT, ComponentType::UInt, false}, // RGBA16UI | 105 | {GL_RGBA16UI, GL_RGBA, GL_UNSIGNED_SHORT, ComponentType::UInt, false}, // RGBA16UI |
| 105 | {GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, ComponentType::Float, | 106 | {GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, ComponentType::Float, |
| 106 | false}, // R11FG11FB10F | 107 | false}, // R11FG11FB10F |
| @@ -247,6 +248,7 @@ static constexpr std::array<void (*)(u32, u32, u32, std::vector<u8>&, Tegra::GPU | |||
| 247 | MortonCopy<true, PixelFormat::R8>, | 248 | MortonCopy<true, PixelFormat::R8>, |
| 248 | MortonCopy<true, PixelFormat::R8UI>, | 249 | MortonCopy<true, PixelFormat::R8UI>, |
| 249 | MortonCopy<true, PixelFormat::RGBA16F>, | 250 | MortonCopy<true, PixelFormat::RGBA16F>, |
| 251 | MortonCopy<true, PixelFormat::RGBA16U>, | ||
| 250 | MortonCopy<true, PixelFormat::RGBA16UI>, | 252 | MortonCopy<true, PixelFormat::RGBA16UI>, |
| 251 | MortonCopy<true, PixelFormat::R11FG11FB10F>, | 253 | MortonCopy<true, PixelFormat::R11FG11FB10F>, |
| 252 | MortonCopy<true, PixelFormat::RGBA32UI>, | 254 | MortonCopy<true, PixelFormat::RGBA32UI>, |
| @@ -299,6 +301,7 @@ static constexpr std::array<void (*)(u32, u32, u32, std::vector<u8>&, Tegra::GPU | |||
| 299 | MortonCopy<false, PixelFormat::R8>, | 301 | MortonCopy<false, PixelFormat::R8>, |
| 300 | MortonCopy<false, PixelFormat::R8UI>, | 302 | MortonCopy<false, PixelFormat::R8UI>, |
| 301 | MortonCopy<false, PixelFormat::RGBA16F>, | 303 | MortonCopy<false, PixelFormat::RGBA16F>, |
| 304 | MortonCopy<false, PixelFormat::RGBA16U>, | ||
| 302 | MortonCopy<false, PixelFormat::RGBA16UI>, | 305 | MortonCopy<false, PixelFormat::RGBA16UI>, |
| 303 | MortonCopy<false, PixelFormat::R11FG11FB10F>, | 306 | MortonCopy<false, PixelFormat::R11FG11FB10F>, |
| 304 | MortonCopy<false, PixelFormat::RGBA32UI>, | 307 | MortonCopy<false, PixelFormat::RGBA32UI>, |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 630b40e77..36a41522b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -31,47 +31,48 @@ struct SurfaceParams { | |||
| 31 | R8 = 5, | 31 | R8 = 5, |
| 32 | R8UI = 6, | 32 | R8UI = 6, |
| 33 | RGBA16F = 7, | 33 | RGBA16F = 7, |
| 34 | RGBA16UI = 8, | 34 | RGBA16U = 8, |
| 35 | R11FG11FB10F = 9, | 35 | RGBA16UI = 9, |
| 36 | RGBA32UI = 10, | 36 | R11FG11FB10F = 10, |
| 37 | DXT1 = 11, | 37 | RGBA32UI = 11, |
| 38 | DXT23 = 12, | 38 | DXT1 = 12, |
| 39 | DXT45 = 13, | 39 | DXT23 = 13, |
| 40 | DXN1 = 14, // This is also known as BC4 | 40 | DXT45 = 14, |
| 41 | DXN2UNORM = 15, | 41 | DXN1 = 15, // This is also known as BC4 |
| 42 | DXN2SNORM = 16, | 42 | DXN2UNORM = 16, |
| 43 | BC7U = 17, | 43 | DXN2SNORM = 17, |
| 44 | ASTC_2D_4X4 = 18, | 44 | BC7U = 18, |
| 45 | G8R8 = 19, | 45 | ASTC_2D_4X4 = 19, |
| 46 | BGRA8 = 20, | 46 | G8R8 = 20, |
| 47 | RGBA32F = 21, | 47 | BGRA8 = 21, |
| 48 | RG32F = 22, | 48 | RGBA32F = 22, |
| 49 | R32F = 23, | 49 | RG32F = 23, |
| 50 | R16F = 24, | 50 | R32F = 24, |
| 51 | R16UNORM = 25, | 51 | R16F = 25, |
| 52 | R16S = 26, | 52 | R16UNORM = 26, |
| 53 | R16UI = 27, | 53 | R16S = 27, |
| 54 | R16I = 28, | 54 | R16UI = 28, |
| 55 | RG16 = 29, | 55 | R16I = 29, |
| 56 | RG16F = 30, | 56 | RG16 = 30, |
| 57 | RG16UI = 31, | 57 | RG16F = 31, |
| 58 | RG16I = 32, | 58 | RG16UI = 32, |
| 59 | RG16S = 33, | 59 | RG16I = 33, |
| 60 | RGB32F = 34, | 60 | RG16S = 34, |
| 61 | SRGBA8 = 35, | 61 | RGB32F = 35, |
| 62 | RG8U = 36, | 62 | SRGBA8 = 36, |
| 63 | RG8S = 37, | 63 | RG8U = 37, |
| 64 | RG32UI = 38, | 64 | RG8S = 38, |
| 65 | R32UI = 39, | 65 | RG32UI = 39, |
| 66 | R32UI = 40, | ||
| 66 | 67 | ||
| 67 | MaxColorFormat, | 68 | MaxColorFormat, |
| 68 | 69 | ||
| 69 | // DepthStencil formats | 70 | // DepthStencil formats |
| 70 | Z24S8 = 40, | 71 | Z24S8 = 41, |
| 71 | S8Z24 = 41, | 72 | S8Z24 = 42, |
| 72 | Z32F = 42, | 73 | Z32F = 43, |
| 73 | Z16 = 43, | 74 | Z16 = 44, |
| 74 | Z32FS8 = 44, | 75 | Z32FS8 = 45, |
| 75 | 76 | ||
| 76 | MaxDepthStencilFormat, | 77 | MaxDepthStencilFormat, |
| 77 | 78 | ||
| @@ -117,6 +118,7 @@ struct SurfaceParams { | |||
| 117 | 1, // R8 | 118 | 1, // R8 |
| 118 | 1, // R8UI | 119 | 1, // R8UI |
| 119 | 1, // RGBA16F | 120 | 1, // RGBA16F |
| 121 | 1, // RGBA16U | ||
| 120 | 1, // RGBA16UI | 122 | 1, // RGBA16UI |
| 121 | 1, // R11FG11FB10F | 123 | 1, // R11FG11FB10F |
| 122 | 1, // RGBA32UI | 124 | 1, // RGBA32UI |
| @@ -173,6 +175,7 @@ struct SurfaceParams { | |||
| 173 | 8, // R8 | 175 | 8, // R8 |
| 174 | 8, // R8UI | 176 | 8, // R8UI |
| 175 | 64, // RGBA16F | 177 | 64, // RGBA16F |
| 178 | 64, // RGBA16U | ||
| 176 | 64, // RGBA16UI | 179 | 64, // RGBA16UI |
| 177 | 32, // R11FG11FB10F | 180 | 32, // R11FG11FB10F |
| 178 | 128, // RGBA32UI | 181 | 128, // RGBA32UI |
| @@ -253,6 +256,8 @@ struct SurfaceParams { | |||
| 253 | return PixelFormat::A2B10G10R10; | 256 | return PixelFormat::A2B10G10R10; |
| 254 | case Tegra::RenderTargetFormat::RGBA16_FLOAT: | 257 | case Tegra::RenderTargetFormat::RGBA16_FLOAT: |
| 255 | return PixelFormat::RGBA16F; | 258 | return PixelFormat::RGBA16F; |
| 259 | case Tegra::RenderTargetFormat::RGBA16_UNORM: | ||
| 260 | return PixelFormat::RGBA16U; | ||
| 256 | case Tegra::RenderTargetFormat::RGBA16_UINT: | 261 | case Tegra::RenderTargetFormat::RGBA16_UINT: |
| 257 | return PixelFormat::RGBA16UI; | 262 | return PixelFormat::RGBA16UI; |
| 258 | case Tegra::RenderTargetFormat::RGBA32_FLOAT: | 263 | case Tegra::RenderTargetFormat::RGBA32_FLOAT: |
| @@ -469,6 +474,7 @@ struct SurfaceParams { | |||
| 469 | case Tegra::RenderTargetFormat::R16_UNORM: | 474 | case Tegra::RenderTargetFormat::R16_UNORM: |
| 470 | case Tegra::RenderTargetFormat::B5G6R5_UNORM: | 475 | case Tegra::RenderTargetFormat::B5G6R5_UNORM: |
| 471 | case Tegra::RenderTargetFormat::RG8_UNORM: | 476 | case Tegra::RenderTargetFormat::RG8_UNORM: |
| 477 | case Tegra::RenderTargetFormat::RGBA16_UNORM: | ||
| 472 | return ComponentType::UNorm; | 478 | return ComponentType::UNorm; |
| 473 | case Tegra::RenderTargetFormat::RGBA8_SNORM: | 479 | case Tegra::RenderTargetFormat::RGBA8_SNORM: |
| 474 | case Tegra::RenderTargetFormat::RG16_SNORM: | 480 | case Tegra::RenderTargetFormat::RG16_SNORM: |