1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-12 14:12:03 +00:00

Preserve image types for shader bindless surface instructions (.D variants) (#2779)

* Preserve image types for SULD/SUST .D variants

* Make format unknown for surface atomic if bindless and not sized
This commit is contained in:
gdkchan 2021-10-24 19:40:20 -03:00 committed by GitHub
parent 51fa1b2cb0
commit 04dfb86fde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 10 deletions

View file

@ -264,8 +264,8 @@ namespace Ryujinx.Graphics.Shader.Instructions
}
// TODO: FP and 64-bit formats.
TextureFormat format = !isBindless && (size == SuatomSize.Sd32 || size == SuatomSize.Sd64)
? context.Config.GetTextureFormatAtomic(imm)
TextureFormat format = size == SuatomSize.Sd32 || size == SuatomSize.Sd64
? (isBindless ? TextureFormat.Unknown : context.Config.GetTextureFormatAtomic(imm))
: GetTextureFormat(size);
if (compareAndSwap)
@ -516,8 +516,8 @@ namespace Ryujinx.Graphics.Shader.Instructions
}
// TODO: FP and 64-bit formats.
TextureFormat format = !isBindless && (size == SuatomSize.Sd32 || size == SuatomSize.Sd64)
? context.Config.GetTextureFormatAtomic(imm)
TextureFormat format = size == SuatomSize.Sd32 || size == SuatomSize.Sd64
? (isBindless ? TextureFormat.Unknown : context.Config.GetTextureFormatAtomic(imm))
: GetTextureFormat(size);
sourcesList.Add(Rb());

View file

@ -128,13 +128,16 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
int cbufOffset = src0.GetCbufOffset();
int cbufSlot = src0.GetCbufSlot();
if (texOp.Inst == Instruction.ImageAtomic)
if (texOp.Format == TextureFormat.Unknown)
{
texOp.Format = config.GetTextureFormatAtomic(cbufOffset, cbufSlot);
}
else
{
texOp.Format = config.GetTextureFormat(cbufOffset, cbufSlot);
if (texOp.Inst == Instruction.ImageAtomic)
{
texOp.Format = config.GetTextureFormatAtomic(cbufOffset, cbufSlot);
}
else
{
texOp.Format = config.GetTextureFormat(cbufOffset, cbufSlot);
}
}
SetHandle(config, texOp, cbufOffset, cbufSlot, false);