diff options
author | bunnei <bunneidev@gmail.com> | 2018-07-23 23:12:16 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-07-24 03:22:53 +0200 |
commit | 3a19c1098d4d4242ad466f06f2b1df6c17728f4a (patch) | |
tree | 897776d0987cfd35448da78af33b103e97c883c2 /src/video_core/renderer_opengl/gl_rasterizer_cache.h | |
parent | gl_rasterizer_cache: Implement RenderTargetFormat BGRA8_UNORM. (diff) | |
download | yuzu-3a19c1098d4d4242ad466f06f2b1df6c17728f4a.tar yuzu-3a19c1098d4d4242ad466f06f2b1df6c17728f4a.tar.gz yuzu-3a19c1098d4d4242ad466f06f2b1df6c17728f4a.tar.bz2 yuzu-3a19c1098d4d4242ad466f06f2b1df6c17728f4a.tar.lz yuzu-3a19c1098d4d4242ad466f06f2b1df6c17728f4a.tar.xz yuzu-3a19c1098d4d4242ad466f06f2b1df6c17728f4a.tar.zst yuzu-3a19c1098d4d4242ad466f06f2b1df6c17728f4a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index c0f94936e..2feea3d4d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -38,14 +38,15 @@ struct SurfaceParams { ASTC_2D_4X4 = 13, G8R8 = 14, BGRA8 = 15, + RGBA32F = 16, MaxColorFormat, // DepthStencil formats - Z24S8 = 16, - S8Z24 = 17, - Z32F = 18, - Z16 = 19, + Z24S8 = 17, + S8Z24 = 18, + Z32F = 19, + Z16 = 20, MaxDepthStencilFormat, @@ -99,6 +100,7 @@ struct SurfaceParams { 4, // ASTC_2D_4X4 1, // G8R8 1, // BGRA8 + 1, // RGBA32F 1, // Z24S8 1, // S8Z24 1, // Z32F @@ -130,6 +132,7 @@ struct SurfaceParams { 32, // ASTC_2D_4X4 16, // G8R8 32, // BGRA8 + 128, // RGBA32F 32, // Z24S8 32, // S8Z24 32, // Z32F @@ -171,6 +174,8 @@ struct SurfaceParams { return PixelFormat::A2B10G10R10; case Tegra::RenderTargetFormat::RGBA16_FLOAT: return PixelFormat::RGBA16F; + case Tegra::RenderTargetFormat::RGBA32_FLOAT: + return PixelFormat::RGBA32F; case Tegra::RenderTargetFormat::R11G11B10_FLOAT: return PixelFormat::R11FG11FB10F; case Tegra::RenderTargetFormat::RGBA32_UINT: @@ -181,7 +186,8 @@ struct SurfaceParams { } } - static PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format) { + static PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format, + Tegra::Texture::ComponentType component_type) { // TODO(Subv): Properly implement this switch (format) { case Tegra::Texture::TextureFormat::A8R8G8B8: @@ -201,7 +207,15 @@ struct SurfaceParams { case Tegra::Texture::TextureFormat::BF10GF11RF11: return PixelFormat::R11FG11FB10F; case Tegra::Texture::TextureFormat::R32_G32_B32_A32: - return PixelFormat::RGBA32UI; + switch (component_type) { + case Tegra::Texture::ComponentType::FLOAT: + return PixelFormat::RGBA32F; + case Tegra::Texture::ComponentType::UINT: + return PixelFormat::RGBA32UI; + } + LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", + static_cast<u32>(component_type)); + UNREACHABLE(); case Tegra::Texture::TextureFormat::DXT1: return PixelFormat::DXT1; case Tegra::Texture::TextureFormat::DXT23: @@ -215,7 +229,8 @@ struct SurfaceParams { case Tegra::Texture::TextureFormat::ASTC_2D_4X4: return PixelFormat::ASTC_2D_4X4; default: - LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); + LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}", + static_cast<u32>(format), static_cast<u32>(component_type)); UNREACHABLE(); } } @@ -257,6 +272,8 @@ struct SurfaceParams { // TODO(bunnei): This is fine for unswizzling (since we just need the right component // sizes), but could be a bug if we used this function in different ways. return Tegra::Texture::TextureFormat::A8R8G8B8; + case PixelFormat::RGBA32F: + return Tegra::Texture::TextureFormat::R32_G32_B32_A32; default: LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); UNREACHABLE(); @@ -284,6 +301,8 @@ struct SurfaceParams { switch (type) { case Tegra::Texture::ComponentType::UNORM: return ComponentType::UNorm; + case Tegra::Texture::ComponentType::FLOAT: + return ComponentType::Float; default: LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type)); UNREACHABLE(); @@ -300,6 +319,7 @@ struct SurfaceParams { return ComponentType::UNorm; case Tegra::RenderTargetFormat::RGBA16_FLOAT: case Tegra::RenderTargetFormat::R11G11B10_FLOAT: + case Tegra::RenderTargetFormat::RGBA32_FLOAT: return ComponentType::Float; case Tegra::RenderTargetFormat::RGBA32_UINT: return ComponentType::UInt; |