diff options
| author | 2019-03-13 16:16:45 -0300 | |
|---|---|---|
| committer | 2019-03-13 16:16:45 -0300 | |
| commit | 9030a8259ffa4c8aa120874eaaa8fa21d0e34197 (patch) | |
| tree | 87efe8375ad716d2c1c506bc83c382cae906d73d /src | |
| parent | video_core/morton: Remove unused functions (diff) | |
| download | yuzu-9030a8259ffa4c8aa120874eaaa8fa21d0e34197.tar.gz yuzu-9030a8259ffa4c8aa120874eaaa8fa21d0e34197.tar.xz yuzu-9030a8259ffa4c8aa120874eaaa8fa21d0e34197.zip | |
video_core/morton: Remove clang-format off when it's not needed
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/morton.cpp | 262 |
1 files changed, 129 insertions, 133 deletions
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp index 69b6be73a..96a3c99b3 100644 --- a/src/video_core/morton.cpp +++ b/src/video_core/morton.cpp | |||
| @@ -42,142 +42,138 @@ static void MortonCopy(u32 stride, u32 block_height, u32 height, u32 block_depth | |||
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | static constexpr ConversionArray morton_to_linear_fns = { | 44 | static constexpr ConversionArray morton_to_linear_fns = { |
| 45 | // clang-format off | 45 | MortonCopy<true, PixelFormat::ABGR8U>, |
| 46 | MortonCopy<true, PixelFormat::ABGR8U>, | 46 | MortonCopy<true, PixelFormat::ABGR8S>, |
| 47 | MortonCopy<true, PixelFormat::ABGR8S>, | 47 | MortonCopy<true, PixelFormat::ABGR8UI>, |
| 48 | MortonCopy<true, PixelFormat::ABGR8UI>, | 48 | MortonCopy<true, PixelFormat::B5G6R5U>, |
| 49 | MortonCopy<true, PixelFormat::B5G6R5U>, | 49 | MortonCopy<true, PixelFormat::A2B10G10R10U>, |
| 50 | MortonCopy<true, PixelFormat::A2B10G10R10U>, | 50 | MortonCopy<true, PixelFormat::A1B5G5R5U>, |
| 51 | MortonCopy<true, PixelFormat::A1B5G5R5U>, | 51 | MortonCopy<true, PixelFormat::R8U>, |
| 52 | MortonCopy<true, PixelFormat::R8U>, | 52 | MortonCopy<true, PixelFormat::R8UI>, |
| 53 | MortonCopy<true, PixelFormat::R8UI>, | 53 | MortonCopy<true, PixelFormat::RGBA16F>, |
| 54 | MortonCopy<true, PixelFormat::RGBA16F>, | 54 | MortonCopy<true, PixelFormat::RGBA16U>, |
| 55 | MortonCopy<true, PixelFormat::RGBA16U>, | 55 | MortonCopy<true, PixelFormat::RGBA16UI>, |
| 56 | MortonCopy<true, PixelFormat::RGBA16UI>, | 56 | MortonCopy<true, PixelFormat::R11FG11FB10F>, |
| 57 | MortonCopy<true, PixelFormat::R11FG11FB10F>, | 57 | MortonCopy<true, PixelFormat::RGBA32UI>, |
| 58 | MortonCopy<true, PixelFormat::RGBA32UI>, | 58 | MortonCopy<true, PixelFormat::DXT1>, |
| 59 | MortonCopy<true, PixelFormat::DXT1>, | 59 | MortonCopy<true, PixelFormat::DXT23>, |
| 60 | MortonCopy<true, PixelFormat::DXT23>, | 60 | MortonCopy<true, PixelFormat::DXT45>, |
| 61 | MortonCopy<true, PixelFormat::DXT45>, | 61 | MortonCopy<true, PixelFormat::DXN1>, |
| 62 | MortonCopy<true, PixelFormat::DXN1>, | 62 | MortonCopy<true, PixelFormat::DXN2UNORM>, |
| 63 | MortonCopy<true, PixelFormat::DXN2UNORM>, | 63 | MortonCopy<true, PixelFormat::DXN2SNORM>, |
| 64 | MortonCopy<true, PixelFormat::DXN2SNORM>, | 64 | MortonCopy<true, PixelFormat::BC7U>, |
| 65 | MortonCopy<true, PixelFormat::BC7U>, | 65 | MortonCopy<true, PixelFormat::BC6H_UF16>, |
| 66 | MortonCopy<true, PixelFormat::BC6H_UF16>, | 66 | MortonCopy<true, PixelFormat::BC6H_SF16>, |
| 67 | MortonCopy<true, PixelFormat::BC6H_SF16>, | 67 | MortonCopy<true, PixelFormat::ASTC_2D_4X4>, |
| 68 | MortonCopy<true, PixelFormat::ASTC_2D_4X4>, | 68 | MortonCopy<true, PixelFormat::BGRA8>, |
| 69 | MortonCopy<true, PixelFormat::BGRA8>, | 69 | MortonCopy<true, PixelFormat::RGBA32F>, |
| 70 | MortonCopy<true, PixelFormat::RGBA32F>, | 70 | MortonCopy<true, PixelFormat::RG32F>, |
| 71 | MortonCopy<true, PixelFormat::RG32F>, | 71 | MortonCopy<true, PixelFormat::R32F>, |
| 72 | MortonCopy<true, PixelFormat::R32F>, | 72 | MortonCopy<true, PixelFormat::R16F>, |
| 73 | MortonCopy<true, PixelFormat::R16F>, | 73 | MortonCopy<true, PixelFormat::R16U>, |
| 74 | MortonCopy<true, PixelFormat::R16U>, | 74 | MortonCopy<true, PixelFormat::R16S>, |
| 75 | MortonCopy<true, PixelFormat::R16S>, | 75 | MortonCopy<true, PixelFormat::R16UI>, |
| 76 | MortonCopy<true, PixelFormat::R16UI>, | 76 | MortonCopy<true, PixelFormat::R16I>, |
| 77 | MortonCopy<true, PixelFormat::R16I>, | 77 | MortonCopy<true, PixelFormat::RG16>, |
| 78 | MortonCopy<true, PixelFormat::RG16>, | 78 | MortonCopy<true, PixelFormat::RG16F>, |
| 79 | MortonCopy<true, PixelFormat::RG16F>, | 79 | MortonCopy<true, PixelFormat::RG16UI>, |
| 80 | MortonCopy<true, PixelFormat::RG16UI>, | 80 | MortonCopy<true, PixelFormat::RG16I>, |
| 81 | MortonCopy<true, PixelFormat::RG16I>, | 81 | MortonCopy<true, PixelFormat::RG16S>, |
| 82 | MortonCopy<true, PixelFormat::RG16S>, | 82 | MortonCopy<true, PixelFormat::RGB32F>, |
| 83 | MortonCopy<true, PixelFormat::RGB32F>, | 83 | MortonCopy<true, PixelFormat::RGBA8_SRGB>, |
| 84 | MortonCopy<true, PixelFormat::RGBA8_SRGB>, | 84 | MortonCopy<true, PixelFormat::RG8U>, |
| 85 | MortonCopy<true, PixelFormat::RG8U>, | 85 | MortonCopy<true, PixelFormat::RG8S>, |
| 86 | MortonCopy<true, PixelFormat::RG8S>, | 86 | MortonCopy<true, PixelFormat::RG32UI>, |
| 87 | MortonCopy<true, PixelFormat::RG32UI>, | 87 | MortonCopy<true, PixelFormat::R32UI>, |
| 88 | MortonCopy<true, PixelFormat::R32UI>, | 88 | MortonCopy<true, PixelFormat::ASTC_2D_8X8>, |
| 89 | MortonCopy<true, PixelFormat::ASTC_2D_8X8>, | 89 | MortonCopy<true, PixelFormat::ASTC_2D_8X5>, |
| 90 | MortonCopy<true, PixelFormat::ASTC_2D_8X5>, | 90 | MortonCopy<true, PixelFormat::ASTC_2D_5X4>, |
| 91 | MortonCopy<true, PixelFormat::ASTC_2D_5X4>, | 91 | MortonCopy<true, PixelFormat::BGRA8_SRGB>, |
| 92 | MortonCopy<true, PixelFormat::BGRA8_SRGB>, | 92 | MortonCopy<true, PixelFormat::DXT1_SRGB>, |
| 93 | MortonCopy<true, PixelFormat::DXT1_SRGB>, | 93 | MortonCopy<true, PixelFormat::DXT23_SRGB>, |
| 94 | MortonCopy<true, PixelFormat::DXT23_SRGB>, | 94 | MortonCopy<true, PixelFormat::DXT45_SRGB>, |
| 95 | MortonCopy<true, PixelFormat::DXT45_SRGB>, | 95 | MortonCopy<true, PixelFormat::BC7U_SRGB>, |
| 96 | MortonCopy<true, PixelFormat::BC7U_SRGB>, | 96 | MortonCopy<true, PixelFormat::ASTC_2D_4X4_SRGB>, |
| 97 | MortonCopy<true, PixelFormat::ASTC_2D_4X4_SRGB>, | 97 | MortonCopy<true, PixelFormat::ASTC_2D_8X8_SRGB>, |
| 98 | MortonCopy<true, PixelFormat::ASTC_2D_8X8_SRGB>, | 98 | MortonCopy<true, PixelFormat::ASTC_2D_8X5_SRGB>, |
| 99 | MortonCopy<true, PixelFormat::ASTC_2D_8X5_SRGB>, | 99 | MortonCopy<true, PixelFormat::ASTC_2D_5X4_SRGB>, |
| 100 | MortonCopy<true, PixelFormat::ASTC_2D_5X4_SRGB>, | 100 | MortonCopy<true, PixelFormat::ASTC_2D_5X5>, |
| 101 | MortonCopy<true, PixelFormat::ASTC_2D_5X5>, | 101 | MortonCopy<true, PixelFormat::ASTC_2D_5X5_SRGB>, |
| 102 | MortonCopy<true, PixelFormat::ASTC_2D_5X5_SRGB>, | 102 | MortonCopy<true, PixelFormat::ASTC_2D_10X8>, |
| 103 | MortonCopy<true, PixelFormat::ASTC_2D_10X8>, | 103 | MortonCopy<true, PixelFormat::ASTC_2D_10X8_SRGB>, |
| 104 | MortonCopy<true, PixelFormat::ASTC_2D_10X8_SRGB>, | 104 | MortonCopy<true, PixelFormat::Z32F>, |
| 105 | MortonCopy<true, PixelFormat::Z32F>, | 105 | MortonCopy<true, PixelFormat::Z16>, |
| 106 | MortonCopy<true, PixelFormat::Z16>, | 106 | MortonCopy<true, PixelFormat::Z24S8>, |
| 107 | MortonCopy<true, PixelFormat::Z24S8>, | 107 | MortonCopy<true, PixelFormat::S8Z24>, |
| 108 | MortonCopy<true, PixelFormat::S8Z24>, | 108 | MortonCopy<true, PixelFormat::Z32FS8>, |
| 109 | MortonCopy<true, PixelFormat::Z32FS8>, | ||
| 110 | // clang-format on | ||
| 111 | }; | 109 | }; |
| 112 | 110 | ||
| 113 | static constexpr ConversionArray linear_to_morton_fns = { | 111 | static constexpr ConversionArray linear_to_morton_fns = { |
| 114 | // clang-format off | 112 | MortonCopy<false, PixelFormat::ABGR8U>, |
| 115 | MortonCopy<false, PixelFormat::ABGR8U>, | 113 | MortonCopy<false, PixelFormat::ABGR8S>, |
| 116 | MortonCopy<false, PixelFormat::ABGR8S>, | 114 | MortonCopy<false, PixelFormat::ABGR8UI>, |
| 117 | MortonCopy<false, PixelFormat::ABGR8UI>, | 115 | MortonCopy<false, PixelFormat::B5G6R5U>, |
| 118 | MortonCopy<false, PixelFormat::B5G6R5U>, | 116 | MortonCopy<false, PixelFormat::A2B10G10R10U>, |
| 119 | MortonCopy<false, PixelFormat::A2B10G10R10U>, | 117 | MortonCopy<false, PixelFormat::A1B5G5R5U>, |
| 120 | MortonCopy<false, PixelFormat::A1B5G5R5U>, | 118 | MortonCopy<false, PixelFormat::R8U>, |
| 121 | MortonCopy<false, PixelFormat::R8U>, | 119 | MortonCopy<false, PixelFormat::R8UI>, |
| 122 | MortonCopy<false, PixelFormat::R8UI>, | 120 | MortonCopy<false, PixelFormat::RGBA16F>, |
| 123 | MortonCopy<false, PixelFormat::RGBA16F>, | 121 | MortonCopy<false, PixelFormat::RGBA16U>, |
| 124 | MortonCopy<false, PixelFormat::RGBA16U>, | 122 | MortonCopy<false, PixelFormat::RGBA16UI>, |
| 125 | MortonCopy<false, PixelFormat::RGBA16UI>, | 123 | MortonCopy<false, PixelFormat::R11FG11FB10F>, |
| 126 | MortonCopy<false, PixelFormat::R11FG11FB10F>, | 124 | MortonCopy<false, PixelFormat::RGBA32UI>, |
| 127 | MortonCopy<false, PixelFormat::RGBA32UI>, | 125 | MortonCopy<false, PixelFormat::DXT1>, |
| 128 | MortonCopy<false, PixelFormat::DXT1>, | 126 | MortonCopy<false, PixelFormat::DXT23>, |
| 129 | MortonCopy<false, PixelFormat::DXT23>, | 127 | MortonCopy<false, PixelFormat::DXT45>, |
| 130 | MortonCopy<false, PixelFormat::DXT45>, | 128 | MortonCopy<false, PixelFormat::DXN1>, |
| 131 | MortonCopy<false, PixelFormat::DXN1>, | 129 | MortonCopy<false, PixelFormat::DXN2UNORM>, |
| 132 | MortonCopy<false, PixelFormat::DXN2UNORM>, | 130 | MortonCopy<false, PixelFormat::DXN2SNORM>, |
| 133 | MortonCopy<false, PixelFormat::DXN2SNORM>, | 131 | MortonCopy<false, PixelFormat::BC7U>, |
| 134 | MortonCopy<false, PixelFormat::BC7U>, | 132 | MortonCopy<false, PixelFormat::BC6H_UF16>, |
| 135 | MortonCopy<false, PixelFormat::BC6H_UF16>, | 133 | MortonCopy<false, PixelFormat::BC6H_SF16>, |
| 136 | MortonCopy<false, PixelFormat::BC6H_SF16>, | 134 | // TODO(Subv): Swizzling ASTC formats are not supported |
| 137 | // TODO(Subv): Swizzling ASTC formats are not supported | 135 | nullptr, |
| 138 | nullptr, | 136 | MortonCopy<false, PixelFormat::BGRA8>, |
| 139 | MortonCopy<false, PixelFormat::BGRA8>, | 137 | MortonCopy<false, PixelFormat::RGBA32F>, |
| 140 | MortonCopy<false, PixelFormat::RGBA32F>, | 138 | MortonCopy<false, PixelFormat::RG32F>, |
| 141 | MortonCopy<false, PixelFormat::RG32F>, | 139 | MortonCopy<false, PixelFormat::R32F>, |
| 142 | MortonCopy<false, PixelFormat::R32F>, | 140 | MortonCopy<false, PixelFormat::R16F>, |
| 143 | MortonCopy<false, PixelFormat::R16F>, | 141 | MortonCopy<false, PixelFormat::R16U>, |
| 144 | MortonCopy<false, PixelFormat::R16U>, | 142 | MortonCopy<false, PixelFormat::R16S>, |
| 145 | MortonCopy<false, PixelFormat::R16S>, | 143 | MortonCopy<false, PixelFormat::R16UI>, |
| 146 | MortonCopy<false, PixelFormat::R16UI>, | 144 | MortonCopy<false, PixelFormat::R16I>, |
| 147 | MortonCopy<false, PixelFormat::R16I>, | 145 | MortonCopy<false, PixelFormat::RG16>, |
| 148 | MortonCopy<false, PixelFormat::RG16>, | 146 | MortonCopy<false, PixelFormat::RG16F>, |
| 149 | MortonCopy<false, PixelFormat::RG16F>, | 147 | MortonCopy<false, PixelFormat::RG16UI>, |
| 150 | MortonCopy<false, PixelFormat::RG16UI>, | 148 | MortonCopy<false, PixelFormat::RG16I>, |
| 151 | MortonCopy<false, PixelFormat::RG16I>, | 149 | MortonCopy<false, PixelFormat::RG16S>, |
| 152 | MortonCopy<false, PixelFormat::RG16S>, | 150 | MortonCopy<false, PixelFormat::RGB32F>, |
| 153 | MortonCopy<false, PixelFormat::RGB32F>, | 151 | MortonCopy<false, PixelFormat::RGBA8_SRGB>, |
| 154 | MortonCopy<false, PixelFormat::RGBA8_SRGB>, | 152 | MortonCopy<false, PixelFormat::RG8U>, |
| 155 | MortonCopy<false, PixelFormat::RG8U>, | 153 | MortonCopy<false, PixelFormat::RG8S>, |
| 156 | MortonCopy<false, PixelFormat::RG8S>, | 154 | MortonCopy<false, PixelFormat::RG32UI>, |
| 157 | MortonCopy<false, PixelFormat::RG32UI>, | 155 | MortonCopy<false, PixelFormat::R32UI>, |
| 158 | MortonCopy<false, PixelFormat::R32UI>, | 156 | nullptr, |
| 159 | nullptr, | 157 | nullptr, |
| 160 | nullptr, | 158 | nullptr, |
| 161 | nullptr, | 159 | MortonCopy<false, PixelFormat::BGRA8_SRGB>, |
| 162 | MortonCopy<false, PixelFormat::BGRA8_SRGB>, | 160 | MortonCopy<false, PixelFormat::DXT1_SRGB>, |
| 163 | MortonCopy<false, PixelFormat::DXT1_SRGB>, | 161 | MortonCopy<false, PixelFormat::DXT23_SRGB>, |
| 164 | MortonCopy<false, PixelFormat::DXT23_SRGB>, | 162 | MortonCopy<false, PixelFormat::DXT45_SRGB>, |
| 165 | MortonCopy<false, PixelFormat::DXT45_SRGB>, | 163 | MortonCopy<false, PixelFormat::BC7U_SRGB>, |
| 166 | MortonCopy<false, PixelFormat::BC7U_SRGB>, | 164 | nullptr, |
| 167 | nullptr, | 165 | nullptr, |
| 168 | nullptr, | 166 | nullptr, |
| 169 | nullptr, | 167 | nullptr, |
| 170 | nullptr, | 168 | nullptr, |
| 171 | nullptr, | 169 | nullptr, |
| 172 | nullptr, | 170 | nullptr, |
| 173 | nullptr, | 171 | nullptr, |
| 174 | nullptr, | 172 | MortonCopy<false, PixelFormat::Z32F>, |
| 175 | MortonCopy<false, PixelFormat::Z32F>, | 173 | MortonCopy<false, PixelFormat::Z16>, |
| 176 | MortonCopy<false, PixelFormat::Z16>, | 174 | MortonCopy<false, PixelFormat::Z24S8>, |
| 177 | MortonCopy<false, PixelFormat::Z24S8>, | 175 | MortonCopy<false, PixelFormat::S8Z24>, |
| 178 | MortonCopy<false, PixelFormat::S8Z24>, | 176 | MortonCopy<false, PixelFormat::Z32FS8>, |
| 179 | MortonCopy<false, PixelFormat::Z32FS8>, | ||
| 180 | // clang-format on | ||
| 181 | }; | 177 | }; |
| 182 | 178 | ||
| 183 | static MortonCopyFn GetSwizzleFunction(MortonSwizzleMode mode, Surface::PixelFormat format) { | 179 | static MortonCopyFn GetSwizzleFunction(MortonSwizzleMode mode, Surface::PixelFormat format) { |