Sample LOD Level

This commit is contained in:
Isaac Marovitz 2024-05-27 23:41:11 -04:00 committed by Isaac Marovitz
parent 88dd2984be
commit a435d94fae

View file

@ -153,6 +153,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
bool isGather = (texOp.Flags & TextureFlags.Gather) != 0; bool isGather = (texOp.Flags & TextureFlags.Gather) != 0;
bool isShadow = (texOp.Type & SamplerType.Shadow) != 0; bool isShadow = (texOp.Type & SamplerType.Shadow) != 0;
bool intCoords = (texOp.Flags & TextureFlags.IntCoords) != 0; bool intCoords = (texOp.Flags & TextureFlags.IntCoords) != 0;
bool hasLodLevel = (texOp.Flags & TextureFlags.LodLevel) != 0;
bool isArray = (texOp.Type & SamplerType.Array) != 0; bool isArray = (texOp.Type & SamplerType.Array) != 0;
@ -234,6 +235,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
texCall += ", " + Src(AggregateType.S32); texCall += ", " + Src(AggregateType.S32);
} }
if (hasLodLevel)
{
texCall += $", level({Src(coordType)})";
}
// TODO: Support offsets // TODO: Support offsets
texCall += ")" + (colorIsVector ? GetMaskMultiDest(texOp.Index) : ""); texCall += ")" + (colorIsVector ? GetMaskMultiDest(texOp.Index) : "");