Initial tessellation shader support (#2534)
* Initial tessellation shader support * Nits * Re-arrange built-in table * This is not needed anymore * PR feedback
This commit is contained in:
parent
7603dbe3c8
commit
d512ce122c
42 changed files with 775 additions and 148 deletions
|
@ -40,19 +40,33 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||
|
||||
context.Config.SetUsedFeature(FeatureFlags.IaIndexing);
|
||||
}
|
||||
else if (op.SrcB == RegisterConsts.RegisterZeroIndex)
|
||||
else if (op.SrcB == RegisterConsts.RegisterZeroIndex || op.P)
|
||||
{
|
||||
Operand src = Attribute(op.Imm11 + index * 4);
|
||||
int offset = op.Imm11 + index * 4;
|
||||
|
||||
context.FlagAttributeRead(src.Value);
|
||||
context.FlagAttributeRead(offset);
|
||||
|
||||
if (op.O)
|
||||
{
|
||||
offset |= AttributeConsts.LoadOutputMask;
|
||||
}
|
||||
|
||||
Operand src = op.P ? AttributePerPatch(offset) : Attribute(offset);
|
||||
|
||||
context.Copy(Register(rd), src);
|
||||
}
|
||||
else
|
||||
{
|
||||
Operand src = Const(op.Imm11 + index * 4);
|
||||
int offset = op.Imm11 + index * 4;
|
||||
|
||||
context.FlagAttributeRead(src.Value);
|
||||
context.FlagAttributeRead(offset);
|
||||
|
||||
if (op.O)
|
||||
{
|
||||
offset |= AttributeConsts.LoadOutputMask;
|
||||
}
|
||||
|
||||
Operand src = Const(offset);
|
||||
|
||||
context.Copy(Register(rd), context.LoadAttribute(src, Const(0), primVertex));
|
||||
}
|
||||
|
@ -83,9 +97,13 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||
}
|
||||
else
|
||||
{
|
||||
Operand dest = Attribute(op.Imm11 + index * 4);
|
||||
// TODO: Support indirect stores using Ra.
|
||||
|
||||
context.FlagAttributeWritten(dest.Value);
|
||||
int offset = op.Imm11 + index * 4;
|
||||
|
||||
context.FlagAttributeWritten(offset);
|
||||
|
||||
Operand dest = op.P ? AttributePerPatch(offset) : Attribute(offset);
|
||||
|
||||
context.Copy(dest, Register(rd));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue