fix: pass array index as an additional argument to sample
This commit is contained in:
parent
73bb0712a8
commit
fefdabf257
1 changed files with 6 additions and 20 deletions
|
@ -184,13 +184,6 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
|||
|
||||
int pCount = coordsCount;
|
||||
|
||||
int arrayIndexElem = -1;
|
||||
|
||||
if (isArray)
|
||||
{
|
||||
arrayIndexElem = pCount++;
|
||||
}
|
||||
|
||||
if (isShadow && !isGather)
|
||||
{
|
||||
pCount++;
|
||||
|
@ -210,21 +203,9 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
|||
string[] elems = new string[count];
|
||||
|
||||
for (int index = 0; index < count; index++)
|
||||
{
|
||||
if (arrayIndexElem == index)
|
||||
{
|
||||
elems[index] = Src(AggregateType.S32);
|
||||
|
||||
if (!intCoords)
|
||||
{
|
||||
elems[index] = "float(" + elems[index] + ")";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elems[index] = Src(coordType);
|
||||
}
|
||||
}
|
||||
|
||||
string prefix = intCoords ? "int" : "float";
|
||||
|
||||
|
@ -238,6 +219,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
|||
|
||||
Append(AssemblePVector(pCount));
|
||||
|
||||
if (isArray)
|
||||
{
|
||||
texCall += ", " + Src(AggregateType.S32);
|
||||
}
|
||||
|
||||
texCall += ")" + (colorIsVector ? GetMaskMultiDest(texOp.Index) : "");
|
||||
|
||||
return texCall;
|
||||
|
|
Loading…
Reference in a new issue