summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer_cache.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h53
1 files changed, 49 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index 23efbe67c..fc864c56f 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -40,14 +40,18 @@ struct SurfaceParams {
BGRA8 = 15,
RGBA32F = 16,
RG32F = 17,
+ R32F = 18,
+ R16F = 19,
+ R16UNORM = 20,
MaxColorFormat,
// DepthStencil formats
- Z24S8 = 18,
- S8Z24 = 19,
- Z32F = 20,
- Z16 = 21,
+ Z24S8 = 21,
+ S8Z24 = 22,
+ Z32F = 23,
+ Z16 = 24,
+ Z32FS8 = 25,
MaxDepthStencilFormat,
@@ -103,10 +107,14 @@ struct SurfaceParams {
1, // BGRA8
1, // RGBA32F
1, // RG32F
+ 1, // R32F
+ 1, // R16F
+ 1, // R16UNORM
1, // Z24S8
1, // S8Z24
1, // Z32F
1, // Z16
+ 1, // Z32FS8
}};
ASSERT(static_cast<size_t>(format) < compression_factor_table.size());
@@ -136,10 +144,14 @@ struct SurfaceParams {
32, // BGRA8
128, // RGBA32F
64, // RG32F
+ 32, // R32F
+ 16, // R16F
+ 16, // R16UNORM
32, // Z24S8
32, // S8Z24
32, // Z32F
16, // Z16
+ 64, // Z32FS8
}};
ASSERT(static_cast<size_t>(format) < bpp_table.size());
@@ -160,6 +172,8 @@ struct SurfaceParams {
return PixelFormat::Z32F;
case Tegra::DepthFormat::Z16_UNORM:
return PixelFormat::Z16;
+ case Tegra::DepthFormat::Z32_S8_X24_FLOAT:
+ return PixelFormat::Z32FS8;
default:
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
UNREACHABLE();
@@ -185,6 +199,8 @@ struct SurfaceParams {
return PixelFormat::R11FG11FB10F;
case Tegra::RenderTargetFormat::RGBA32_UINT:
return PixelFormat::RGBA32UI;
+ case Tegra::RenderTargetFormat::R8_UNORM:
+ return PixelFormat::R8;
default:
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
UNREACHABLE();
@@ -223,6 +239,22 @@ struct SurfaceParams {
UNREACHABLE();
case Tegra::Texture::TextureFormat::R32_G32:
return PixelFormat::RG32F;
+ case Tegra::Texture::TextureFormat::R16:
+ switch (component_type) {
+ case Tegra::Texture::ComponentType::FLOAT:
+ return PixelFormat::R16F;
+ case Tegra::Texture::ComponentType::UNORM:
+ return PixelFormat::R16UNORM;
+ }
+ LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}",
+ static_cast<u32>(component_type));
+ UNREACHABLE();
+ case Tegra::Texture::TextureFormat::R32:
+ return PixelFormat::R32F;
+ case Tegra::Texture::TextureFormat::ZF32:
+ return PixelFormat::Z32F;
+ case Tegra::Texture::TextureFormat::Z24S8:
+ return PixelFormat::Z24S8;
case Tegra::Texture::TextureFormat::DXT1:
return PixelFormat::DXT1;
case Tegra::Texture::TextureFormat::DXT23:
@@ -283,6 +315,15 @@ struct SurfaceParams {
return Tegra::Texture::TextureFormat::R32_G32_B32_A32;
case PixelFormat::RG32F:
return Tegra::Texture::TextureFormat::R32_G32;
+ case PixelFormat::R32F:
+ return Tegra::Texture::TextureFormat::R32;
+ case PixelFormat::R16F:
+ case PixelFormat::R16UNORM:
+ return Tegra::Texture::TextureFormat::R16;
+ case PixelFormat::Z32F:
+ return Tegra::Texture::TextureFormat::ZF32;
+ case PixelFormat::Z24S8:
+ return Tegra::Texture::TextureFormat::Z24S8;
default:
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
UNREACHABLE();
@@ -299,6 +340,8 @@ struct SurfaceParams {
return Tegra::DepthFormat::Z32_FLOAT;
case PixelFormat::Z16:
return Tegra::DepthFormat::Z16_UNORM;
+ case PixelFormat::Z32FS8:
+ return Tegra::DepthFormat::Z32_S8_X24_FLOAT;
default:
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
UNREACHABLE();
@@ -325,6 +368,7 @@ struct SurfaceParams {
case Tegra::RenderTargetFormat::RGBA8_SRGB:
case Tegra::RenderTargetFormat::BGRA8_UNORM:
case Tegra::RenderTargetFormat::RGB10_A2_UNORM:
+ case Tegra::RenderTargetFormat::R8_UNORM:
return ComponentType::UNorm;
case Tegra::RenderTargetFormat::RGBA16_FLOAT:
case Tegra::RenderTargetFormat::R11G11B10_FLOAT:
@@ -356,6 +400,7 @@ struct SurfaceParams {
case Tegra::DepthFormat::Z24_S8_UNORM:
return ComponentType::UNorm;
case Tegra::DepthFormat::Z32_FLOAT:
+ case Tegra::DepthFormat::Z32_S8_X24_FLOAT:
return ComponentType::Float;
default:
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));