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 FileFormatVersionMinor = 2;
|
||||
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 SharedDataFileName = "shared.data";
|
||||
|
|
|
@ -1623,7 +1623,19 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||
|
||||
if (hasLodBias)
|
||||
{
|
||||
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;
|
||||
|
|
Reference in a new issue