mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 23:50:46 -07:00
Add support for custom line widths (#2406)
This commit is contained in:
@ -223,12 +223,17 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
||||
UpdateTexturePoolState(state);
|
||||
}
|
||||
|
||||
// Input assembler state.
|
||||
// Rasterizer state.
|
||||
if (state.QueryModified(MethodOffset.VertexAttribState))
|
||||
{
|
||||
UpdateVertexAttribState(state);
|
||||
}
|
||||
|
||||
if (state.QueryModified(MethodOffset.LineWidthSmooth, MethodOffset.LineSmoothEnable))
|
||||
{
|
||||
UpdateLineState(state);
|
||||
}
|
||||
|
||||
if (state.QueryModified(MethodOffset.PointSize,
|
||||
MethodOffset.VertexProgramPointSize,
|
||||
MethodOffset.PointSpriteEnable,
|
||||
@ -716,6 +721,18 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
||||
_context.Renderer.Pipeline.SetVertexAttribs(vertexAttribs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates host line width based on guest GPU state.
|
||||
/// </summary>
|
||||
/// <param name="state">Current GPU state</param>
|
||||
private void UpdateLineState(GpuState state)
|
||||
{
|
||||
float width = state.Get<float>(MethodOffset.LineWidthSmooth);
|
||||
bool smooth = state.Get<Boolean32>(MethodOffset.LineSmoothEnable);
|
||||
|
||||
_context.Renderer.Pipeline.SetLineParameters(width, smooth);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates host point size based on guest GPU state.
|
||||
/// </summary>
|
||||
|
@ -67,6 +67,8 @@ namespace Ryujinx.Graphics.Gpu.State
|
||||
BlendEnable = 0x4d8,
|
||||
StencilTestState = 0x4e0,
|
||||
YControl = 0x4eb,
|
||||
LineWidthSmooth = 0x4ec,
|
||||
LineWidthAliased = 0x4ed,
|
||||
FirstVertex = 0x50d,
|
||||
FirstInstance = 0x50e,
|
||||
ClipDistanceEnable = 0x544,
|
||||
@ -77,6 +79,7 @@ namespace Ryujinx.Graphics.Gpu.State
|
||||
ConditionState = 0x554,
|
||||
SamplerPoolState = 0x557,
|
||||
DepthBiasFactor = 0x55b,
|
||||
LineSmoothEnable = 0x55c,
|
||||
TexturePoolState = 0x55d,
|
||||
StencilBackTestState = 0x565,
|
||||
DepthBiasUnits = 0x56f,
|
||||
|
Reference in New Issue
Block a user