Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
cb70e7bb30 | ||
|
c200a7b7c6 | ||
|
6268170a10 | ||
|
ee0f9b03a4 | ||
|
f93c5f006a | ||
|
295fbd0542 |
@@ -1587,6 +1587,12 @@ namespace ARMeilleure.CodeGen.X86
|
|||||||
|
|
||||||
Debug.Assert(dest.Type.IsInteger() && source.Type.IsInteger());
|
Debug.Assert(dest.Type.IsInteger() && source.Type.IsInteger());
|
||||||
|
|
||||||
|
// We can eliminate the move if source is already 32-bit and the registers are the same.
|
||||||
|
if (dest.Value == source.Value && source.Type == OperandType.I32)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
context.Assembler.Mov(dest, source, OperandType.I32);
|
context.Assembler.Mov(dest, source, OperandType.I32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -378,14 +378,7 @@ namespace ARMeilleure.IntermediateRepresentation
|
|||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
if (Kind == OperandKind.LocalVariable)
|
return ((ulong)_data).GetHashCode();
|
||||||
{
|
|
||||||
return base.GetHashCode();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return (int)Value ^ ((int)Kind << 16) ^ ((int)Type << 20);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Operand operand)
|
public bool Equals(Operand operand)
|
||||||
|
@@ -27,7 +27,7 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
private const string OuterHeaderMagicString = "PTCohd\0\0";
|
private const string OuterHeaderMagicString = "PTCohd\0\0";
|
||||||
private const string InnerHeaderMagicString = "PTCihd\0\0";
|
private const string InnerHeaderMagicString = "PTCihd\0\0";
|
||||||
|
|
||||||
private const uint InternalVersion = 3713; //! To be incremented manually for each change to the ARMeilleure project.
|
private const uint InternalVersion = 4140; //! To be incremented manually for each change to the ARMeilleure project.
|
||||||
|
|
||||||
private const string ActualDir = "0";
|
private const string ActualDir = "0";
|
||||||
private const string BackupDir = "1";
|
private const string BackupDir = "1";
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="Input"
|
Name="Input"
|
||||||
Grid.Row="2"
|
Grid.Row="3"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
@@ -142,6 +142,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||||||
|
|
||||||
_drawState.FirstIndex = firstIndex;
|
_drawState.FirstIndex = firstIndex;
|
||||||
_drawState.IndexCount = indexCount;
|
_drawState.IndexCount = indexCount;
|
||||||
|
_drawState.DrawFirstVertex = drawFirstVertex;
|
||||||
|
_drawState.DrawVertexCount = drawVertexCount;
|
||||||
_currentSpecState.SetHasConstantBufferDrawParameters(false);
|
_currentSpecState.SetHasConstantBufferDrawParameters(false);
|
||||||
|
|
||||||
engine.UpdateState();
|
engine.UpdateState();
|
||||||
@@ -163,10 +165,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||||||
|
|
||||||
_instancedIndexCount = ibCount != 0 ? ibCount : indexCount;
|
_instancedIndexCount = ibCount != 0 ? ibCount : indexCount;
|
||||||
|
|
||||||
var drawState = _state.State.VertexBufferDrawState;
|
_instancedDrawStateFirst = drawFirstVertex;
|
||||||
|
_instancedDrawStateCount = drawVertexCount;
|
||||||
_instancedDrawStateFirst = drawState.First;
|
|
||||||
_instancedDrawStateCount = drawState.Count;
|
|
||||||
|
|
||||||
_drawState.DrawIndexed = false;
|
_drawState.DrawIndexed = false;
|
||||||
|
|
||||||
@@ -415,6 +415,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||||||
bool oldDrawIndexed = _drawState.DrawIndexed;
|
bool oldDrawIndexed = _drawState.DrawIndexed;
|
||||||
|
|
||||||
_drawState.DrawIndexed = false;
|
_drawState.DrawIndexed = false;
|
||||||
|
engine.ForceStateDirty(VertexBufferFirstMethodOffset * 4);
|
||||||
|
|
||||||
DrawEnd(engine, 0, 0, firstVertex, vertexCount);
|
DrawEnd(engine, 0, 0, firstVertex, vertexCount);
|
||||||
|
|
||||||
@@ -526,8 +527,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_state.State.VertexBufferDrawState.First = firstVertex;
|
_drawState.DrawFirstVertex = firstVertex;
|
||||||
_state.State.VertexBufferDrawState.Count = count;
|
_drawState.DrawVertexCount = count;
|
||||||
engine.ForceStateDirty(VertexBufferFirstMethodOffset * 4);
|
engine.ForceStateDirty(VertexBufferFirstMethodOffset * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,6 +17,16 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int IndexCount;
|
public int IndexCount;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// First vertex used on non-indexed draws. This value is stored somewhere else on indexed draws.
|
||||||
|
/// </summary>
|
||||||
|
public int DrawFirstVertex;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vertex count used on non-indexed draws. Indexed draws have a index count instead.
|
||||||
|
/// </summary>
|
||||||
|
public int DrawVertexCount;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates if the next draw will be a indexed draw.
|
/// Indicates if the next draw will be a indexed draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -989,6 +989,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||||||
|
|
||||||
bool drawIndexed = _drawState.DrawIndexed;
|
bool drawIndexed = _drawState.DrawIndexed;
|
||||||
bool drawIndirect = _drawState.DrawIndirect;
|
bool drawIndirect = _drawState.DrawIndirect;
|
||||||
|
int drawFirstVertex = _drawState.DrawFirstVertex;
|
||||||
|
int drawVertexCount = _drawState.DrawVertexCount;
|
||||||
uint vbEnableMask = 0;
|
uint vbEnableMask = 0;
|
||||||
|
|
||||||
for (int index = 0; index < Constants.TotalVertexBuffers; index++)
|
for (int index = 0; index < Constants.TotalVertexBuffers; index++)
|
||||||
@@ -1050,9 +1052,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||||||
|
|
||||||
int firstInstance = (int)_state.State.FirstInstance;
|
int firstInstance = (int)_state.State.FirstInstance;
|
||||||
|
|
||||||
var drawState = _state.State.VertexBufferDrawState;
|
size = Math.Min(vbSize, (ulong)((firstInstance + drawFirstVertex + drawVertexCount) * stride));
|
||||||
|
|
||||||
size = Math.Min(vbSize, (ulong)((firstInstance + drawState.First + drawState.Count) * stride));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_pipeline.VertexBuffers[index] = new BufferPipelineDescriptor(_channel.MemoryManager.IsMapped(address), stride, divisor);
|
_pipeline.VertexBuffers[index] = new BufferPipelineDescriptor(_channel.MemoryManager.IsMapped(address), stride, divisor);
|
||||||
|
Reference in New Issue
Block a user