Implement user-defined clipping on GL state pipeline (#1118)
This commit is contained in:
@ -125,6 +125,11 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
||||
UpdateShaderState(state);
|
||||
}
|
||||
|
||||
if (state.QueryModified(MethodOffset.ClipDistanceEnable))
|
||||
{
|
||||
UpdateUserClipState(state);
|
||||
}
|
||||
|
||||
if (state.QueryModified(MethodOffset.RasterizeEnable))
|
||||
{
|
||||
UpdateRasterizerState(state);
|
||||
@ -902,6 +907,20 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
||||
_context.Renderer.Pipeline.SetProgram(gs.HostProgram);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates user-defined clipping based on the guest GPU state.
|
||||
/// </summary>
|
||||
/// <param name="state">Current GPU state</param>
|
||||
private void UpdateUserClipState(GpuState state)
|
||||
{
|
||||
int clipMask = state.Get<int>(MethodOffset.ClipDistanceEnable);
|
||||
|
||||
for (int i = 0; i < Constants.TotalClipDistances; ++i)
|
||||
{
|
||||
_context.Renderer.Pipeline.SetUserClipDistance(i, (clipMask & (1 << i)) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets texture target from a sampler type.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user