Respond to feedback

This commit is contained in:
Alex Barney 2019-12-25 23:38:24 -07:00
commit 04b37891cb
3 changed files with 11 additions and 1 deletions

View file

@ -45,6 +45,7 @@ namespace Ryujinx.Graphics.Texture.Astc
Levels = new AstcLevel[levels]; Levels = new AstcLevel[levels];
TotalBlockCount = 0; TotalBlockCount = 0;
int currentInputBlock = 0; int currentInputBlock = 0;
int currentOutputOffset = 0; int currentOutputOffset = 0;
@ -224,6 +225,7 @@ namespace Ryujinx.Graphics.Texture.Astc
} }
decoded = output; decoded = output;
return decoder.Success; return decoder.Success;
} }
@ -282,6 +284,7 @@ namespace Ryujinx.Graphics.Texture.Astc
Enumerable.Range(0, decoder.TotalBlockCount).AsParallel().ForAll(x => decoder.ProcessBlock(x)); Enumerable.Range(0, decoder.TotalBlockCount).AsParallel().ForAll(x => decoder.ProcessBlock(x));
decoded = output; decoded = output;
return decoder.Success; return decoder.Success;
} }
@ -337,6 +340,7 @@ namespace Ryujinx.Graphics.Texture.Astc
// Determine partitions, partition index, and color endpoint modes // Determine partitions, partition index, and color endpoint modes
int planeIndices; int planeIndices;
int partitionIndex; int partitionIndex;
Span<uint> colorEndpointMode = stackalloc uint[4]; Span<uint> colorEndpointMode = stackalloc uint[4];
BitStream128 colorEndpointStream = new BitStream128(); BitStream128 colorEndpointStream = new BitStream128();
@ -1360,6 +1364,7 @@ namespace Ryujinx.Graphics.Texture.Astc
if ((modeBits & 0xF) == 0) if ((modeBits & 0xF) == 0)
{ {
texelParams.Error = true; texelParams.Error = true;
return; return;
} }

View file

@ -19,7 +19,10 @@ namespace Ryujinx.Graphics.Texture.Astc
{ {
Debug.Assert(bitCount < 32); Debug.Assert(bitCount < 32);
if (bitCount == 0) return 0; if (bitCount == 0)
{
return 0;
}
int mask = (1 << bitCount) - 1; int mask = (1 << bitCount) - 1;
int value = _data.As<int>() & mask; int value = _data.As<int>() & mask;
@ -31,6 +34,7 @@ namespace Ryujinx.Graphics.Texture.Astc
span[1] >>= bitCount; span[1] >>= bitCount;
BitsLeft -= bitCount; BitsLeft -= bitCount;
return value; return value;
} }

View file

@ -49,6 +49,7 @@
retValue |= tempValue >> comp; retValue |= tempValue >> comp;
resLength += numberBits; resLength += numberBits;
} }
return retValue; return retValue;
} }