Respond to feedback

This commit is contained in:
Alex Barney 2019-12-25 23:38:24 -07:00
parent aab41e5ee0
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];
TotalBlockCount = 0;
int currentInputBlock = 0;
int currentOutputOffset = 0;
@ -224,6 +225,7 @@ namespace Ryujinx.Graphics.Texture.Astc
}
decoded = output;
return decoder.Success;
}
@ -282,6 +284,7 @@ namespace Ryujinx.Graphics.Texture.Astc
Enumerable.Range(0, decoder.TotalBlockCount).AsParallel().ForAll(x => decoder.ProcessBlock(x));
decoded = output;
return decoder.Success;
}
@ -337,6 +340,7 @@ namespace Ryujinx.Graphics.Texture.Astc
// Determine partitions, partition index, and color endpoint modes
int planeIndices;
int partitionIndex;
Span<uint> colorEndpointMode = stackalloc uint[4];
BitStream128 colorEndpointStream = new BitStream128();
@ -1360,6 +1364,7 @@ namespace Ryujinx.Graphics.Texture.Astc
if ((modeBits & 0xF) == 0)
{
texelParams.Error = true;
return;
}

View file

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

View file

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