aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Translation/Rewriter.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-07-12 16:20:33 -0300
committerGitHub <noreply@github.com>2021-07-12 16:20:33 -0300
commit9b08abc644c4afcb1b4eb59bfbe8057727ad9d70 (patch)
tree26b7af4caaf6e181774c94084873e6781ef1298f /Ryujinx.Graphics.Shader/Translation/Rewriter.cs
parent40b21cc3c4d2622bbd4f88d43073341854d9a671 (diff)
Fix shader compilation on shaders that uses rectangle textures (#2471)
Diffstat (limited to 'Ryujinx.Graphics.Shader/Translation/Rewriter.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Translation/Rewriter.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/Rewriter.cs b/Ryujinx.Graphics.Shader/Translation/Rewriter.cs
index 84aa7c10..fba586c8 100644
--- a/Ryujinx.Graphics.Shader/Translation/Rewriter.cs
+++ b/Ryujinx.Graphics.Shader/Translation/Rewriter.cs
@@ -291,6 +291,8 @@ namespace Ryujinx.Graphics.Shader.Translation
// We normalize by dividing the coords by the texture size.
if (isRect && !intCoords)
{
+ config.SetUsedFeature(FeatureFlags.IntegerSampling);
+
for (int index = 0; index < coordsCount; index++)
{
Operand coordSize = Local();
@@ -311,11 +313,14 @@ namespace Ryujinx.Graphics.Shader.Translation
texOp.Type,
texOp.Format,
texOp.Flags,
+ texOp.CbufSlot,
texOp.Handle,
index,
coordSize,
texSizeSources));
+ config.SetUsedTexture(Instruction.TextureSize, texOp.Type, texOp.Format, texOp.Flags, texOp.CbufSlot, texOp.Handle);
+
Operand source = sources[coordsIndex + index];
Operand coordNormalized = Local();
@@ -352,6 +357,8 @@ namespace Ryujinx.Graphics.Shader.Translation
}
else
{
+ config.SetUsedFeature(FeatureFlags.IntegerSampling);
+
Operand lod = Local();
node.List.AddBefore(node, new TextureOperation(
@@ -359,6 +366,7 @@ namespace Ryujinx.Graphics.Shader.Translation
texOp.Type,
texOp.Format,
texOp.Flags,
+ texOp.CbufSlot,
texOp.Handle,
0,
lod,
@@ -384,11 +392,14 @@ namespace Ryujinx.Graphics.Shader.Translation
texOp.Type,
texOp.Format,
texOp.Flags,
+ texOp.CbufSlot,
texOp.Handle,
index,
coordSize,
texSizeSources));
+ config.SetUsedTexture(Instruction.TextureSize, texOp.Type, texOp.Format, texOp.Flags, texOp.CbufSlot, texOp.Handle);
+
Operand offset = Local();
Operand intOffset = offsets[index + (hasOffsets ? texOp.Index * coordsCount : 0)];
@@ -420,6 +431,7 @@ namespace Ryujinx.Graphics.Shader.Translation
texOp.Type,
texOp.Format,
texOp.Flags & ~(TextureFlags.Offset | TextureFlags.Offsets),
+ texOp.CbufSlot,
texOp.Handle,
componentIndex,
texOp.Dest,