mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-18 22:12:14 +00:00
Fix array size query
This commit is contained in:
parent
c7c80dc2fb
commit
e928ec9708
1 changed files with 10 additions and 2 deletions
|
@ -605,6 +605,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
||||||
{
|
{
|
||||||
context.Properties.Textures.TryGetValue(texOp.GetTextureSetAndBinding(), out TextureDefinition definition);
|
context.Properties.Textures.TryGetValue(texOp.GetTextureSetAndBinding(), out TextureDefinition definition);
|
||||||
bool hasLod = !definition.Type.HasFlag(SamplerType.Multisample) && (definition.Type & SamplerType.Mask) != SamplerType.TextureBuffer;
|
bool hasLod = !definition.Type.HasFlag(SamplerType.Multisample) && (definition.Type & SamplerType.Mask) != SamplerType.TextureBuffer;
|
||||||
|
bool isArray = definition.Type.HasFlag(SamplerType.Array);
|
||||||
texCallBuilder.Append("get_");
|
texCallBuilder.Append("get_");
|
||||||
|
|
||||||
if (texOp.Index == 0)
|
if (texOp.Index == 0)
|
||||||
|
@ -617,12 +618,19 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
texCallBuilder.Append("depth");
|
if (isArray)
|
||||||
|
{
|
||||||
|
texCallBuilder.Append("array_size");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
texCallBuilder.Append("depth");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
texCallBuilder.Append('(');
|
texCallBuilder.Append('(');
|
||||||
|
|
||||||
if (hasLod)
|
if (hasLod && !isArray)
|
||||||
{
|
{
|
||||||
IAstNode lod = operation.GetSource(0);
|
IAstNode lod = operation.GetSource(0);
|
||||||
string lodExpr = GetSourceExpr(context, lod, GetSrcVarType(operation.Inst, 0));
|
string lodExpr = GetSourceExpr(context, lod, GetSrcVarType(operation.Inst, 0));
|
||||||
|
|
Loading…
Reference in a new issue