summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-07-17 23:46:30 -0400
committerGravatar Lioncash2018-07-17 23:58:14 -0400
commit0f148548f3edfc62bcdd62ed42d6797380f6ab57 (patch)
tree90c91a527a8ebc90fb42fb3620a6870d4e858328 /src
parentastc: const-correctness changes where applicable (diff)
downloadyuzu-0f148548f3edfc62bcdd62ed42d6797380f6ab57.tar.gz
yuzu-0f148548f3edfc62bcdd62ed42d6797380f6ab57.tar.xz
yuzu-0f148548f3edfc62bcdd62ed42d6797380f6ab57.zip
astc: Mark functions as internally linked where applicable
Diffstat (limited to '')
-rw-r--r--src/video_core/textures/astc.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp
index 1f2eca787..6dfcadc6a 100644
--- a/src/video_core/textures/astc.cpp
+++ b/src/video_core/textures/astc.cpp
@@ -406,7 +406,7 @@ struct TexelWeightParams {
406 } 406 }
407}; 407};
408 408
409TexelWeightParams DecodeBlockInfo(BitStream& strm) { 409static TexelWeightParams DecodeBlockInfo(BitStream& strm) {
410 TexelWeightParams params; 410 TexelWeightParams params;
411 411
412 // Read the entire block mode all at once 412 // Read the entire block mode all at once
@@ -605,8 +605,8 @@ TexelWeightParams DecodeBlockInfo(BitStream& strm) {
605 return params; 605 return params;
606} 606}
607 607
608void FillVoidExtentLDR(BitStream& strm, uint32_t* const outBuf, uint32_t blockWidth, 608static void FillVoidExtentLDR(BitStream& strm, uint32_t* const outBuf, uint32_t blockWidth,
609 uint32_t blockHeight) { 609 uint32_t blockHeight) {
610 // Don't actually care about the void extent, just read the bits... 610 // Don't actually care about the void extent, just read the bits...
611 for (int i = 0; i < 4; ++i) { 611 for (int i = 0; i < 4; ++i) {
612 strm.ReadBits(13); 612 strm.ReadBits(13);
@@ -621,23 +621,25 @@ void FillVoidExtentLDR(BitStream& strm, uint32_t* const outBuf, uint32_t blockWi
621 uint32_t rgba = (r >> 8) | (g & 0xFF00) | (static_cast<uint32_t>(b) & 0xFF00) << 8 | 621 uint32_t rgba = (r >> 8) | (g & 0xFF00) | (static_cast<uint32_t>(b) & 0xFF00) << 8 |
622 (static_cast<uint32_t>(a) & 0xFF00) << 16; 622 (static_cast<uint32_t>(a) & 0xFF00) << 16;
623 623
624 for (uint32_t j = 0; j < blockHeight; j++) 624 for (uint32_t j = 0; j < blockHeight; j++) {
625 for (uint32_t i = 0; i < blockWidth; i++) { 625 for (uint32_t i = 0; i < blockWidth; i++) {
626 outBuf[j * blockWidth + i] = rgba; 626 outBuf[j * blockWidth + i] = rgba;
627 } 627 }
628 }
628} 629}
629 630
630void FillError(uint32_t* outBuf, uint32_t blockWidth, uint32_t blockHeight) { 631static void FillError(uint32_t* outBuf, uint32_t blockWidth, uint32_t blockHeight) {
631 for (uint32_t j = 0; j < blockHeight; j++) 632 for (uint32_t j = 0; j < blockHeight; j++) {
632 for (uint32_t i = 0; i < blockWidth; i++) { 633 for (uint32_t i = 0; i < blockWidth; i++) {
633 outBuf[j * blockWidth + i] = 0xFFFF00FF; 634 outBuf[j * blockWidth + i] = 0xFFFF00FF;
634 } 635 }
636 }
635} 637}
636 638
637// Replicates low numBits such that [(toBit - 1):(toBit - 1 - fromBit)] 639// Replicates low numBits such that [(toBit - 1):(toBit - 1 - fromBit)]
638// is the same as [(numBits - 1):0] and repeats all the way down. 640// is the same as [(numBits - 1):0] and repeats all the way down.
639template <typename IntType> 641template <typename IntType>
640IntType Replicate(const IntType& val, uint32_t numBits, uint32_t toBit) { 642static IntType Replicate(const IntType& val, uint32_t numBits, uint32_t toBit) {
641 if (numBits == 0) 643 if (numBits == 0)
642 return 0; 644 return 0;
643 if (toBit == 0) 645 if (toBit == 0)
@@ -788,8 +790,8 @@ public:
788 } 790 }
789}; 791};
790 792
791void DecodeColorValues(uint32_t* out, uint8_t* data, const uint32_t* modes, 793static void DecodeColorValues(uint32_t* out, uint8_t* data, const uint32_t* modes,
792 const uint32_t nPartitions, const uint32_t nBitsForColorData) { 794 const uint32_t nPartitions, const uint32_t nBitsForColorData) {
793 // First figure out how many color values we have 795 // First figure out how many color values we have
794 uint32_t nValues = 0; 796 uint32_t nValues = 0;
795 for (uint32_t i = 0; i < nPartitions; i++) { 797 for (uint32_t i = 0; i < nPartitions; i++) {
@@ -958,7 +960,7 @@ void DecodeColorValues(uint32_t* out, uint8_t* data, const uint32_t* modes,
958 } 960 }
959} 961}
960 962
961uint32_t UnquantizeTexelWeight(const IntegerEncodedValue& val) { 963static uint32_t UnquantizeTexelWeight(const IntegerEncodedValue& val) {
962 uint32_t bitval = val.GetBitValue(); 964 uint32_t bitval = val.GetBitValue();
963 uint32_t bitlen = val.BaseBitLength(); 965 uint32_t bitlen = val.BaseBitLength();
964 966
@@ -1047,9 +1049,10 @@ uint32_t UnquantizeTexelWeight(const IntegerEncodedValue& val) {
1047 return result; 1049 return result;
1048} 1050}
1049 1051
1050void UnquantizeTexelWeights(uint32_t out[2][144], const std::vector<IntegerEncodedValue>& weights, 1052static void UnquantizeTexelWeights(uint32_t out[2][144],
1051 const TexelWeightParams& params, const uint32_t blockWidth, 1053 const std::vector<IntegerEncodedValue>& weights,
1052 const uint32_t blockHeight) { 1054 const TexelWeightParams& params, const uint32_t blockWidth,
1055 const uint32_t blockHeight) {
1053 uint32_t weightIdx = 0; 1056 uint32_t weightIdx = 0;
1054 uint32_t unquantized[2][144]; 1057 uint32_t unquantized[2][144];
1055 1058
@@ -1241,8 +1244,8 @@ static inline uint32_t Select2DPartition(int32_t seed, int32_t x, int32_t y, int
1241} 1244}
1242 1245
1243// Section C.2.14 1246// Section C.2.14
1244void ComputeEndpoints(Pixel& ep1, Pixel& ep2, const uint32_t*& colorValues, 1247static void ComputeEndpoints(Pixel& ep1, Pixel& ep2, const uint32_t*& colorValues,
1245 uint32_t colorEndpointMode) { 1248 uint32_t colorEndpointMode) {
1246#define READ_UINT_VALUES(N) \ 1249#define READ_UINT_VALUES(N) \
1247 uint32_t v[N]; \ 1250 uint32_t v[N]; \
1248 for (uint32_t i = 0; i < N; i++) { \ 1251 for (uint32_t i = 0; i < N; i++) { \
@@ -1362,8 +1365,8 @@ void ComputeEndpoints(Pixel& ep1, Pixel& ep2, const uint32_t*& colorValues,
1362#undef READ_INT_VALUES 1365#undef READ_INT_VALUES
1363} 1366}
1364 1367
1365void DecompressBlock(uint8_t inBuf[16], const uint32_t blockWidth, const uint32_t blockHeight, 1368static void DecompressBlock(uint8_t inBuf[16], const uint32_t blockWidth,
1366 uint32_t* outBuf) { 1369 const uint32_t blockHeight, uint32_t* outBuf) {
1367 BitStream strm(inBuf); 1370 BitStream strm(inBuf);
1368 TexelWeightParams weightParams = DecodeBlockInfo(strm); 1371 TexelWeightParams weightParams = DecodeBlockInfo(strm);
1369 1372