summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2022-05-13 00:40:12 -0400
committerGravatar Morph2022-05-13 00:51:11 -0400
commit370d3fa1e3114662a6e28e41b3d0a412d860d1a3 (patch)
treeb343fc8366016e07cc8a8cbc976d000db932c94b
parentcodecs/vp9: Use u8 for norm and map luts (diff)
downloadyuzu-370d3fa1e3114662a6e28e41b3d0a412d860d1a3.tar.gz
yuzu-370d3fa1e3114662a6e28e41b3d0a412d860d1a3.tar.xz
yuzu-370d3fa1e3114662a6e28e41b3d0a412d860d1a3.zip
video_core/surface: Use u8 for PixelFormat block tables
Using this smaller type saves 33280 bytes in the compiled executable.
-rw-r--r--src/video_core/surface.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index 86fea61ae..75e055592 100644
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -147,7 +147,7 @@ enum class SurfaceTarget {
147 TextureCubeArray, 147 TextureCubeArray,
148}; 148};
149 149
150constexpr std::array<u32, MaxPixelFormat> BLOCK_WIDTH_TABLE = {{ 150constexpr std::array<u8, MaxPixelFormat> BLOCK_WIDTH_TABLE = {{
151 1, // A8B8G8R8_UNORM 151 1, // A8B8G8R8_UNORM
152 1, // A8B8G8R8_SNORM 152 1, // A8B8G8R8_SNORM
153 1, // A8B8G8R8_SINT 153 1, // A8B8G8R8_SINT
@@ -249,7 +249,7 @@ constexpr u32 DefaultBlockWidth(PixelFormat format) {
249 return BLOCK_WIDTH_TABLE[static_cast<std::size_t>(format)]; 249 return BLOCK_WIDTH_TABLE[static_cast<std::size_t>(format)];
250} 250}
251 251
252constexpr std::array<u32, MaxPixelFormat> BLOCK_HEIGHT_TABLE = {{ 252constexpr std::array<u8, MaxPixelFormat> BLOCK_HEIGHT_TABLE = {{
253 1, // A8B8G8R8_UNORM 253 1, // A8B8G8R8_UNORM
254 1, // A8B8G8R8_SNORM 254 1, // A8B8G8R8_SNORM
255 1, // A8B8G8R8_SINT 255 1, // A8B8G8R8_SINT
@@ -351,7 +351,7 @@ constexpr u32 DefaultBlockHeight(PixelFormat format) {
351 return BLOCK_HEIGHT_TABLE[static_cast<std::size_t>(format)]; 351 return BLOCK_HEIGHT_TABLE[static_cast<std::size_t>(format)];
352} 352}
353 353
354constexpr std::array<u32, MaxPixelFormat> BITS_PER_BLOCK_TABLE = {{ 354constexpr std::array<u8, MaxPixelFormat> BITS_PER_BLOCK_TABLE = {{
355 32, // A8B8G8R8_UNORM 355 32, // A8B8G8R8_UNORM
356 32, // A8B8G8R8_SNORM 356 32, // A8B8G8R8_SNORM
357 32, // A8B8G8R8_SINT 357 32, // A8B8G8R8_SINT