mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-20 10:32:00 +00:00
SPIR-V: Only allow implicit LOD sampling on fragment (#5026)
This commit is contained in:
parent
bba51c2eeb
commit
69a9de33d3
2 changed files with 14 additions and 2 deletions
|
@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
|
||||||
private const ushort FileFormatVersionMajor = 1;
|
private const ushort FileFormatVersionMajor = 1;
|
||||||
private const ushort FileFormatVersionMinor = 2;
|
private const ushort FileFormatVersionMinor = 2;
|
||||||
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
|
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
|
||||||
private const uint CodeGenVersion = 4578;
|
private const uint CodeGenVersion = 5027;
|
||||||
|
|
||||||
private const string SharedTocFileName = "shared.toc";
|
private const string SharedTocFileName = "shared.toc";
|
||||||
private const string SharedDataFileName = "shared.data";
|
private const string SharedDataFileName = "shared.data";
|
||||||
|
|
|
@ -1626,6 +1626,18 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
||||||
lodBias = Src(AggregateType.FP32);
|
lodBias = Src(AggregateType.FP32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isGather && !intCoords && !isMultisample && !hasLodLevel && !hasDerivatives && context.Config.Stage != ShaderStage.Fragment)
|
||||||
|
{
|
||||||
|
// Implicit LOD is only valid on fragment.
|
||||||
|
// Use the LOD bias as explicit LOD if available.
|
||||||
|
|
||||||
|
lod = lodBias ?? context.Constant(context.TypeFP32(), 0f);
|
||||||
|
|
||||||
|
lodBias = null;
|
||||||
|
hasLodBias = false;
|
||||||
|
hasLodLevel = true;
|
||||||
|
}
|
||||||
|
|
||||||
SpvInstruction compIdx = null;
|
SpvInstruction compIdx = null;
|
||||||
|
|
||||||
// textureGather* optional extra component index,
|
// textureGather* optional extra component index,
|
||||||
|
|
Loading…
Reference in a new issue