aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-08-03 13:54:34 -0300
committerGitHub <noreply@github.com>2018-08-03 13:54:34 -0300
commitfa70629fabbab5074640f55cb70f9d7d82cf91cb (patch)
tree66a5befd2ad5cb734fc88770ca42c072752a8c3b /Ryujinx.Graphics
parentc68bca5396f8a5e08cd8234ea0c7a8a2174eba91 (diff)
Fix for integer vertex attributes and iset bf flag (#323)
Diffstat (limited to 'Ryujinx.Graphics')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs14
-rw-r--r--Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs11
2 files changed, 19 insertions, 6 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
index f2e5859e..c5166b51 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
@@ -278,7 +278,19 @@ namespace Ryujinx.Graphics.Gal.OpenGL
int Size = AttribElements[Attrib.Size];
int Offset = Attrib.Offset;
- GL.VertexAttribPointer(Attrib.Index, Size, Type, Normalize, Stride, Offset);
+ if (Attrib.Type == GalVertexAttribType.Sint ||
+ Attrib.Type == GalVertexAttribType.Uint)
+ {
+ IntPtr Pointer = new IntPtr(Offset);
+
+ VertexAttribIntegerType IType = (VertexAttribIntegerType)Type;
+
+ GL.VertexAttribIPointer(Attrib.Index, Size, IType, Stride, Pointer);
+ }
+ else
+ {
+ GL.VertexAttribPointer(Attrib.Index, Size, Type, Normalize, Stride, Offset);
+ }
}
}
diff --git a/Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs b/Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs
index 00f072f1..8486d8a7 100644
--- a/Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs
+++ b/Ryujinx.Graphics/Gal/Shader/ShaderDecodeAlu.cs
@@ -871,11 +871,12 @@ namespace Ryujinx.Graphics.Gal.Shader
private static void EmitSet(ShaderIrBlock Block, long OpCode, bool IsFloat, ShaderOper Oper)
{
- bool NegA = ((OpCode >> 43) & 1) != 0;
- bool AbsB = ((OpCode >> 44) & 1) != 0;
- bool BoolFloat = ((OpCode >> 52) & 1) != 0;
- bool NegB = ((OpCode >> 53) & 1) != 0;
- bool AbsA = ((OpCode >> 54) & 1) != 0;
+ bool NegA = ((OpCode >> 43) & 1) != 0;
+ bool AbsB = ((OpCode >> 44) & 1) != 0;
+ bool NegB = ((OpCode >> 53) & 1) != 0;
+ bool AbsA = ((OpCode >> 54) & 1) != 0;
+
+ bool BoolFloat = ((OpCode >> (IsFloat ? 52 : 44)) & 1) != 0;
ShaderIrNode OperA = GetOperGpr8(OpCode), OperB;