diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs index f9d16803..4a5633c9 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs @@ -72,6 +72,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed nameof(ThreedClassState.VertexBufferState), nameof(ThreedClassState.VertexBufferEndAddress)), + new StateUpdateCallbackEntry(UpdateTessellationState, + nameof(ThreedClassState.TessOuterLevel), + nameof(ThreedClassState.TessInnerLevel), + nameof(ThreedClassState.PatchVertices)), + new StateUpdateCallbackEntry(UpdateTfBufferState, nameof(ThreedClassState.TfBufferState)), new StateUpdateCallbackEntry(UpdateUserClipState, nameof(ThreedClassState.ClipDistanceEnable)), @@ -100,6 +105,10 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed nameof(ThreedClassState.ViewportExtents), nameof(ThreedClassState.YControl)), + new StateUpdateCallbackEntry(UpdatePolygonMode, + nameof(ThreedClassState.PolygonModeFront), + nameof(ThreedClassState.PolygonModeBack)), + new StateUpdateCallbackEntry(UpdateDepthBiasState, nameof(ThreedClassState.DepthBiasState), nameof(ThreedClassState.DepthBiasFactor), @@ -260,6 +269,17 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed } /// <summary> + /// Updates tessellation state based on the guest GPU state. + /// </summary> + private void UpdateTessellationState() + { + _context.Renderer.Pipeline.SetPatchParameters( + _state.State.PatchVertices, + _state.State.TessOuterLevel.ToSpan(), + _state.State.TessInnerLevel.ToSpan()); + } + + /// <summary> /// Updates transform feedback buffer state based on the guest GPU state. /// </summary> private void UpdateTfBufferState() @@ -545,6 +565,14 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed } /// <summary> + /// Updates polygon mode state based on current GPU state. + /// </summary> + private void UpdatePolygonMode() + { + _context.Renderer.Pipeline.SetPolygonMode(_state.State.PolygonModeFront, _state.State.PolygonModeBack); + } + + /// <summary> /// Updates host depth bias (also called polygon offset) state based on current GPU state. /// </summary> private void UpdateDepthBiasState() @@ -949,7 +977,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed _state.State.TexturePoolState.MaximumId, (int)_state.State.TextureBufferIndex, _state.State.EarlyZForce, - _drawState.Topology); + _drawState.Topology, + _state.State.TessMode); ShaderBundle gs = _channel.MemoryManager.Physical.ShaderCache.GetGraphicsShader(ref _state.State, _channel, gas, addresses); |