summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ameerj2021-06-19 10:56:13 -0400
committerGravatar ameerj2021-06-19 10:56:13 -0400
commitace20ba4a4774ae3c42f2ef5566c7113f3b980b3 (patch)
tree088a7d63269fcd65e84d465cc2c821662674cffc
parentastc: Various robustness enhancements for the gpu decoder (diff)
downloadyuzu-ace20ba4a4774ae3c42f2ef5566c7113f3b980b3.tar.gz
yuzu-ace20ba4a4774ae3c42f2ef5566c7113f3b980b3.tar.xz
yuzu-ace20ba4a4774ae3c42f2ef5566c7113f3b980b3.zip
astc_decoder.comp: Remove unnecessary LUT SSBOs
We can move them to instead be compile time constants within the shader.
-rw-r--r--src/video_core/host_shaders/astc_decoder.comp35
-rw-r--r--src/video_core/renderer_opengl/util_shaders.cpp21
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pass.cpp74
-rw-r--r--src/video_core/textures/astc.cpp8
-rw-r--r--src/video_core/textures/astc.h9
5 files changed, 34 insertions, 113 deletions
diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp
index 71327e233..c37f15bfd 100644
--- a/src/video_core/host_shaders/astc_decoder.comp
+++ b/src/video_core/host_shaders/astc_decoder.comp
@@ -11,11 +11,8 @@
11#define UNIFORM(n) 11#define UNIFORM(n)
12#define BINDING_INPUT_BUFFER 0 12#define BINDING_INPUT_BUFFER 0
13#define BINDING_ENC_BUFFER 1 13#define BINDING_ENC_BUFFER 1
14#define BINDING_6_TO_8_BUFFER 2 14#define BINDING_SWIZZLE_BUFFER 2
15#define BINDING_7_TO_8_BUFFER 3 15#define BINDING_OUTPUT_IMAGE 3
16#define BINDING_8_TO_8_BUFFER 4
17#define BINDING_SWIZZLE_BUFFER 5
18#define BINDING_OUTPUT_IMAGE 6
19 16
20#else // ^^^ Vulkan ^^^ // vvv OpenGL vvv 17#else // ^^^ Vulkan ^^^ // vvv OpenGL vvv
21 18
@@ -25,9 +22,6 @@
25#define BINDING_SWIZZLE_BUFFER 0 22#define BINDING_SWIZZLE_BUFFER 0
26#define BINDING_INPUT_BUFFER 1 23#define BINDING_INPUT_BUFFER 1
27#define BINDING_ENC_BUFFER 2 24#define BINDING_ENC_BUFFER 2
28#define BINDING_6_TO_8_BUFFER 3
29#define BINDING_7_TO_8_BUFFER 4
30#define BINDING_8_TO_8_BUFFER 5
31#define BINDING_OUTPUT_IMAGE 0 25#define BINDING_OUTPUT_IMAGE 0
32 26
33#endif 27#endif
@@ -74,16 +68,6 @@ layout(binding = BINDING_INPUT_BUFFER, std430) readonly buffer InputBufferU32 {
74layout(binding = BINDING_ENC_BUFFER, std430) readonly buffer EncodingsValues { 68layout(binding = BINDING_ENC_BUFFER, std430) readonly buffer EncodingsValues {
75 EncodingData encoding_values[]; 69 EncodingData encoding_values[];
76}; 70};
77// ASTC Precompiled tables
78layout(binding = BINDING_6_TO_8_BUFFER, std430) readonly buffer REPLICATE_6_BIT_TO_8 {
79 uint REPLICATE_6_BIT_TO_8_TABLE[];
80};
81layout(binding = BINDING_7_TO_8_BUFFER, std430) readonly buffer REPLICATE_7_BIT_TO_8 {
82 uint REPLICATE_7_BIT_TO_8_TABLE[];
83};
84layout(binding = BINDING_8_TO_8_BUFFER, std430) readonly buffer REPLICATE_8_BIT_TO_8 {
85 uint REPLICATE_8_BIT_TO_8_TABLE[];
86};
87 71
88layout(binding = BINDING_OUTPUT_IMAGE, rgba8) uniform writeonly image2DArray dest_image; 72layout(binding = BINDING_OUTPUT_IMAGE, rgba8) uniform writeonly image2DArray dest_image;
89 73
@@ -134,6 +118,19 @@ const uint REPLICATE_4_BIT_TO_6_TABLE[16] =
134const uint REPLICATE_5_BIT_TO_6_TABLE[32] = 118const uint REPLICATE_5_BIT_TO_6_TABLE[32] =
135 uint[](0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 33, 35, 37, 39, 41, 43, 45, 119 uint[](0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 33, 35, 37, 39, 41, 43, 45,
136 47, 49, 51, 53, 55, 57, 59, 61, 63); 120 47, 49, 51, 53, 55, 57, 59, 61, 63);
121const uint REPLICATE_6_BIT_TO_8_TABLE[64] =
122 uint[](0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 65, 69, 73, 77, 81, 85, 89,
123 93, 97, 101, 105, 109, 113, 117, 121, 125, 130, 134, 138, 142, 146, 150, 154, 158, 162,
124 166, 170, 174, 178, 182, 186, 190, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235,
125 239, 243, 247, 251, 255);
126const uint REPLICATE_7_BIT_TO_8_TABLE[128] =
127 uint[](0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44,
128 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88,
129 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126,
130 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163,
131 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 197, 199,
132 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235,
133 237, 239, 241, 243, 245, 247, 249, 251, 253, 255);
137 134
138// Input ASTC texture globals 135// Input ASTC texture globals
139uint current_index = 0; 136uint current_index = 0;
@@ -230,7 +227,7 @@ uint FastReplicateTo8(uint value, uint num_bits) {
230 case 7: 227 case 7:
231 return REPLICATE_7_BIT_TO_8_TABLE[value]; 228 return REPLICATE_7_BIT_TO_8_TABLE[value];
232 case 8: 229 case 8:
233 return REPLICATE_8_BIT_TO_8_TABLE[value]; 230 return value;
234 } 231 }
235 return Replicate(value, num_bits, 8); 232 return Replicate(value, num_bits, 8);
236} 233}
diff --git a/src/video_core/renderer_opengl/util_shaders.cpp b/src/video_core/renderer_opengl/util_shaders.cpp
index d57998cdc..7e32f49ca 100644
--- a/src/video_core/renderer_opengl/util_shaders.cpp
+++ b/src/video_core/renderer_opengl/util_shaders.cpp
@@ -69,7 +69,8 @@ UtilShaders::UtilShaders(ProgramManager& program_manager_)
69 swizzle_table_buffer.Create(); 69 swizzle_table_buffer.Create();
70 astc_buffer.Create(); 70 astc_buffer.Create();
71 glNamedBufferStorage(swizzle_table_buffer.handle, sizeof(swizzle_table), &swizzle_table, 0); 71 glNamedBufferStorage(swizzle_table_buffer.handle, sizeof(swizzle_table), &swizzle_table, 0);
72 glNamedBufferStorage(astc_buffer.handle, sizeof(ASTC_BUFFER_DATA), &ASTC_BUFFER_DATA, 0); 72 glNamedBufferStorage(astc_buffer.handle, sizeof(ASTC_ENCODINGS_VALUES), &ASTC_ENCODINGS_VALUES,
73 0);
73} 74}
74 75
75UtilShaders::~UtilShaders() = default; 76UtilShaders::~UtilShaders() = default;
@@ -79,11 +80,6 @@ void UtilShaders::ASTCDecode(Image& image, const ImageBufferMap& map,
79 static constexpr GLuint BINDING_SWIZZLE_BUFFER = 0; 80 static constexpr GLuint BINDING_SWIZZLE_BUFFER = 0;
80 static constexpr GLuint BINDING_INPUT_BUFFER = 1; 81 static constexpr GLuint BINDING_INPUT_BUFFER = 1;
81 static constexpr GLuint BINDING_ENC_BUFFER = 2; 82 static constexpr GLuint BINDING_ENC_BUFFER = 2;
82
83 static constexpr GLuint BINDING_6_TO_8_BUFFER = 3;
84 static constexpr GLuint BINDING_7_TO_8_BUFFER = 4;
85 static constexpr GLuint BINDING_8_TO_8_BUFFER = 5;
86
87 static constexpr GLuint BINDING_OUTPUT_IMAGE = 0; 83 static constexpr GLuint BINDING_OUTPUT_IMAGE = 0;
88 84
89 const Extent2D tile_size{ 85 const Extent2D tile_size{
@@ -92,18 +88,7 @@ void UtilShaders::ASTCDecode(Image& image, const ImageBufferMap& map,
92 }; 88 };
93 program_manager.BindHostCompute(astc_decoder_program.handle); 89 program_manager.BindHostCompute(astc_decoder_program.handle);
94 glBindBufferBase(GL_SHADER_STORAGE_BUFFER, BINDING_SWIZZLE_BUFFER, swizzle_table_buffer.handle); 90 glBindBufferBase(GL_SHADER_STORAGE_BUFFER, BINDING_SWIZZLE_BUFFER, swizzle_table_buffer.handle);
95 glBindBufferRange(GL_SHADER_STORAGE_BUFFER, BINDING_ENC_BUFFER, astc_buffer.handle, 91 glBindBufferBase(GL_SHADER_STORAGE_BUFFER, BINDING_ENC_BUFFER, astc_buffer.handle);
96 offsetof(AstcBufferData, encoding_values),
97 sizeof(AstcBufferData::encoding_values));
98 glBindBufferRange(GL_SHADER_STORAGE_BUFFER, BINDING_6_TO_8_BUFFER, astc_buffer.handle,
99 offsetof(AstcBufferData, replicate_6_to_8),
100 sizeof(AstcBufferData::replicate_6_to_8));
101 glBindBufferRange(GL_SHADER_STORAGE_BUFFER, BINDING_7_TO_8_BUFFER, astc_buffer.handle,
102 offsetof(AstcBufferData, replicate_7_to_8),
103 sizeof(AstcBufferData::replicate_7_to_8));
104 glBindBufferRange(GL_SHADER_STORAGE_BUFFER, BINDING_8_TO_8_BUFFER, astc_buffer.handle,
105 offsetof(AstcBufferData, replicate_8_to_8),
106 sizeof(AstcBufferData::replicate_8_to_8));
107 92
108 glFlushMappedNamedBufferRange(map.buffer, map.offset, image.guest_size_bytes); 93 glFlushMappedNamedBufferRange(map.buffer, map.offset, image.guest_size_bytes);
109 glUniform2ui(1, tile_size.width, tile_size.height); 94 glUniform2ui(1, tile_size.width, tile_size.height);
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp
index 123bed794..205cd3b05 100644
--- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp
+++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp
@@ -30,19 +30,16 @@
30namespace Vulkan { 30namespace Vulkan {
31 31
32using Tegra::Texture::SWIZZLE_TABLE; 32using Tegra::Texture::SWIZZLE_TABLE;
33using Tegra::Texture::ASTC::EncodingsValues; 33using Tegra::Texture::ASTC::ASTC_ENCODINGS_VALUES;
34using namespace Tegra::Texture::ASTC; 34using namespace Tegra::Texture::ASTC;
35 35
36namespace { 36namespace {
37 37
38constexpr u32 ASTC_BINDING_INPUT_BUFFER = 0; 38constexpr u32 ASTC_BINDING_INPUT_BUFFER = 0;
39constexpr u32 ASTC_BINDING_ENC_BUFFER = 1; 39constexpr u32 ASTC_BINDING_ENC_BUFFER = 1;
40constexpr u32 ASTC_BINDING_6_TO_8_BUFFER = 2; 40constexpr u32 ASTC_BINDING_SWIZZLE_BUFFER = 2;
41constexpr u32 ASTC_BINDING_7_TO_8_BUFFER = 3; 41constexpr u32 ASTC_BINDING_OUTPUT_IMAGE = 3;
42constexpr u32 ASTC_BINDING_8_TO_8_BUFFER = 4; 42constexpr size_t ASTC_NUM_BINDINGS = 4;
43constexpr u32 ASTC_BINDING_SWIZZLE_BUFFER = 5;
44constexpr u32 ASTC_BINDING_OUTPUT_IMAGE = 6;
45constexpr size_t ASTC_NUM_BINDINGS = 7;
46 43
47VkPushConstantRange BuildComputePushConstantRange(std::size_t size) { 44VkPushConstantRange BuildComputePushConstantRange(std::size_t size) {
48 return { 45 return {
@@ -88,27 +85,6 @@ std::array<VkDescriptorSetLayoutBinding, ASTC_NUM_BINDINGS> BuildASTCDescriptorS
88 .pImmutableSamplers = nullptr, 85 .pImmutableSamplers = nullptr,
89 }, 86 },
90 { 87 {
91 .binding = ASTC_BINDING_6_TO_8_BUFFER,
92 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
93 .descriptorCount = 1,
94 .stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
95 .pImmutableSamplers = nullptr,
96 },
97 {
98 .binding = ASTC_BINDING_7_TO_8_BUFFER,
99 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
100 .descriptorCount = 1,
101 .stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
102 .pImmutableSamplers = nullptr,
103 },
104 {
105 .binding = ASTC_BINDING_8_TO_8_BUFFER,
106 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
107 .descriptorCount = 1,
108 .stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
109 .pImmutableSamplers = nullptr,
110 },
111 {
112 .binding = ASTC_BINDING_SWIZZLE_BUFFER, 88 .binding = ASTC_BINDING_SWIZZLE_BUFFER,
113 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 89 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
114 .descriptorCount = 1, 90 .descriptorCount = 1,
@@ -156,30 +132,6 @@ BuildASTCPassDescriptorUpdateTemplateEntry() {
156 .stride = sizeof(DescriptorUpdateEntry), 132 .stride = sizeof(DescriptorUpdateEntry),
157 }, 133 },
158 { 134 {
159 .dstBinding = ASTC_BINDING_6_TO_8_BUFFER,
160 .dstArrayElement = 0,
161 .descriptorCount = 1,
162 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
163 .offset = ASTC_BINDING_6_TO_8_BUFFER * sizeof(DescriptorUpdateEntry),
164 .stride = sizeof(DescriptorUpdateEntry),
165 },
166 {
167 .dstBinding = ASTC_BINDING_7_TO_8_BUFFER,
168 .dstArrayElement = 0,
169 .descriptorCount = 1,
170 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
171 .offset = ASTC_BINDING_7_TO_8_BUFFER * sizeof(DescriptorUpdateEntry),
172 .stride = sizeof(DescriptorUpdateEntry),
173 },
174 {
175 .dstBinding = ASTC_BINDING_8_TO_8_BUFFER,
176 .dstArrayElement = 0,
177 .descriptorCount = 1,
178 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
179 .offset = ASTC_BINDING_8_TO_8_BUFFER * sizeof(DescriptorUpdateEntry),
180 .stride = sizeof(DescriptorUpdateEntry),
181 },
182 {
183 .dstBinding = ASTC_BINDING_SWIZZLE_BUFFER, 135 .dstBinding = ASTC_BINDING_SWIZZLE_BUFFER,
184 .dstArrayElement = 0, 136 .dstArrayElement = 0,
185 .descriptorCount = 1, 137 .descriptorCount = 1,
@@ -400,7 +352,7 @@ ASTCDecoderPass::ASTCDecoderPass(const Device& device_, VKScheduler& scheduler_,
400ASTCDecoderPass::~ASTCDecoderPass() = default; 352ASTCDecoderPass::~ASTCDecoderPass() = default;
401 353
402void ASTCDecoderPass::MakeDataBuffer() { 354void ASTCDecoderPass::MakeDataBuffer() {
403 constexpr size_t TOTAL_BUFFER_SIZE = sizeof(ASTC_BUFFER_DATA) + sizeof(SWIZZLE_TABLE); 355 constexpr size_t TOTAL_BUFFER_SIZE = sizeof(ASTC_ENCODINGS_VALUES) + sizeof(SWIZZLE_TABLE);
404 data_buffer = device.GetLogical().CreateBuffer(VkBufferCreateInfo{ 356 data_buffer = device.GetLogical().CreateBuffer(VkBufferCreateInfo{
405 .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, 357 .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
406 .pNext = nullptr, 358 .pNext = nullptr,
@@ -414,9 +366,10 @@ void ASTCDecoderPass::MakeDataBuffer() {
414 data_buffer_commit = memory_allocator.Commit(data_buffer, MemoryUsage::Upload); 366 data_buffer_commit = memory_allocator.Commit(data_buffer, MemoryUsage::Upload);
415 367
416 const auto staging_ref = staging_buffer_pool.Request(TOTAL_BUFFER_SIZE, MemoryUsage::Upload); 368 const auto staging_ref = staging_buffer_pool.Request(TOTAL_BUFFER_SIZE, MemoryUsage::Upload);
417 std::memcpy(staging_ref.mapped_span.data(), &ASTC_BUFFER_DATA, sizeof(ASTC_BUFFER_DATA)); 369 std::memcpy(staging_ref.mapped_span.data(), &ASTC_ENCODINGS_VALUES,
370 sizeof(ASTC_ENCODINGS_VALUES));
418 // Tack on the swizzle table at the end of the buffer 371 // Tack on the swizzle table at the end of the buffer
419 std::memcpy(staging_ref.mapped_span.data() + sizeof(ASTC_BUFFER_DATA), &SWIZZLE_TABLE, 372 std::memcpy(staging_ref.mapped_span.data() + sizeof(ASTC_ENCODINGS_VALUES), &SWIZZLE_TABLE,
420 sizeof(SWIZZLE_TABLE)); 373 sizeof(SWIZZLE_TABLE));
421 374
422 scheduler.Record([src = staging_ref.buffer, offset = staging_ref.offset, dst = *data_buffer, 375 scheduler.Record([src = staging_ref.buffer, offset = staging_ref.offset, dst = *data_buffer,
@@ -486,15 +439,8 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map,
486 update_descriptor_queue.Acquire(); 439 update_descriptor_queue.Acquire();
487 update_descriptor_queue.AddBuffer(map.buffer, input_offset, 440 update_descriptor_queue.AddBuffer(map.buffer, input_offset,
488 image.guest_size_bytes - swizzle.buffer_offset); 441 image.guest_size_bytes - swizzle.buffer_offset);
489 update_descriptor_queue.AddBuffer(*data_buffer, offsetof(AstcBufferData, encoding_values), 442 update_descriptor_queue.AddBuffer(*data_buffer, 0, sizeof(ASTC_ENCODINGS_VALUES));
490 sizeof(AstcBufferData::encoding_values)); 443 update_descriptor_queue.AddBuffer(*data_buffer, sizeof(ASTC_ENCODINGS_VALUES),
491 update_descriptor_queue.AddBuffer(*data_buffer, offsetof(AstcBufferData, replicate_6_to_8),
492 sizeof(AstcBufferData::replicate_6_to_8));
493 update_descriptor_queue.AddBuffer(*data_buffer, offsetof(AstcBufferData, replicate_7_to_8),
494 sizeof(AstcBufferData::replicate_7_to_8));
495 update_descriptor_queue.AddBuffer(*data_buffer, offsetof(AstcBufferData, replicate_8_to_8),
496 sizeof(AstcBufferData::replicate_8_to_8));
497 update_descriptor_queue.AddBuffer(*data_buffer, sizeof(AstcBufferData),
498 sizeof(SWIZZLE_TABLE)); 444 sizeof(SWIZZLE_TABLE));
499 update_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); 445 update_descriptor_queue.AddImage(image.StorageImageView(swizzle.level));
500 446
diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp
index b6e2022f2..7b756ba41 100644
--- a/src/video_core/textures/astc.cpp
+++ b/src/video_core/textures/astc.cpp
@@ -269,7 +269,7 @@ static void DecodeQuintBlock(InputBitStream& bits, IntegerEncodedVector& result,
269static void DecodeIntegerSequence(IntegerEncodedVector& result, InputBitStream& bits, u32 maxRange, 269static void DecodeIntegerSequence(IntegerEncodedVector& result, InputBitStream& bits, u32 maxRange,
270 u32 nValues) { 270 u32 nValues) {
271 // Determine encoding parameters 271 // Determine encoding parameters
272 IntegerEncodedValue val = EncodingsValues[maxRange]; 272 IntegerEncodedValue val = ASTC_ENCODINGS_VALUES[maxRange];
273 273
274 // Start decoding 274 // Start decoding
275 u32 nValsDecoded = 0; 275 u32 nValsDecoded = 0;
@@ -310,7 +310,7 @@ struct TexelWeightParams {
310 nIdxs *= 2; 310 nIdxs *= 2;
311 } 311 }
312 312
313 return EncodingsValues[m_MaxWeight].GetBitLength(nIdxs); 313 return ASTC_ENCODINGS_VALUES[m_MaxWeight].GetBitLength(nIdxs);
314 } 314 }
315 315
316 u32 GetNumWeightValues() const { 316 u32 GetNumWeightValues() const {
@@ -755,12 +755,12 @@ static void DecodeColorValues(u32* out, std::span<u8> data, const u32* modes, co
755 // figure out the max value for each of them... 755 // figure out the max value for each of them...
756 u32 range = 256; 756 u32 range = 256;
757 while (--range > 0) { 757 while (--range > 0) {
758 IntegerEncodedValue val = EncodingsValues[range]; 758 IntegerEncodedValue val = ASTC_ENCODINGS_VALUES[range];
759 u32 bitLength = val.GetBitLength(nValues); 759 u32 bitLength = val.GetBitLength(nValues);
760 if (bitLength <= nBitsForColorData) { 760 if (bitLength <= nBitsForColorData) {
761 // Find the smallest possible range that matches the given encoding 761 // Find the smallest possible range that matches the given encoding
762 while (--range > 0) { 762 while (--range > 0) {
763 IntegerEncodedValue newval = EncodingsValues[range]; 763 IntegerEncodedValue newval = ASTC_ENCODINGS_VALUES[range];
764 if (!newval.MatchesEncoding(val)) { 764 if (!newval.MatchesEncoding(val)) {
765 break; 765 break;
766 } 766 }
diff --git a/src/video_core/textures/astc.h b/src/video_core/textures/astc.h
index 441e8eb04..0229ae122 100644
--- a/src/video_core/textures/astc.h
+++ b/src/video_core/textures/astc.h
@@ -77,7 +77,7 @@ constexpr std::array<IntegerEncodedValue, 256> MakeEncodedValues() {
77 return encodings; 77 return encodings;
78} 78}
79 79
80constexpr std::array<IntegerEncodedValue, 256> EncodingsValues = MakeEncodedValues(); 80constexpr std::array<IntegerEncodedValue, 256> ASTC_ENCODINGS_VALUES = MakeEncodedValues();
81 81
82// Replicates low num_bits such that [(to_bit - 1):(to_bit - 1 - from_bit)] 82// Replicates low num_bits such that [(to_bit - 1):(to_bit - 1 - from_bit)]
83// is the same as [(num_bits - 1):0] and repeats all the way down. 83// is the same as [(num_bits - 1):0] and repeats all the way down.
@@ -120,13 +120,6 @@ constexpr auto REPLICATE_6_BIT_TO_8_TABLE = MakeReplicateTable<u32, 6, 8>();
120constexpr auto REPLICATE_7_BIT_TO_8_TABLE = MakeReplicateTable<u32, 7, 8>(); 120constexpr auto REPLICATE_7_BIT_TO_8_TABLE = MakeReplicateTable<u32, 7, 8>();
121constexpr auto REPLICATE_8_BIT_TO_8_TABLE = MakeReplicateTable<u32, 8, 8>(); 121constexpr auto REPLICATE_8_BIT_TO_8_TABLE = MakeReplicateTable<u32, 8, 8>();
122 122
123struct AstcBufferData {
124 decltype(EncodingsValues) encoding_values = EncodingsValues;
125 decltype(REPLICATE_6_BIT_TO_8_TABLE) replicate_6_to_8 = REPLICATE_6_BIT_TO_8_TABLE;
126 decltype(REPLICATE_7_BIT_TO_8_TABLE) replicate_7_to_8 = REPLICATE_7_BIT_TO_8_TABLE;
127 decltype(REPLICATE_8_BIT_TO_8_TABLE) replicate_8_to_8 = REPLICATE_8_BIT_TO_8_TABLE;
128} constexpr ASTC_BUFFER_DATA;
129
130void Decompress(std::span<const uint8_t> data, uint32_t width, uint32_t height, uint32_t depth, 123void Decompress(std::span<const uint8_t> data, uint32_t width, uint32_t height, uint32_t depth,
131 uint32_t block_width, uint32_t block_height, std::span<uint8_t> output); 124 uint32_t block_width, uint32_t block_height, std::span<uint8_t> output);
132 125