Fix InvocationInfo on geometry shader and bindless default integer const (#2822)
* Fix InvocationInfo on geometry shader and bindless default integer const * Shader cache version bump * Consistency for the default value
This commit is contained in:
parent
81e9b86cdb
commit
b7a1544e8b
3 changed files with 31 additions and 8 deletions
|
@ -95,9 +95,28 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||
if (context.Config.Stage != ShaderStage.Compute && context.Config.Stage != ShaderStage.Fragment)
|
||||
{
|
||||
Operand primitiveId = Attribute(AttributeConsts.PrimitiveId);
|
||||
Operand patchVerticesIn = Attribute(AttributeConsts.PatchVerticesIn);
|
||||
Operand patchVerticesIn;
|
||||
|
||||
patchVerticesIn = context.ShiftLeft(patchVerticesIn, Const(16));
|
||||
if (context.Config.Stage == ShaderStage.TessellationEvaluation)
|
||||
{
|
||||
patchVerticesIn = context.ShiftLeft(Attribute(AttributeConsts.PatchVerticesIn), Const(16));
|
||||
}
|
||||
else
|
||||
{
|
||||
InputTopology inputTopology = context.Config.GpuAccessor.QueryPrimitiveTopology();
|
||||
|
||||
int inputVertices = inputTopology switch
|
||||
{
|
||||
InputTopology.Points => 1,
|
||||
InputTopology.Lines or
|
||||
InputTopology.LinesAdjacency => 2,
|
||||
InputTopology.Triangles or
|
||||
InputTopology.TrianglesAdjacency => 3,
|
||||
_ => 1
|
||||
};
|
||||
|
||||
patchVerticesIn = Const(inputVertices << 16);
|
||||
}
|
||||
|
||||
src = context.BitwiseOr(primitiveId, patchVerticesIn);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue