From c308158296a12a2012021f40d1eea65b11271780 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 13 Aug 2018 19:19:27 -0300 Subject: [PATCH] Disable multiple attachments --- Ryujinx.Graphics/Gal/ImageFormatConverter.cs | 2 ++ Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs | 6 ++---- Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs | 2 +- Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs | 5 ++++- Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs | 5 +---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Ryujinx.Graphics/Gal/ImageFormatConverter.cs b/Ryujinx.Graphics/Gal/ImageFormatConverter.cs index 09166cf66a..07385545c5 100644 --- a/Ryujinx.Graphics/Gal/ImageFormatConverter.cs +++ b/Ryujinx.Graphics/Gal/ImageFormatConverter.cs @@ -62,6 +62,8 @@ namespace Ryujinx.Graphics.Gal case GalFrameBufferFormat.R11G11B10Float: return GalImageFormat.BF10GF11RF11; case GalFrameBufferFormat.RGBA32Float: return GalImageFormat.R32G32B32A32; case GalFrameBufferFormat.RG16Snorm: return GalImageFormat.G16R16; + case GalFrameBufferFormat.RG16Float: return GalImageFormat.G16R16; //Stubbed + case GalFrameBufferFormat.RG8Snorm: return GalImageFormat.R8; //Stubbed } throw new NotImplementedException(Format.ToString()); diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs index 5082554135..4958b53b3b 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs @@ -36,12 +36,10 @@ namespace Ryujinx.Graphics.Gal.OpenGL public void SetData(long Key, long Size, IntPtr HostAddress) { - if (!Cache.TryGetValue(Key, out OGLStreamBuffer Buffer)) + if (Cache.TryGetValue(Key, out OGLStreamBuffer Buffer)) { - throw new InvalidOperationException(); + Buffer.SetData(Size, HostAddress); } - - Buffer.SetData(Size, HostAddress); } public bool TryGetUbo(long Key, out int UboHandle) diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs index 6a60a785d3..525d3facfc 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs @@ -160,7 +160,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL case GalImageFormat.BC2: return InternalFormat.CompressedRgbaS3tcDxt3Ext; case GalImageFormat.BC3: return InternalFormat.CompressedRgbaS3tcDxt5Ext; case GalImageFormat.BC4: return InternalFormat.CompressedRedRgtc1; - case GalImageFormat.BC5: return InternalFormat.CompressedRgRgtc2; + case GalImageFormat.BC5: return InternalFormat.CompressedSignedRgRgtc2; } throw new NotImplementedException(Format.ToString()); diff --git a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs index 08d3f64cdd..981058e72b 100644 --- a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs +++ b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs @@ -829,8 +829,11 @@ namespace Ryujinx.Graphics.Gal.Shader { return "gl_PointSize"; } + } - throw new InvalidOperationException(); + if (DeclInfo.Index >= 16) + { + throw new InvalidOperationException($"Shader attribute offset {Abuf.Offs} is invalid."); } if (Decl.ShaderType == GalShaderType.Geometry) diff --git a/Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs b/Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs index f89ac0595c..28142e6418 100644 --- a/Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs +++ b/Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs @@ -102,10 +102,7 @@ namespace Ryujinx.HLE.Gpu.Engines SetAlphaBlending(State); SetPrimitiveRestart(State); - for (int FbIndex = 0; FbIndex < 8; FbIndex++) - { - SetFrameBuffer(Vmm, FbIndex); - } + SetFrameBuffer(Vmm, 0); SetZeta(Vmm); long[] Keys = UploadShaders(Vmm);