From 4e130e7e38bdad74cdcb97a5fc1cf64d8d79585f Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Mon, 27 May 2024 23:41:11 -0400 Subject: [PATCH] Sample LOD Level --- .../CodeGen/Msl/Instructions/InstGenMemory.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/InstGenMemory.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/InstGenMemory.cs index 24c07e97c..a5e695afb 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/InstGenMemory.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/InstGenMemory.cs @@ -153,6 +153,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions bool isGather = (texOp.Flags & TextureFlags.Gather) != 0; bool isShadow = (texOp.Type & SamplerType.Shadow) != 0; bool intCoords = (texOp.Flags & TextureFlags.IntCoords) != 0; + bool hasLodLevel = (texOp.Flags & TextureFlags.LodLevel) != 0; bool isArray = (texOp.Type & SamplerType.Array) != 0; @@ -234,6 +235,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions texCall += ", " + Src(AggregateType.S32); } + if (hasLodLevel) + { + texCall += $", level({Src(coordType)})"; + } + // TODO: Support offsets texCall += ")" + (colorIsVector ? GetMaskMultiDest(texOp.Index) : "");