diff options
Diffstat (limited to 'Ryujinx.Graphics.Shader')
| -rw-r--r-- | Ryujinx.Graphics.Shader/Decoders/OpCodeTable.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs | 28 |
2 files changed, 25 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Shader/Decoders/OpCodeTable.cs b/Ryujinx.Graphics.Shader/Decoders/OpCodeTable.cs index 02a8be01..dcb6b1f6 100644 --- a/Ryujinx.Graphics.Shader/Decoders/OpCodeTable.cs +++ b/Ryujinx.Graphics.Shader/Decoders/OpCodeTable.cs @@ -166,7 +166,7 @@ namespace Ryujinx.Graphics.Shader.Decoders Set("000101xxxxxxxx", InstEmit.Iscadd, typeof(OpCodeAluImm32)); Set("0101110000011x", InstEmit.Iscadd, typeof(OpCodeAluReg)); Set("010010110101xx", InstEmit.Iset, typeof(OpCodeSetCbuf)); - Set("001101100101xx", InstEmit.Iset, typeof(OpCodeSetImm)); + Set("0011011x0101xx", InstEmit.Iset, typeof(OpCodeSetImm)); Set("010110110101xx", InstEmit.Iset, typeof(OpCodeSetReg)); Set("010010110110xx", InstEmit.Isetp, typeof(OpCodeSetCbuf)); Set("0011011x0110xx", InstEmit.Isetp, typeof(OpCodeSetImm)); diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs index 4f8100cb..18552d0a 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs @@ -376,6 +376,7 @@ namespace Ryujinx.Graphics.Shader.Instructions { case TextureTarget.Texture1DLodZero: sourcesList.Add(Ra()); + sourcesList.Add(ConstF(0)); break; case TextureTarget.Texture2D: @@ -429,11 +430,21 @@ namespace Ryujinx.Graphics.Shader.Instructions flags = ConvertTextureFlags(tldsOp.Target) | TextureFlags.IntCoords; + if (tldsOp.Target == TexelLoadTarget.Texture1DLodZero && context.Config.QueryInfoBool(QueryInfoName.IsTextureBuffer, tldsOp.Immediate)) + { + type = SamplerType.TextureBuffer; + flags &= ~TextureFlags.LodLevel; + } + switch (tldsOp.Target) { case TexelLoadTarget.Texture1DLodZero: sourcesList.Add(Ra()); - sourcesList.Add(Const(0)); + + if (type != SamplerType.TextureBuffer) + { + sourcesList.Add(Const(0)); + } break; case TexelLoadTarget.Texture1DLodLevel: @@ -615,8 +626,7 @@ namespace Ryujinx.Graphics.Shader.Instructions List<Operand> sourcesList = new List<Operand>(); - SamplerType type = ConvertSamplerType(op.Dimensions); - + SamplerType type = ConvertSamplerType(op.Dimensions); TextureFlags flags = TextureFlags.Gather; if (op.Bindless) @@ -1008,6 +1018,16 @@ namespace Ryujinx.Graphics.Shader.Instructions type |= SamplerType.Multisample; } + if (type == SamplerType.Texture1D && flags == TextureFlags.IntCoords && !isBindless) + { + bool isTypeBuffer = context.Config.QueryInfoBool(QueryInfoName.IsTextureBuffer, op.Immediate); + + if (isTypeBuffer) + { + type = SamplerType.TextureBuffer; + } + } + Operand[] sources = sourcesList.ToArray(); int rdIndex = op.Rd.Index; @@ -1190,7 +1210,7 @@ namespace Ryujinx.Graphics.Shader.Instructions return SamplerType.None; } - private static TextureFlags ConvertTextureFlags(Decoders.TextureTarget type) + private static TextureFlags ConvertTextureFlags(TextureTarget type) { switch (type) { |
