forked from Mirror/Ryujinx
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:
parent
51fa1b2cb0
commit
04dfb86fde
2 changed files with 13 additions and 10 deletions
|
@ -264,8 +264,8 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: FP and 64-bit formats.
|
// TODO: FP and 64-bit formats.
|
||||||
TextureFormat format = !isBindless && (size == SuatomSize.Sd32 || size == SuatomSize.Sd64)
|
TextureFormat format = size == SuatomSize.Sd32 || size == SuatomSize.Sd64
|
||||||
? context.Config.GetTextureFormatAtomic(imm)
|
? (isBindless ? TextureFormat.Unknown : context.Config.GetTextureFormatAtomic(imm))
|
||||||
: GetTextureFormat(size);
|
: GetTextureFormat(size);
|
||||||
|
|
||||||
if (compareAndSwap)
|
if (compareAndSwap)
|
||||||
|
@ -516,8 +516,8 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: FP and 64-bit formats.
|
// TODO: FP and 64-bit formats.
|
||||||
TextureFormat format = !isBindless && (size == SuatomSize.Sd32 || size == SuatomSize.Sd64)
|
TextureFormat format = size == SuatomSize.Sd32 || size == SuatomSize.Sd64
|
||||||
? context.Config.GetTextureFormatAtomic(imm)
|
? (isBindless ? TextureFormat.Unknown : context.Config.GetTextureFormatAtomic(imm))
|
||||||
: GetTextureFormat(size);
|
: GetTextureFormat(size);
|
||||||
|
|
||||||
sourcesList.Add(Rb());
|
sourcesList.Add(Rb());
|
||||||
|
|
|
@ -128,6 +128,8 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||||
int cbufOffset = src0.GetCbufOffset();
|
int cbufOffset = src0.GetCbufOffset();
|
||||||
int cbufSlot = src0.GetCbufSlot();
|
int cbufSlot = src0.GetCbufSlot();
|
||||||
|
|
||||||
|
if (texOp.Format == TextureFormat.Unknown)
|
||||||
|
{
|
||||||
if (texOp.Inst == Instruction.ImageAtomic)
|
if (texOp.Inst == Instruction.ImageAtomic)
|
||||||
{
|
{
|
||||||
texOp.Format = config.GetTextureFormatAtomic(cbufOffset, cbufSlot);
|
texOp.Format = config.GetTextureFormatAtomic(cbufOffset, cbufSlot);
|
||||||
|
@ -136,6 +138,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||||
{
|
{
|
||||||
texOp.Format = config.GetTextureFormat(cbufOffset, cbufSlot);
|
texOp.Format = config.GetTextureFormat(cbufOffset, cbufSlot);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SetHandle(config, texOp, cbufOffset, cbufSlot, false);
|
SetHandle(config, texOp, cbufOffset, cbufSlot, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue