aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-01-26 18:44:07 -0300
committerGitHub <noreply@github.com>2021-01-27 08:44:07 +1100
commitcaf049ed15f1c22d55aacfab79019538b2587e11 (patch)
tree33bf4b410a901fd8de49b79b73161976453e4837 /Ryujinx.Graphics.GAL
parentd6bd0470fb0507cc9c6069e577ae2814e614265b (diff)
Avoid some redundant GL calls (#1958)
Diffstat (limited to 'Ryujinx.Graphics.GAL')
-rw-r--r--Ryujinx.Graphics.GAL/IPipeline.cs3
-rw-r--r--Ryujinx.Graphics.GAL/VertexAttribDescriptor.cs22
2 files changed, 22 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.GAL/IPipeline.cs b/Ryujinx.Graphics.GAL/IPipeline.cs
index 96ccfb28..bb3a8dca 100644
--- a/Ryujinx.Graphics.GAL/IPipeline.cs
+++ b/Ryujinx.Graphics.GAL/IPipeline.cs
@@ -68,8 +68,7 @@ namespace Ryujinx.Graphics.GAL
void SetSampler(int binding, ISampler sampler);
- void SetScissorEnable(int index, bool enable);
- void SetScissor(int index, int x, int y, int width, int height);
+ void SetScissor(int index, bool enable, int x, int y, int width, int height);
void SetStencilTest(StencilTestDescriptor stencilTest);
diff --git a/Ryujinx.Graphics.GAL/VertexAttribDescriptor.cs b/Ryujinx.Graphics.GAL/VertexAttribDescriptor.cs
index 1547658e..b3248b62 100644
--- a/Ryujinx.Graphics.GAL/VertexAttribDescriptor.cs
+++ b/Ryujinx.Graphics.GAL/VertexAttribDescriptor.cs
@@ -1,6 +1,8 @@
+using System;
+
namespace Ryujinx.Graphics.GAL
{
- public struct VertexAttribDescriptor
+ public struct VertexAttribDescriptor : IEquatable<VertexAttribDescriptor>
{
public int BufferIndex { get; }
public int Offset { get; }
@@ -16,5 +18,23 @@ namespace Ryujinx.Graphics.GAL
IsZero = isZero;
Format = format;
}
+
+ public override bool Equals(object obj)
+ {
+ return obj is VertexAttribDescriptor other && Equals(other);
+ }
+
+ public bool Equals(VertexAttribDescriptor other)
+ {
+ return BufferIndex == other.BufferIndex &&
+ Offset == other.Offset &&
+ IsZero == other.IsZero &&
+ Format == other.Format;
+ }
+
+ public override int GetHashCode()
+ {
+ return HashCode.Combine(BufferIndex, Offset, IsZero, Format);
+ }
}
}