mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-09-07 10:42:45 +02:00
macOS: Fix NaN texture coordinates resolving toward max on Apple GPUs (#182)
This PR fixes Animal Crossing: New Horizons backdrops on Apple Silicon being white instead of black. Credit to [mtmasantana](https://github.com/mtmasantana) for the fix. More info on the Issues page: https://github.com/Ryubing/Issues/issues/476   Co-authored-by: mtmasantana <245373187+mtmasantana@users.noreply.github.com> Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/182
This commit is contained in:
committed by
LotP
co-authored by
mtmasantana
parent
b251318225
commit
e2a612b114
@@ -1241,6 +1241,23 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
||||
|
||||
SpvInstruction pCoords = AssemblePVector(pCount);
|
||||
|
||||
if (!intCoords)
|
||||
{
|
||||
SpvInstruction nfFp32 = context.TypeFP32();
|
||||
SpvInstruction nfType = pCount > 1 ? context.TypeVector(nfFp32, pCount) : nfFp32;
|
||||
SpvInstruction nfZero = context.Constant(nfFp32, 0f);
|
||||
|
||||
if (pCount > 1)
|
||||
{
|
||||
SpvInstruction[] nfElems = new SpvInstruction[pCount];
|
||||
for (int nfI = 0; nfI < pCount; nfI++) { nfElems[nfI] = nfZero; }
|
||||
nfZero = context.ConstantComposite(nfType, nfElems);
|
||||
}
|
||||
|
||||
SpvInstruction nfBool = pCount > 1 ? context.TypeVector(context.TypeBool(), pCount) : context.TypeBool();
|
||||
pCoords = context.Select(nfType, context.IsNan(nfBool, pCoords), nfZero, pCoords);
|
||||
}
|
||||
|
||||
SpvInstruction AssembleDerivativesVector(int count)
|
||||
{
|
||||
if (count > 1)
|
||||
|
||||
Reference in New Issue
Block a user