Fix image binding format (#1625)

* Fix image binding format

* XML doc
This commit is contained in:
gdkchan 2020-10-20 19:03:20 -03:00 committed by GitHub
parent 08332bdc04
commit 2dcc6333f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 223 additions and 89 deletions

View file

@ -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);
}
}
}