[ShaderCompiler] Reserve a clip plane for position exports
This commit is contained in:
parent
34a2801a04
commit
b56d0da86d
|
|
@ -185,6 +185,7 @@ public static partial class Gen5SpirvTranslator
|
|||
private uint _layerOutput;
|
||||
private uint _viewportIndexOutput;
|
||||
private uint _clipDistanceCount;
|
||||
private uint _invalidPositionClipDistance = uint.MaxValue;
|
||||
private uint _cullDistanceCount;
|
||||
private uint _vertexIndexInput;
|
||||
private uint _instanceIndexInput;
|
||||
|
|
@ -6696,6 +6697,14 @@ public static partial class Gen5SpirvTranslator
|
|||
}
|
||||
}
|
||||
|
||||
if (_request.SupportsClipDistance && clipCount + cullCount < 8 &&
|
||||
_request.Program.Instructions.Any(static instruction =>
|
||||
instruction.Control is Gen5ExportControl { Target: 12, EnableMask: not 0 }))
|
||||
{
|
||||
// Use a separate plane so auxiliary position exports keep their own distances.
|
||||
_invalidPositionClipDistance = clipCount++;
|
||||
}
|
||||
|
||||
if (needPointSize)
|
||||
{
|
||||
_pointSizeOutput = DeclareBuiltInOutput(
|
||||
|
|
|
|||
Loading…
Reference in New Issue