aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Pipeline.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-03-29 09:48:39 -0300
committerGitHub <noreply@github.com>2020-03-29 23:48:39 +1100
commitb18ef8e3a00980595f45c7fe184dcb160dcc3cb9 (patch)
tree9d9b3fea4d7822d548878988c12c18e23a72bb52 /Ryujinx.Graphics.OpenGL/Pipeline.cs
parent5c1757f7c29fc06577b5fc551dd3d76b12b281d3 (diff)
Workaround for AMD and Intel view format bug (#1050)
* Workaround for Intel view format bug * Dispose of the intermmediate texture aswell * Apply workaround on AMD aswell
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs')
-rw-r--r--Ryujinx.Graphics.OpenGL/Pipeline.cs44
1 files changed, 26 insertions, 18 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs
index f01e7c7a..3480cf82 100644
--- a/Ryujinx.Graphics.OpenGL/Pipeline.cs
+++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs
@@ -19,14 +19,14 @@ namespace Ryujinx.Graphics.OpenGL
private PrimitiveType _primitiveType;
- private int _stencilFrontMask;
+ private int _stencilFrontMask;
private bool _depthMask;
private bool _depthTest;
private bool _hasDepthBuffer;
private TextureView _unit0Texture;
- private ClipOrigin _clipOrigin;
+ private ClipOrigin _clipOrigin;
private ClipDepthMode _clipDepthMode;
private uint[] _componentMasks;
@@ -35,7 +35,7 @@ namespace Ryujinx.Graphics.OpenGL
internal Pipeline()
{
- _clipOrigin = ClipOrigin.LowerLeft;
+ _clipOrigin = ClipOrigin.LowerLeft;
_clipDepthMode = ClipDepthMode.NegativeOneToOne;
_scissorEnable = new bool[8];
@@ -60,6 +60,8 @@ namespace Ryujinx.Graphics.OpenGL
GL.ClearBuffer(ClearBuffer.Color, index, colors);
RestoreComponentMask(index);
+
+ _framebuffer.SignalModified();
}
public void ClearRenderTargetDepthStencil(float depthValue, bool depthMask, int stencilValue, int stencilMask)
@@ -102,6 +104,8 @@ namespace Ryujinx.Graphics.OpenGL
{
GL.DepthMask(_depthMask);
}
+
+ _framebuffer.SignalModified();
}
public void DispatchCompute(int groupsX, int groupsY, int groupsZ)
@@ -141,6 +145,8 @@ namespace Ryujinx.Graphics.OpenGL
{
DrawImpl(vertexCount, instanceCount, firstVertex, firstInstance);
}
+
+ _framebuffer.SignalModified();
}
private void DrawQuadsImpl(
@@ -251,7 +257,7 @@ namespace Ryujinx.Graphics.OpenGL
switch (_elementsType)
{
case DrawElementsType.UnsignedShort: indexElemSize = 2; break;
- case DrawElementsType.UnsignedInt: indexElemSize = 4; break;
+ case DrawElementsType.UnsignedInt: indexElemSize = 4; break;
}
IntPtr indexBaseOffset = _indexBaseOffset + firstIndex * indexElemSize;
@@ -285,15 +291,17 @@ namespace Ryujinx.Graphics.OpenGL
firstVertex,
firstInstance);
}
+
+ _framebuffer.SignalModified();
}
private void DrawQuadsIndexedImpl(
- int indexCount,
- int instanceCount,
+ int indexCount,
+ int instanceCount,
IntPtr indexBaseOffset,
- int indexElemSize,
- int firstVertex,
- int firstInstance)
+ int indexElemSize,
+ int firstVertex,
+ int firstInstance)
{
int quadsCount = indexCount / 4;
@@ -367,12 +375,12 @@ namespace Ryujinx.Graphics.OpenGL
}
private void DrawQuadStripIndexedImpl(
- int indexCount,
- int instanceCount,
+ int indexCount,
+ int instanceCount,
IntPtr indexBaseOffset,
- int indexElemSize,
- int firstVertex,
- int firstInstance)
+ int indexElemSize,
+ int firstVertex,
+ int firstInstance)
{
// TODO: Instanced rendering.
int quadsCount = (indexCount - 2) / 2;
@@ -408,11 +416,11 @@ namespace Ryujinx.Graphics.OpenGL
}
private void DrawIndexedImpl(
- int indexCount,
- int instanceCount,
+ int indexCount,
+ int instanceCount,
IntPtr indexBaseOffset,
- int firstVertex,
- int firstInstance)
+ int firstVertex,
+ int firstInstance)
{
if (firstInstance == 0 && firstVertex == 0 && instanceCount == 1)
{