Improvements

This commit is contained in:
Gabriel A 2023-11-17 20:53:08 -03:00
parent d89b004de8
commit baa63a0011
3 changed files with 7 additions and 3 deletions

View file

@ -139,7 +139,9 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
/// <inheritdoc/>
public ReadOnlySpan<byte> QueryTransformFeedbackVaryingLocations(int bufferIndex)
{
return MemoryMarshal.Cast<uint, byte>(_oldSpecState.TransformFeedbackDescriptors[bufferIndex].VaryingLocations);
int varyingCount = _oldSpecState.TransformFeedbackDescriptors[bufferIndex].VaryingCount;
return MemoryMarshal.Cast<uint, byte>(_oldSpecState.TransformFeedbackDescriptors[bufferIndex].VaryingLocations)[..Math.Min(128, varyingCount)];
}
/// <inheritdoc/>

View file

@ -179,7 +179,9 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <inheritdoc/>
public ReadOnlySpan<byte> QueryTransformFeedbackVaryingLocations(int bufferIndex)
{
return MemoryMarshal.Cast<uint, byte>(_state.TransformFeedbackDescriptors[bufferIndex].VaryingLocations);
int varyingCount = _state.TransformFeedbackDescriptors[bufferIndex].VaryingCount;
return MemoryMarshal.Cast<uint, byte>(_state.TransformFeedbackDescriptors[bufferIndex].VaryingLocations)[..Math.Min(128, varyingCount)];
}
/// <inheritdoc/>

View file

@ -138,7 +138,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.H264
3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 4,
};
private static void WriteScalingList(ref H264BitStreamWriter writer, Span<byte> list)
private static void WriteScalingList(ref H264BitStreamWriter writer, ReadOnlySpan<byte> list)
{
ReadOnlySpan<byte> scan = list.Length == 16 ? ZigZagScan : ZigZagDirect;