aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-08-11 19:44:41 -0300
committerGitHub <noreply@github.com>2021-08-11 19:44:41 -0300
commit0ba4ade8f1fa64e2bda5c4b1e0c5b37e10d51c80 (patch)
tree74653fad02702bc35cf7f006fcc9e470da217644 /Ryujinx.Graphics.OpenGL
parent3148c0c21cb45a92ff77344027757fb4808bb3cb (diff)
Ensure render scale is initialized to 1 on the backend (#2543)
Diffstat (limited to 'Ryujinx.Graphics.OpenGL')
-rw-r--r--Ryujinx.Graphics.OpenGL/Pipeline.cs19
-rw-r--r--Ryujinx.Graphics.OpenGL/Renderer.cs1
2 files changed, 12 insertions, 8 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs
index 9c39f719..7c626f54 100644
--- a/Ryujinx.Graphics.OpenGL/Pipeline.cs
+++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs
@@ -76,13 +76,22 @@ namespace Ryujinx.Graphics.OpenGL
_componentMasks[index] = 0xf;
}
- var v4Zero = new Vector4<float> { X = 0f, Y = 0f, Z = 0f, W = 0f };
- new Span<Vector4<float>>(_renderScale).Fill(v4Zero);
+ var defaultScale = new Vector4<float> { X = 1f, Y = 0f, Z = 0f, W = 0f };
+ new Span<Vector4<float>>(_renderScale).Fill(defaultScale);
_tfbs = new BufferHandle[Constants.MaxTransformFeedbackBuffers];
_tfbTargets = new BufferRange[Constants.MaxTransformFeedbackBuffers];
}
+ public void Initialize()
+ {
+ _supportBuffer = Buffer.Create(SupportBuffer.RequiredSize);
+ GL.BindBufferBase(BufferRangeTarget.UniformBuffer, 0, Unsafe.As<BufferHandle, int>(ref _supportBuffer));
+
+ SetSupportBufferData<Vector4<int>>(SupportBuffer.FragmentIsBgraOffset, _fpIsBgra, SupportBuffer.FragmentIsBgraCount);
+ SetSupportBufferData<Vector4<float>>(SupportBuffer.FragmentRenderScaleOffset, _renderScale, SupportBuffer.RenderScaleMaxCount);
+ }
+
public void Barrier()
{
GL.MemoryBarrier(MemoryBarrierFlags.AllBarrierBits);
@@ -1207,12 +1216,6 @@ namespace Ryujinx.Graphics.OpenGL
private void SetSupportBufferData<T>(int offset, ReadOnlySpan<T> data, int count) where T : unmanaged
{
- if (_supportBuffer == BufferHandle.Null)
- {
- _supportBuffer = Buffer.Create(SupportBuffer.RequiredSize);
- GL.BindBufferBase(BufferRangeTarget.UniformBuffer, 0, Unsafe.As<BufferHandle, int>(ref _supportBuffer));
- }
-
Buffer.SetData(_supportBuffer, offset, MemoryMarshal.Cast<T, byte>(data.Slice(0, count)));
}
diff --git a/Ryujinx.Graphics.OpenGL/Renderer.cs b/Ryujinx.Graphics.OpenGL/Renderer.cs
index 22648fd1..01072176 100644
--- a/Ryujinx.Graphics.OpenGL/Renderer.cs
+++ b/Ryujinx.Graphics.OpenGL/Renderer.cs
@@ -144,6 +144,7 @@ namespace Ryujinx.Graphics.OpenGL
GL.Arb.MaxShaderCompilerThreads(Math.Min(Environment.ProcessorCount, 8));
}
+ _pipeline.Initialize();
_counters.Initialize();
}