Fix vertex buffer size on the gpu when the draw vertex count is less than the buffer size, added a few more registers (currently not implemented)
This commit is contained in:
14
Ryujinx.Graphics/Gal/GalComparisonOp.cs
Normal file
14
Ryujinx.Graphics/Gal/GalComparisonOp.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Ryujinx.Graphics.Gal
|
||||
{
|
||||
public enum GalComparisonOp
|
||||
{
|
||||
Never = 0x200,
|
||||
Less = 0x201,
|
||||
Equal = 0x202,
|
||||
Lequal = 0x203,
|
||||
Greater = 0x204,
|
||||
NotEqual = 0x205,
|
||||
Gequal = 0x206,
|
||||
Always = 0x207
|
||||
}
|
||||
}
|
@@ -8,6 +8,16 @@ namespace Ryujinx.Graphics.Gal
|
||||
|
||||
bool IsIboCached(long Key, long DataSize);
|
||||
|
||||
void EnableCullFace();
|
||||
|
||||
void DisableCullFace();
|
||||
|
||||
void EnableDepthTest();
|
||||
|
||||
void DisableDepthTest();
|
||||
|
||||
void SetDepthFunction(GalComparisonOp Func);
|
||||
|
||||
void CreateVbo(long Key, byte[] Buffer);
|
||||
|
||||
void CreateIbo(long Key, byte[] Buffer);
|
||||
|
@@ -5,6 +5,17 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||
{
|
||||
static class OGLEnumConverter
|
||||
{
|
||||
public static DepthFunction GetDepthFunc(GalComparisonOp Func)
|
||||
{
|
||||
if ((int)Func >= (int)DepthFunction.Never &&
|
||||
(int)Func <= (int)DepthFunction.Always)
|
||||
{
|
||||
return (DepthFunction)Func;
|
||||
}
|
||||
|
||||
throw new ArgumentException(nameof(Func));
|
||||
}
|
||||
|
||||
public static DrawElementsType GetDrawElementsType(GalIndexFormat Format)
|
||||
{
|
||||
switch (Format)
|
||||
|
@@ -106,6 +106,31 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||
return IboCache.TryGetSize(Key, out long Size) && Size == DataSize;
|
||||
}
|
||||
|
||||
public void EnableCullFace()
|
||||
{
|
||||
GL.Enable(EnableCap.CullFace);
|
||||
}
|
||||
|
||||
public void DisableCullFace()
|
||||
{
|
||||
GL.Disable(EnableCap.CullFace);
|
||||
}
|
||||
|
||||
public void EnableDepthTest()
|
||||
{
|
||||
GL.Enable(EnableCap.DepthTest);
|
||||
}
|
||||
|
||||
public void DisableDepthTest()
|
||||
{
|
||||
GL.Disable(EnableCap.DepthTest);
|
||||
}
|
||||
|
||||
public void SetDepthFunction(GalComparisonOp Func)
|
||||
{
|
||||
GL.DepthFunc(OGLEnumConverter.GetDepthFunc(Func));
|
||||
}
|
||||
|
||||
public void CreateVbo(long Key, byte[] Buffer)
|
||||
{
|
||||
int Handle = GL.GenBuffer();
|
||||
|
@@ -283,7 +283,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||
|
||||
return FreeBinding;
|
||||
}
|
||||
|
||||
|
||||
BindUniformBuffersIfNotNull(Current.Vertex);
|
||||
BindUniformBuffersIfNotNull(Current.TessControl);
|
||||
BindUniformBuffersIfNotNull(Current.TessEvaluation);
|
||||
|
Reference in New Issue
Block a user