Support res scale on images, correctly blacklist for SUST, move logic out of backend. (#1657)

* Support res scale on images, correctly blacklist for SUST, move logic
out of backend.

* Fix Typo
This commit is contained in:
riperiperi 2020-11-02 19:53:23 +00:00 committed by GitHub
parent 11a7c99764
commit e1da7df207
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 199 additions and 78 deletions

View file

@ -84,7 +84,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
AppendLine("}" + suffix);
}
public int FindTextureDescriptorIndex(AstTextureOperation texOp)
private int FindDescriptorIndex(List<TextureDescriptor> list, AstTextureOperation texOp)
{
AstOperand operand = texOp.GetSource(0) as AstOperand;
bool bindless = (texOp.Flags & TextureFlags.Bindless) > 0;
@ -92,13 +92,24 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
int cBufSlot = bindless ? operand.CbufSlot : 0;
int cBufOffset = bindless ? operand.CbufOffset : 0;
return TextureDescriptors.FindIndex(descriptor =>
return list.FindIndex(descriptor =>
descriptor.Type == texOp.Type &&
descriptor.HandleIndex == texOp.Handle &&
descriptor.Format == texOp.Format &&
descriptor.CbufSlot == cBufSlot &&
descriptor.CbufOffset == cBufOffset);
}
public int FindTextureDescriptorIndex(AstTextureOperation texOp)
{
return FindDescriptorIndex(TextureDescriptors, texOp);
}
public int FindImageDescriptorIndex(AstTextureOperation texOp)
{
return FindDescriptorIndex(ImageDescriptors, texOp);
}
public StructuredFunction GetFunction(int id)
{
return _info.Functions[id];