mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-27 11:03:04 +00:00
Fix LOD
This commit is contained in:
parent
655823ecc7
commit
a6f5f2f82b
1 changed files with 4 additions and 2 deletions
|
@ -155,7 +155,6 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
||||||
return GenerateLoadOrStore(context, operation, isStore: false);
|
return GenerateLoadOrStore(context, operation, isStore: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: check this
|
|
||||||
public static string Lod(CodeGenContext context, AstOperation operation)
|
public static string Lod(CodeGenContext context, AstOperation operation)
|
||||||
{
|
{
|
||||||
AstTextureOperation texOp = (AstTextureOperation)operation;
|
AstTextureOperation texOp = (AstTextureOperation)operation;
|
||||||
|
@ -183,7 +182,10 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
||||||
coordsExpr = GetSourceExpr(context, texOp.GetSource(coordsIndex), AggregateType.FP32);
|
coordsExpr = GetSourceExpr(context, texOp.GetSource(coordsIndex), AggregateType.FP32);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $"textures.tex_{samplerName}.calculate_unclamped_lod(textures.samp_{samplerName}, {coordsExpr}){GetMaskMultiDest(texOp.Index)}";
|
var clamped = $"textures.tex_{samplerName}.calculate_clamped_lod(textures.samp_{samplerName}, {coordsExpr})";
|
||||||
|
var unclamped = $"textures.tex_{samplerName}.calculate_unclamped_lod(textures.samp_{samplerName}, {coordsExpr})";
|
||||||
|
|
||||||
|
return $"float2({clamped}, {unclamped}){GetMask(texOp.Index)}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string Store(CodeGenContext context, AstOperation operation)
|
public static string Store(CodeGenContext context, AstOperation operation)
|
||||||
|
|
Loading…
Reference in a new issue