aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Pipeline.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-10-20 19:03:20 -0300
committerGitHub <noreply@github.com>2020-10-20 19:03:20 -0300
commit2dcc6333f8cbb959293832f52857bdaeab1918bf (patch)
tree1aefd3ff6abb23d1a4efc78ee14274283b9041a4 /Ryujinx.Graphics.OpenGL/Pipeline.cs
parent08332bdc041a594d389b0b732b3c4b5f8573e3fb (diff)
Fix image binding format (#1625)
* Fix image binding format * XML doc
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs')
-rw-r--r--Ryujinx.Graphics.OpenGL/Pipeline.cs11
1 files changed, 6 insertions, 5 deletions
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);
+ }
}
}