GL: Implement more Point parameters (#1399)

* Fix GL_INVALID_VALUE on glPointSize calls

* Implement more of Point primitive state

* Use existing Origin enum
This commit is contained in:
mageven 2020-07-21 06:29:13 +05:30 committed by GitHub
parent 1c84b683c2
commit 723ae240dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 7 deletions

View file

@ -224,9 +224,12 @@ namespace Ryujinx.Graphics.Gpu.Engine
UpdateVertexAttribState(state);
}
if (state.QueryModified(MethodOffset.PointSize))
if (state.QueryModified(MethodOffset.PointSize,
MethodOffset.VertexProgramPointSize,
MethodOffset.PointSpriteEnable,
MethodOffset.PointCoordReplace))
{
UpdatePointSizeState(state);
UpdatePointState(state);
}
if (state.QueryModified(MethodOffset.PrimitiveRestartState))
@ -703,11 +706,16 @@ namespace Ryujinx.Graphics.Gpu.Engine
/// Updates host point size based on guest GPU state.
/// </summary>
/// <param name="state">Current GPU state</param>
private void UpdatePointSizeState(GpuState state)
private void UpdatePointState(GpuState state)
{
float size = state.Get<float>(MethodOffset.PointSize);
bool isProgramPointSize = state.Get<Boolean32>(MethodOffset.VertexProgramPointSize);
bool enablePointSprite = state.Get<Boolean32>(MethodOffset.PointSpriteEnable);
// TODO: Need to figure out a way to map PointCoordReplace enable bit.
Origin origin = (state.Get<int>(MethodOffset.PointCoordReplace) & 4) == 0 ? Origin.LowerLeft : Origin.UpperLeft;
_context.Renderer.Pipeline.SetPointSize(size);
_context.Renderer.Pipeline.SetPointParameters(size, isProgramPointSize, enablePointSprite, origin);
}
/// <summary>