summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/textures/astc.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp
index a9b8f69af..58b608a36 100644
--- a/src/video_core/textures/astc.cpp
+++ b/src/video_core/textures/astc.cpp
@@ -422,7 +422,7 @@ static TexelWeightParams DecodeBlockInfo(InputBitStream& strm) {
422 TexelWeightParams params; 422 TexelWeightParams params;
423 423
424 // Read the entire block mode all at once 424 // Read the entire block mode all at once
425 uint16_t modeBits = strm.ReadBits(11); 425 uint16_t modeBits = static_cast<uint16_t>(strm.ReadBits(11));
426 426
427 // Does this match the void extent block mode? 427 // Does this match the void extent block mode?
428 if ((modeBits & 0x01FF) == 0x1FC) { 428 if ((modeBits & 0x01FF) == 0x1FC) {
@@ -625,10 +625,10 @@ static void FillVoidExtentLDR(InputBitStream& strm, uint32_t* const outBuf, uint
625 } 625 }
626 626
627 // Decode the RGBA components and renormalize them to the range [0, 255] 627 // Decode the RGBA components and renormalize them to the range [0, 255]
628 uint16_t r = strm.ReadBits(16); 628 uint16_t r = static_cast<uint16_t>(strm.ReadBits(16));
629 uint16_t g = strm.ReadBits(16); 629 uint16_t g = static_cast<uint16_t>(strm.ReadBits(16));
630 uint16_t b = strm.ReadBits(16); 630 uint16_t b = static_cast<uint16_t>(strm.ReadBits(16));
631 uint16_t a = strm.ReadBits(16); 631 uint16_t a = static_cast<uint16_t>(strm.ReadBits(16));
632 632
633 uint32_t rgba = (r >> 8) | (g & 0xFF00) | (static_cast<uint32_t>(b) & 0xFF00) << 8 | 633 uint32_t rgba = (r >> 8) | (g & 0xFF00) | (static_cast<uint32_t>(b) & 0xFF00) << 8 |
634 (static_cast<uint32_t>(a) & 0xFF00) << 16; 634 (static_cast<uint32_t>(a) & 0xFF00) << 16;
@@ -681,9 +681,10 @@ protected:
681 681
682public: 682public:
683 Pixel() = default; 683 Pixel() = default;
684 Pixel(ChannelType a, ChannelType r, ChannelType g, ChannelType b, unsigned bitDepth = 8) 684 Pixel(uint32_t a, uint32_t r, uint32_t g, uint32_t b, unsigned bitDepth = 8)
685 : m_BitDepth{uint8_t(bitDepth), uint8_t(bitDepth), uint8_t(bitDepth), uint8_t(bitDepth)}, 685 : m_BitDepth{uint8_t(bitDepth), uint8_t(bitDepth), uint8_t(bitDepth), uint8_t(bitDepth)},
686 color{a, r, g, b} {} 686 color{static_cast<ChannelType>(a), static_cast<ChannelType>(r),
687 static_cast<ChannelType>(g), static_cast<ChannelType>(b)} {}
687 688
688 // Changes the depth of each pixel. This scales the values to 689 // Changes the depth of each pixel. This scales the values to
689 // the appropriate bit depth by either truncating the least 690 // the appropriate bit depth by either truncating the least