aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
index 5fcc1b27..c5ac06b3 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
@@ -254,7 +254,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
{
Dictionary<string, AstTextureOperation> samplers = new Dictionary<string, AstTextureOperation>();
- foreach (AstTextureOperation texOp in info.Samplers.OrderBy(x => x.Handle))
+ // Texture instructions other than TextureSample (like TextureSize)
+ // may have incomplete sampler type information. In those cases,
+ // we prefer instead the more accurate information from the
+ // TextureSample instruction, if both are available.
+ foreach (AstTextureOperation texOp in info.Samplers.OrderBy(x => x.Handle * 2 + (x.Inst == Instruction.TextureSample ? 0 : 1)))
{
string indexExpr = NumberFormatter.FormatInt(texOp.ArraySize);