summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 4ff4d71c5..b90937d17 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -34,19 +34,51 @@ u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
34 34
35 switch (format) { 35 switch (format) {
36 case RenderTargetFormat::RGBA32_FLOAT: 36 case RenderTargetFormat::RGBA32_FLOAT:
37 case RenderTargetFormat::RGBA32_UINT:
37 return 16; 38 return 16;
38 case RenderTargetFormat::RGBA16_FLOAT: 39 case RenderTargetFormat::RGBA16_FLOAT:
39 case RenderTargetFormat::RG32_FLOAT: 40 case RenderTargetFormat::RG32_FLOAT:
40 return 8; 41 return 8;
41 case RenderTargetFormat::RGBA8_UNORM: 42 case RenderTargetFormat::RGBA8_UNORM:
43 case RenderTargetFormat::RGBA8_SRGB:
42 case RenderTargetFormat::RGB10_A2_UNORM: 44 case RenderTargetFormat::RGB10_A2_UNORM:
43 case RenderTargetFormat::BGRA8_UNORM: 45 case RenderTargetFormat::BGRA8_UNORM:
46 case RenderTargetFormat::RG16_UNORM:
47 case RenderTargetFormat::RG16_SNORM:
48 case RenderTargetFormat::RG16_UINT:
49 case RenderTargetFormat::RG16_SINT:
50 case RenderTargetFormat::RG16_FLOAT:
44 case RenderTargetFormat::R32_FLOAT: 51 case RenderTargetFormat::R32_FLOAT:
45 case RenderTargetFormat::R11G11B10_FLOAT: 52 case RenderTargetFormat::R11G11B10_FLOAT:
46 return 4; 53 return 4;
54 case RenderTargetFormat::R16_UNORM:
55 case RenderTargetFormat::R16_SNORM:
56 case RenderTargetFormat::R16_UINT:
57 case RenderTargetFormat::R16_SINT:
58 case RenderTargetFormat::R16_FLOAT:
59 return 2;
60 case RenderTargetFormat::R8_UNORM:
61 return 1;
47 default: 62 default:
48 UNIMPLEMENTED_MSG("Unimplemented render target format {}", static_cast<u32>(format)); 63 UNIMPLEMENTED_MSG("Unimplemented render target format {}", static_cast<u32>(format));
49 } 64 }
50} 65}
51 66
67u32 DepthFormatBytesPerPixel(DepthFormat format) {
68 switch (format) {
69 case DepthFormat::Z32_S8_X24_FLOAT:
70 return 8;
71 case DepthFormat::Z32_FLOAT:
72 case DepthFormat::S8_Z24_UNORM:
73 case DepthFormat::Z24_X8_UNORM:
74 case DepthFormat::Z24_S8_UNORM:
75 case DepthFormat::Z24_C8_UNORM:
76 return 4;
77 case DepthFormat::Z16_UNORM:
78 return 2;
79 default:
80 UNIMPLEMENTED_MSG("Unimplemented Depth format {}", static_cast<u32>(format));
81 }
82}
83
52} // namespace Tegra 84} // namespace Tegra