Implement Geometry shaders (#280)

* Implement Geometry shaders

* Add EmitVertex() and EndPrimitive()

* Read output geometry data from header

* Stub Vmad

* Add Iadd_I32

* Stub Mov_S (S2R)

* Stub Isberd

* Change vertex index to gpr39 in Abuf

* Add stub messages for consistency

* Do not print input block when there is no attributes

* Use GL_ARB_enhanced_layouts

* Skip geometry shaders when there's no GL_ARB_enhanced_layouts

* Address feedback

* Address feedback
This commit is contained in:
ReinUsesLisp 2018-07-19 02:33:27 -03:00 committed by gdkchan
parent bdb6cbb435
commit cd203e98f2
15 changed files with 426 additions and 48 deletions

View file

@ -85,6 +85,16 @@ namespace Ryujinx.Graphics.Gal.Shader
EmitI2i(Block, OpCode, ShaderOper.RR);
}
public static void Isberd(ShaderIrBlock Block, long OpCode)
{
//This instruction seems to be used to translate from an address to a vertex index in a GS
//Stub it as such
Block.AddNode(new ShaderIrCmnt("Stubbed."));
Block.AddNode(GetPredNode(new ShaderIrAsg(GetOperGpr0(OpCode), GetOperGpr8(OpCode)), OpCode));
}
public static void Mov_C(ShaderIrBlock Block, long OpCode)
{
ShaderIrOperCbuf Cbuf = GetOperCbuf34(OpCode);
@ -128,6 +138,16 @@ namespace Ryujinx.Graphics.Gal.Shader
EmitSel(Block, OpCode, ShaderOper.RR);
}
public static void Mov_S(ShaderIrBlock Block, long OpCode)
{
Block.AddNode(new ShaderIrCmnt("Stubbed."));
//Zero is used as a special number to get a valid "0 * 0 + VertexIndex" in a GS
ShaderIrNode Source = new ShaderIrOperImm(0);
Block.AddNode(GetPredNode(new ShaderIrAsg(GetOperGpr0(OpCode), Source), OpCode));
}
private static void EmitF2f(ShaderIrBlock Block, long OpCode, ShaderOper Oper)
{
bool NegA = ((OpCode >> 45) & 1) != 0;