summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/gpu.cpp65
-rw-r--r--src/video_core/gpu.h6
2 files changed, 0 insertions, 71 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 7d7137109..e8f763ce9 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -140,71 +140,6 @@ void GPU::FlushCommands() {
140 renderer.Rasterizer().FlushCommands(); 140 renderer.Rasterizer().FlushCommands();
141} 141}
142 142
143u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
144 ASSERT(format != RenderTargetFormat::NONE);
145
146 switch (format) {
147 case RenderTargetFormat::RGBA32_FLOAT:
148 case RenderTargetFormat::RGBA32_UINT:
149 return 16;
150 case RenderTargetFormat::RGBA16_UINT:
151 case RenderTargetFormat::RGBA16_UNORM:
152 case RenderTargetFormat::RGBA16_FLOAT:
153 case RenderTargetFormat::RGBX16_FLOAT:
154 case RenderTargetFormat::RG32_FLOAT:
155 case RenderTargetFormat::RG32_UINT:
156 return 8;
157 case RenderTargetFormat::RGBA8_UNORM:
158 case RenderTargetFormat::RGBA8_SNORM:
159 case RenderTargetFormat::RGBA8_SRGB:
160 case RenderTargetFormat::RGBA8_UINT:
161 case RenderTargetFormat::RGB10_A2_UNORM:
162 case RenderTargetFormat::BGRA8_UNORM:
163 case RenderTargetFormat::BGRA8_SRGB:
164 case RenderTargetFormat::RG16_UNORM:
165 case RenderTargetFormat::RG16_SNORM:
166 case RenderTargetFormat::RG16_UINT:
167 case RenderTargetFormat::RG16_SINT:
168 case RenderTargetFormat::RG16_FLOAT:
169 case RenderTargetFormat::R32_FLOAT:
170 case RenderTargetFormat::R11G11B10_FLOAT:
171 case RenderTargetFormat::R32_UINT:
172 return 4;
173 case RenderTargetFormat::R16_UNORM:
174 case RenderTargetFormat::R16_SNORM:
175 case RenderTargetFormat::R16_UINT:
176 case RenderTargetFormat::R16_SINT:
177 case RenderTargetFormat::R16_FLOAT:
178 case RenderTargetFormat::RG8_UNORM:
179 case RenderTargetFormat::RG8_SNORM:
180 return 2;
181 case RenderTargetFormat::R8_UNORM:
182 case RenderTargetFormat::R8_UINT:
183 return 1;
184 default:
185 UNIMPLEMENTED_MSG("Unimplemented render target format {}", static_cast<u32>(format));
186 return 1;
187 }
188}
189
190u32 DepthFormatBytesPerPixel(DepthFormat format) {
191 switch (format) {
192 case DepthFormat::Z32_S8_X24_FLOAT:
193 return 8;
194 case DepthFormat::Z32_FLOAT:
195 case DepthFormat::S8_Z24_UNORM:
196 case DepthFormat::Z24_X8_UNORM:
197 case DepthFormat::Z24_S8_UNORM:
198 case DepthFormat::Z24_C8_UNORM:
199 return 4;
200 case DepthFormat::Z16_UNORM:
201 return 2;
202 default:
203 UNIMPLEMENTED_MSG("Unimplemented Depth format {}", static_cast<u32>(format));
204 return 1;
205 }
206}
207
208// Note that, traditionally, methods are treated as 4-byte addressable locations, and hence 143// Note that, traditionally, methods are treated as 4-byte addressable locations, and hence
209// their numbers are written down multiplied by 4 in Docs. Here we are not multiply by 4. 144// their numbers are written down multiplied by 4 in Docs. Here we are not multiply by 4.
210// So the values you see in docs might be multiplied by 4. 145// So the values you see in docs might be multiplied by 4.
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index d220327f5..ba8c9d665 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -83,12 +83,6 @@ enum class DepthFormat : u32 {
83 Z32_S8_X24_FLOAT = 0x19, 83 Z32_S8_X24_FLOAT = 0x19,
84}; 84};
85 85
86/// Returns the number of bytes per pixel of each rendertarget format.
87u32 RenderTargetBytesPerPixel(RenderTargetFormat format);
88
89/// Returns the number of bytes per pixel of each depth format.
90u32 DepthFormatBytesPerPixel(DepthFormat format);
91
92struct CommandListHeader; 86struct CommandListHeader;
93class DebugContext; 87class DebugContext;
94 88