Low level graphics API prerequisites (#319)
* Add GalPipelineState and IGalPipeline * Separate UploadVertex call * Add ConstBuffer cache * Move Vertex Assembly into GalPipelineState * Move Uniform binds to GalPipelineState * Move framebuffer flip into a buffer * Rebase * Fix regression * Move clear values from VertexEndGl to ClearBuffers * Rename obscure names O->Old S->New
This commit is contained in:
parent
652238f526
commit
25dd5f4238
20 changed files with 854 additions and 702 deletions
73
Ryujinx.Graphics/Gal/GalPipelineState.cs
Normal file
73
Ryujinx.Graphics/Gal/GalPipelineState.cs
Normal file
|
@ -0,0 +1,73 @@
|
|||
namespace Ryujinx.Graphics.Gal
|
||||
{
|
||||
public struct GalVertexBinding
|
||||
{
|
||||
//VboKey shouldn't be here, but ARB_vertex_attrib_binding is core since 4.3
|
||||
|
||||
public bool Enabled;
|
||||
public int Stride;
|
||||
public long VboKey;
|
||||
public GalVertexAttrib[] Attribs;
|
||||
}
|
||||
|
||||
public class GalPipelineState
|
||||
{
|
||||
public const int Stages = 5;
|
||||
public const int ConstBuffersPerStage = 18;
|
||||
|
||||
public long[][] ConstBufferKeys;
|
||||
|
||||
public GalVertexBinding[] VertexBindings;
|
||||
|
||||
public float FlipX;
|
||||
public float FlipY;
|
||||
|
||||
public GalFrontFace FrontFace;
|
||||
|
||||
public bool CullFaceEnabled;
|
||||
public GalCullFace CullFace;
|
||||
|
||||
public bool DepthTestEnabled;
|
||||
public GalComparisonOp DepthFunc;
|
||||
|
||||
public bool StencilTestEnabled;
|
||||
|
||||
public GalComparisonOp StencilBackFuncFunc;
|
||||
public int StencilBackFuncRef;
|
||||
public uint StencilBackFuncMask;
|
||||
public GalStencilOp StencilBackOpFail;
|
||||
public GalStencilOp StencilBackOpZFail;
|
||||
public GalStencilOp StencilBackOpZPass;
|
||||
public uint StencilBackMask;
|
||||
|
||||
public GalComparisonOp StencilFrontFuncFunc;
|
||||
public int StencilFrontFuncRef;
|
||||
public uint StencilFrontFuncMask;
|
||||
public GalStencilOp StencilFrontOpFail;
|
||||
public GalStencilOp StencilFrontOpZFail;
|
||||
public GalStencilOp StencilFrontOpZPass;
|
||||
public uint StencilFrontMask;
|
||||
|
||||
public bool BlendEnabled;
|
||||
public bool BlendSeparateAlpha;
|
||||
public GalBlendEquation BlendEquationRgb;
|
||||
public GalBlendFactor BlendFuncSrcRgb;
|
||||
public GalBlendFactor BlendFuncDstRgb;
|
||||
public GalBlendEquation BlendEquationAlpha;
|
||||
public GalBlendFactor BlendFuncSrcAlpha;
|
||||
public GalBlendFactor BlendFuncDstAlpha;
|
||||
|
||||
public bool PrimitiveRestartEnabled;
|
||||
public uint PrimitiveRestartIndex;
|
||||
|
||||
public GalPipelineState()
|
||||
{
|
||||
ConstBufferKeys = new long[Stages][];
|
||||
|
||||
for (int Stage = 0; Stage < Stages; Stage++)
|
||||
{
|
||||
ConstBufferKeys[Stage] = new long[ConstBuffersPerStage];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue