mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-21 00:23:36 +00:00
Update guest cache to v1.1 (due to specialization state changes)
This will explode your shader cache from earlier vulkan build, but it must be done. 😔
This commit is contained in:
parent
f21761555c
commit
884ee76d7c
3 changed files with 18 additions and 5 deletions
|
@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
|
|||
private const uint TocMagic = (byte)'T' | ((byte)'O' << 8) | ((byte)'C' << 16) | ((byte)'G' << 24);
|
||||
|
||||
private const ushort VersionMajor = 1;
|
||||
private const ushort VersionMinor = 0;
|
||||
private const ushort VersionMinor = 1;
|
||||
private const uint VersionPacked = ((uint)VersionMajor << 16) | VersionMinor;
|
||||
|
||||
private const string TocFileName = "guest.toc";
|
||||
|
|
|
@ -254,7 +254,7 @@ void main()
|
|||
_pipeline.ClearRenderTargetColor(0, new ColorF(0f, 0f, 0f, 1f));
|
||||
}
|
||||
|
||||
_pipeline.SetViewports(0, viewports);
|
||||
_pipeline.SetViewports(0, viewports, false);
|
||||
_pipeline.SetPrimitiveTopology(GAL.PrimitiveTopology.TriangleStrip);
|
||||
_pipeline.Draw(4, 1, 0, 0);
|
||||
_pipeline.Finish();
|
||||
|
@ -308,7 +308,7 @@ void main()
|
|||
_pipeline.SetProgram(_programColorClear);
|
||||
_pipeline.SetRenderTarget(dst, (uint)dstWidth, (uint)dstHeight, false, dstFormat);
|
||||
_pipeline.SetRenderTargetColorMasks(new uint[] { componentMask });
|
||||
_pipeline.SetViewports(0, viewports);
|
||||
_pipeline.SetViewports(0, viewports, false);
|
||||
_pipeline.SetScissors(scissors);
|
||||
_pipeline.SetPrimitiveTopology(GAL.PrimitiveTopology.TriangleStrip);
|
||||
_pipeline.Draw(4, 1, 0, 0);
|
||||
|
@ -380,7 +380,7 @@ void main()
|
|||
Span<Rectangle<int>> scissors = stackalloc Rectangle<int>[1];
|
||||
|
||||
pipeline.SetProgram(_programColorBlit);
|
||||
pipeline.SetViewports(0, viewports);
|
||||
pipeline.SetViewports(0, viewports, false);
|
||||
pipeline.SetPrimitiveTopology(GAL.PrimitiveTopology.TriangleStrip);
|
||||
pipeline.Draw(4, 1, 0, 0);
|
||||
|
||||
|
|
|
@ -829,7 +829,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
|
||||
// TODO: Remove first parameter.
|
||||
public void SetViewports(int first, ReadOnlySpan<GAL.Viewport> viewports)
|
||||
public void SetViewports(int first, ReadOnlySpan<GAL.Viewport> viewports, bool disableTransform)
|
||||
{
|
||||
int count = Math.Min(Constants.MaxViewports, viewports.Length);
|
||||
|
||||
|
@ -872,6 +872,19 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
}
|
||||
|
||||
float disableTransformF = disableTransform ? 1.0f : 0.0f;
|
||||
if (SupportBufferUpdater.Data.ViewportInverse.W != disableTransformF || disableTransform)
|
||||
{
|
||||
float scale = _renderScale[0].X;
|
||||
SupportBufferUpdater.UpdateViewportInverse(new Vector4<float>
|
||||
{
|
||||
X = scale * 2f / viewports[first].Region.Width,
|
||||
Y = scale * 2f / viewports[first].Region.Height,
|
||||
Z = 1,
|
||||
W = disableTransformF
|
||||
});
|
||||
}
|
||||
|
||||
_newState.ViewportsCount = (uint)count;
|
||||
SignalStateChange();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue