summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index 50a7ab47d..181acfc68 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -255,6 +255,68 @@ struct SurfaceParams {
255 return compression_factor_table[static_cast<std::size_t>(format)]; 255 return compression_factor_table[static_cast<std::size_t>(format)];
256 } 256 }
257 257
258 static constexpr u32 GetDefaultBlockHeight(PixelFormat format) {
259 if (format == PixelFormat::Invalid)
260 return 0;
261 constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
262 1, // ABGR8U
263 1, // ABGR8S
264 1, // ABGR8UI
265 1, // B5G6R5U
266 1, // A2B10G10R10U
267 1, // A1B5G5R5U
268 1, // R8U
269 1, // R8UI
270 1, // RGBA16F
271 1, // RGBA16U
272 1, // RGBA16UI
273 1, // R11FG11FB10F
274 1, // RGBA32UI
275 4, // DXT1
276 4, // DXT23
277 4, // DXT45
278 4, // DXN1
279 4, // DXN2UNORM
280 4, // DXN2SNORM
281 4, // BC7U
282 4, // BC6H_UF16
283 4, // BC6H_SF16
284 4, // ASTC_2D_4X4
285 1, // G8R8U
286 1, // G8R8S
287 1, // BGRA8
288 1, // RGBA32F
289 1, // RG32F
290 1, // R32F
291 1, // R16F
292 1, // R16U
293 1, // R16S
294 1, // R16UI
295 1, // R16I
296 1, // RG16
297 1, // RG16F
298 1, // RG16UI
299 1, // RG16I
300 1, // RG16S
301 1, // RGB32F
302 1, // SRGBA8
303 1, // RG8U
304 1, // RG8S
305 1, // RG32UI
306 1, // R32UI
307 8, // ASTC_2D_8X8
308 5, // ASTC_2D_8X5
309 4, // ASTC_2D_5X4
310 1, // Z32F
311 1, // Z16
312 1, // Z24S8
313 1, // S8Z24
314 1, // Z32FS8
315 }};
316 ASSERT(static_cast<std::size_t>(format) < block_height_table.size());
317 return block_height_table[static_cast<std::size_t>(format)];
318 }
319
258 static constexpr u32 GetFormatBpp(PixelFormat format) { 320 static constexpr u32 GetFormatBpp(PixelFormat format) {
259 if (format == PixelFormat::Invalid) 321 if (format == PixelFormat::Invalid)
260 return 0; 322 return 0;