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

@ -20,6 +20,22 @@ namespace Ryujinx.Graphics.GAL.Blend
ConstantColor = 0xc001,
OneMinusConstantColor,
ConstantAlpha,
OneMinusConstantAlpha
OneMinusConstantAlpha,
ZeroGl = 0x4000,
OneGl = 0x4001,
SrcColorGl = 0x4300,
OneMinusSrcColorGl = 0x4301,
SrcAlphaGl = 0x4302,
OneMinusSrcAlphaGl = 0x4303,
DstAlphaGl = 0x4304,
OneMinusDstAlphaGl = 0x4305,
DstColorGl = 0x4306,
OneMinusDstColorGl = 0x4307,
SrcAlphaSaturateGl = 0x4308,
Src1ColorGl = 0xc900,
OneMinusSrc1ColorGl = 0xc901,
Src1AlphaGl = 0xc902,
OneMinusSrc1AlphaGl = 0xc903
}
}

View file

@ -6,6 +6,12 @@ namespace Ryujinx.Graphics.GAL.Blend
Subtract,
ReverseSubtract,
Minimum,
Maximum
Maximum,
AddGl = 0x8006,
SubtractGl = 0x8007,
ReverseSubtractGl = 0x8008,
MinimumGl = 0x800a,
MaximumGl = 0x800b
}
}

View file

@ -9,6 +9,15 @@ namespace Ryujinx.Graphics.GAL
Greater,
NotEqual,
GreaterOrEqual,
Always
Always,
NeverGl = 0x200,
LessGl = 0x201,
EqualGl = 0x202,
LessOrEqualGl = 0x203,
GreaterGl = 0x204,
NotEqualGl = 0x205,
GreaterOrEqualGl = 0x206,
AlwaysGl = 0x207,
}
}

View file

@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.GAL
int GetStorageDebugId();
byte[] GetData(int face);
byte[] GetData();
void SetData(Span<byte> data);
}

View file

@ -66,6 +66,11 @@ namespace Ryujinx.Graphics.GAL.Texture
return GetMipStride(level) * GetLevelHeight(level) * GetLevelDepth(level);
}
public int GetMipSize2D(int level)
{
return GetMipStride(level) * GetLevelHeight(level);
}
public int GetMipStride(int level)
{
return BitUtils.AlignUp(GetLevelWidth(level) * BytesPerPixel, 4);