mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-07 08:28:52 +02:00
Memory changes 3
General memory improvements to decrease GC pressure and frequency. Pool big arrays and objects that are created and deleted often. Skip data copies when they aren't needed. Inline flag checks to skip unneeded allocations. From my testing the performance is about the same, but the GC frequency is much lower and collection is faster causing less and smaller spikes.
This commit is contained in:
@@ -451,7 +451,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||
|
||||
// TODO: Confirm behaviour on hardware.
|
||||
// When this is active, the origin appears to be on the bottom.
|
||||
if (_state.State.YControl.HasFlag(YControl.NegateY))
|
||||
if ((_state.State.YControl & YControl.NegateY) != 0)
|
||||
{
|
||||
dstY0 -= dstHeight;
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||
int width = scissor.X2 - x;
|
||||
int height = scissor.Y2 - y;
|
||||
|
||||
if (_state.State.YControl.HasFlag(YControl.NegateY))
|
||||
if ((_state.State.YControl & YControl.NegateY) != 0)
|
||||
{
|
||||
ref var screenScissor = ref _state.State.ScreenScissorState;
|
||||
y = screenScissor.Height - height - y;
|
||||
@@ -729,7 +729,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||
var face = _state.State.FaceState;
|
||||
|
||||
bool disableTransform = _state.State.ViewportTransformEnable == 0;
|
||||
bool yNegate = yControl.HasFlag(YControl.NegateY);
|
||||
bool yNegate = (yControl & YControl.NegateY) != 0;
|
||||
|
||||
UpdateFrontFace(yControl, face.FrontFace);
|
||||
UpdateDepthMode();
|
||||
@@ -1229,7 +1229,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||
/// <param name="frontFace">Front face</param>
|
||||
private void UpdateFrontFace(YControl yControl, FrontFace frontFace)
|
||||
{
|
||||
bool isUpperLeftOrigin = !yControl.HasFlag(YControl.TriangleRastFlip);
|
||||
bool isUpperLeftOrigin = (yControl & YControl.TriangleRastFlip) == 0;
|
||||
|
||||
if (isUpperLeftOrigin)
|
||||
{
|
||||
@@ -1520,7 +1520,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||
{
|
||||
// Make sure we update the viewport size on the support buffer if it will be consumed on the new shader.
|
||||
|
||||
if (!_fsReadsFragCoord && _state.State.YControl.HasFlag(YControl.NegateY))
|
||||
if (!_fsReadsFragCoord && (_state.State.YControl & YControl.NegateY) != 0)
|
||||
{
|
||||
UpdateSupportBufferViewportSize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user