Initial support for the guest OpenGL driver (NVIDIA and Nouveau)

This commit is contained in:
gdkchan 2019-12-05 17:34:47 -03:00 committed by Thog
parent 6a98c643ca
commit e25b7c9848
25 changed files with 581 additions and 102 deletions

View file

@ -0,0 +1,16 @@
using Ryujinx.Graphics.GAL.Blend;
namespace Ryujinx.Graphics.Gpu.State
{
struct BlendStateCommon
{
public Boolean32 SeparateAlpha;
public BlendOp ColorOp;
public BlendFactor ColorSrcFactor;
public BlendFactor ColorDstFactor;
public BlendOp AlphaOp;
public BlendFactor AlphaSrcFactor;
public uint Unknown0x1354;
public BlendFactor AlphaDstFactor;
}
}

View file

@ -162,6 +162,28 @@ namespace Ryujinx.Graphics.Gpu.State
return modified;
}
public bool QueryModified(
MethodOffset m1,
MethodOffset m2,
MethodOffset m3,
MethodOffset m4,
MethodOffset m5)
{
bool modified = _registers[(int)m1].Modified ||
_registers[(int)m2].Modified ||
_registers[(int)m3].Modified ||
_registers[(int)m4].Modified ||
_registers[(int)m5].Modified;
_registers[(int)m1].Modified = false;
_registers[(int)m2].Modified = false;
_registers[(int)m3].Modified = false;
_registers[(int)m4].Modified = false;
_registers[(int)m5].Modified = false;
return modified;
}
public T Get<T>(MethodOffset offset, int index) where T : struct
{
Register register = _registers[(int)offset];

View file

@ -32,11 +32,16 @@ namespace Ryujinx.Graphics.Gpu.State
RtDepthStencilState = 0x3f8,
VertexAttribState = 0x458,
RtDepthStencilSize = 0x48a,
SamplerIndex = 0x48d,
DepthTestEnable = 0x4b3,
BlendIndependent = 0x4b9,
DepthWriteEnable = 0x4ba,
DepthTestFunc = 0x4c3,
BlendStateCommon = 0x4cf,
BlendEnableCommon = 0x4d7,
BlendEnable = 0x4d8,
StencilTestState = 0x4e0,
YControl = 0x4eb,
FirstVertex = 0x50d,
FirstInstance = 0x50e,
ResetCounter = 0x54c,

View file

@ -0,0 +1,8 @@
namespace Ryujinx.Graphics.Gpu.State
{
enum SamplerIndex
{
Independently = 0,
ViaHeaderIndex = 1
}
}