From 2dcc6333f8cbb959293832f52857bdaeab1918bf Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 20 Oct 2020 19:03:20 -0300 Subject: Fix image binding format (#1625) * Fix image binding format * XML doc --- Ryujinx.Graphics.OpenGL/Pipeline.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs') diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs index 52d64df5..2650e9ee 100644 --- a/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -693,7 +693,7 @@ namespace Ryujinx.Graphics.OpenGL SetFrontFace(_frontFace = frontFace.Convert()); } - public void SetImage(int index, ShaderStage stage, ITexture texture) + public void SetImage(int index, ShaderStage stage, ITexture texture, Format imageFormat) { int unit = _program.GetImageUnit(stage, index); @@ -701,11 +701,12 @@ namespace Ryujinx.Graphics.OpenGL { TextureBase texBase = (TextureBase)texture; - FormatInfo formatInfo = FormatTable.GetFormatInfo(texBase.Format); + SizedInternalFormat format = FormatTable.GetImageFormat(imageFormat); - SizedInternalFormat format = (SizedInternalFormat)formatInfo.PixelInternalFormat; - - GL.BindImageTexture(unit, texBase.Handle, 0, true, 0, TextureAccess.ReadWrite, format); + if (format != 0) + { + GL.BindImageTexture(unit, texBase.Handle, 0, true, 0, TextureAccess.ReadWrite, format); + } } } -- cgit v1.2.3