mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-04 10:06:26 +02:00
parent
417df486b1
commit
361d0c5632
622 changed files with 3080 additions and 2652 deletions
|
@ -85,8 +85,8 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
|||
{
|
||||
_state.WriteWithRedundancyCheck(offset, value, out changed);
|
||||
}
|
||||
else if (shadowRamControl == SetMmeShadowRamControlMode.MethodTrack ||
|
||||
shadowRamControl == SetMmeShadowRamControlMode.MethodTrackWithFilter)
|
||||
else if (shadowRamControl is SetMmeShadowRamControlMode.MethodTrack or
|
||||
SetMmeShadowRamControlMode.MethodTrackWithFilter)
|
||||
{
|
||||
_shadowState.Write(offset, value);
|
||||
_state.WriteWithRedundancyCheck(offset, value, out changed);
|
||||
|
|
|
@ -290,6 +290,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.MME
|
|||
_ilGen.Emit(OpCodes.Shl);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case AluOperation.ReadImmediate:
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
|||
{
|
||||
public static bool IsTrack(this SetMmeShadowRamControlMode mode)
|
||||
{
|
||||
return mode == SetMmeShadowRamControlMode.MethodTrack || mode == SetMmeShadowRamControlMode.MethodTrackWithFilter;
|
||||
return mode is SetMmeShadowRamControlMode.MethodTrack or SetMmeShadowRamControlMode.MethodTrackWithFilter;
|
||||
}
|
||||
|
||||
public static bool IsPassthrough(this SetMmeShadowRamControlMode mode)
|
||||
|
|
|
@ -285,6 +285,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
{
|
||||
data[index] = index;
|
||||
}
|
||||
|
||||
break;
|
||||
case PrimitiveTopology.LineLoop:
|
||||
data[^1] = 0;
|
||||
|
@ -294,6 +295,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
data[index] = index >> 1;
|
||||
data[index + 1] = (index >> 1) + 1;
|
||||
}
|
||||
|
||||
break;
|
||||
case PrimitiveTopology.LineStrip:
|
||||
for (int index = 0; index < ((data.Length - 1) & ~1); index += 2)
|
||||
|
@ -301,6 +303,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
data[index] = index >> 1;
|
||||
data[index + 1] = (index >> 1) + 1;
|
||||
}
|
||||
|
||||
break;
|
||||
case PrimitiveTopology.TriangleStrip:
|
||||
int tsTrianglesCount = data.Length / 3;
|
||||
|
@ -330,6 +333,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
data[baseIndex + 2] = tsOutIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case PrimitiveTopology.TriangleFan:
|
||||
case PrimitiveTopology.Polygon:
|
||||
|
@ -342,6 +346,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
data[index + 1] = tfOutIndex;
|
||||
data[index + 2] = ++tfOutIndex;
|
||||
}
|
||||
|
||||
break;
|
||||
case PrimitiveTopology.Quads:
|
||||
int qQuadsCount = data.Length / 6;
|
||||
|
@ -358,6 +363,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
data[index + 4] = qIndex + 2;
|
||||
data[index + 5] = qIndex + 3;
|
||||
}
|
||||
|
||||
break;
|
||||
case PrimitiveTopology.QuadStrip:
|
||||
int qsQuadsCount = data.Length / 6;
|
||||
|
@ -384,6 +390,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
data[index + 4] = qIndex + 2;
|
||||
data[index + 5] = qIndex + 3;
|
||||
}
|
||||
|
||||
break;
|
||||
case PrimitiveTopology.LineStripAdjacency:
|
||||
for (int index = 0; index < ((data.Length - 3) & ~3); index += 4)
|
||||
|
@ -395,6 +402,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
data[index + 2] = lIndex + 2;
|
||||
data[index + 3] = lIndex + 3;
|
||||
}
|
||||
|
||||
break;
|
||||
case PrimitiveTopology.TriangleStripAdjacency:
|
||||
int tsaTrianglesCount = data.Length / 6;
|
||||
|
@ -433,6 +441,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
data[baseIndex + 5] = tsaOutIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -170,8 +170,6 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
int vbStride = vertexBuffer.UnpackStride();
|
||||
ulong vbSize = GetVertexBufferSize(address, endAddress.Pack(), vbStride, _indexed, instanced, _firstVertex, _count);
|
||||
|
||||
ulong oldVbSize = vbSize;
|
||||
|
||||
ulong attributeOffset = (ulong)vertexAttrib.UnpackOffset();
|
||||
int componentSize = format.GetScalarSize();
|
||||
|
||||
|
@ -477,7 +475,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
|
|||
private readonly ulong GetVertexBufferSize(ulong vbAddress, ulong vbEndAddress, int vbStride, bool indexed, bool instanced, int firstVertex, int vertexCount)
|
||||
{
|
||||
IndexType indexType = _state.State.IndexBufferState.Type;
|
||||
bool indexTypeSmall = indexType == IndexType.UByte || indexType == IndexType.UShort;
|
||||
bool indexTypeSmall = indexType is IndexType.UByte or IndexType.UShort;
|
||||
ulong vbSize = vbEndAddress - vbAddress + 1;
|
||||
ulong size;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// <summary>
|
||||
/// Indirect draw type, which can be indexed or non-indexed, with or without a draw count.
|
||||
/// </summary>
|
||||
[SuppressMessage("Design", "CA1069: Enums values should not be duplicated")]
|
||||
enum IndirectDrawType
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -253,9 +253,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
{
|
||||
value |= AttributeType.Packed;
|
||||
|
||||
if (type == VertexAttribType.Snorm ||
|
||||
type == VertexAttribType.Sint ||
|
||||
type == VertexAttribType.Sscaled)
|
||||
if (type is VertexAttribType.Snorm or
|
||||
VertexAttribType.Sint or
|
||||
VertexAttribType.Sscaled)
|
||||
{
|
||||
value |= AttributeType.PackedRgb10A2Signed;
|
||||
}
|
||||
|
|
|
@ -1104,7 +1104,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
private void UpdateVertexBufferState()
|
||||
{
|
||||
IndexType indexType = _state.State.IndexBufferState.Type;
|
||||
bool indexTypeSmall = indexType == IndexType.UByte || indexType == IndexType.UShort;
|
||||
bool indexTypeSmall = indexType is IndexType.UByte or IndexType.UShort;
|
||||
|
||||
_drawState.IsAnyVbInstanced = false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue