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

@ -345,14 +345,14 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
string indexedSamplerName = OperandManager.GetSamplerName(context.Config.Stage, texOp, indexExpr);
desc = new TextureDescriptor(indexedSamplerName, texOp.Type, texOp.Handle + index * 2);
desc = new TextureDescriptor(indexedSamplerName, texOp.Type, texOp.Format, texOp.Handle + index * 2);
context.TextureDescriptors.Add(desc);
}
}
else
{
desc = new TextureDescriptor(samplerName, texOp.Type, texOp.Handle);
desc = new TextureDescriptor(samplerName, texOp.Type, texOp.Format, texOp.Handle);
context.TextureDescriptors.Add(desc);
}
@ -371,10 +371,6 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
if (!images.TryAdd(imageName, texOp))
{
// Ensure that all texture operations share the same format.
// This avoid errors like mismatched formats.
texOp.Format = images[imageName].Format;
continue;
}
@ -404,14 +400,14 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
string indexedSamplerName = OperandManager.GetSamplerName(context.Config.Stage, texOp, indexExpr);
var desc = new TextureDescriptor(indexedSamplerName, texOp.Type, texOp.Handle + index * 2);
var desc = new TextureDescriptor(indexedSamplerName, texOp.Type, texOp.Format, texOp.Handle + index * 2);
context.TextureDescriptors.Add(desc);
}
}
else
{
var desc = new TextureDescriptor(imageName, texOp.Type, texOp.Handle);
var desc = new TextureDescriptor(imageName, texOp.Type, texOp.Format, texOp.Handle);
context.ImageDescriptors.Add(desc);
}