Support configurable point size (#916)
This commit is contained in:
parent
a1a5341baf
commit
f373f870f7
@ -42,6 +42,8 @@ namespace Ryujinx.Graphics.GAL
|
|||||||
|
|
||||||
void SetImage(int index, ShaderStage stage, ITexture texture);
|
void SetImage(int index, ShaderStage stage, ITexture texture);
|
||||||
|
|
||||||
|
void SetPointSize(float size);
|
||||||
|
|
||||||
void SetPrimitiveRestart(bool enable, int index);
|
void SetPrimitiveRestart(bool enable, int index);
|
||||||
|
|
||||||
void SetPrimitiveTopology(PrimitiveTopology topology);
|
void SetPrimitiveTopology(PrimitiveTopology topology);
|
||||||
|
@ -161,6 +161,11 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
|||||||
UpdateVertexAttribState(state);
|
UpdateVertexAttribState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state.QueryModified(MethodOffset.PointSize))
|
||||||
|
{
|
||||||
|
UpdatePointSizeState(state);
|
||||||
|
}
|
||||||
|
|
||||||
if (state.QueryModified(MethodOffset.PrimitiveRestartState))
|
if (state.QueryModified(MethodOffset.PrimitiveRestartState))
|
||||||
{
|
{
|
||||||
UpdatePrimitiveRestartState(state);
|
UpdatePrimitiveRestartState(state);
|
||||||
@ -507,6 +512,17 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
|||||||
_context.Renderer.Pipeline.SetVertexAttribs(vertexAttribs);
|
_context.Renderer.Pipeline.SetVertexAttribs(vertexAttribs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates host point size based on guest GPU state.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="state">Current GPU state</param>
|
||||||
|
private void UpdatePointSizeState(GpuState state)
|
||||||
|
{
|
||||||
|
float size = state.Get<float>(MethodOffset.PointSize);
|
||||||
|
|
||||||
|
_context.Renderer.Pipeline.SetPointSize(size);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates host primitive restart based on guest GPU state.
|
/// Updates host primitive restart based on guest GPU state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -53,6 +53,7 @@ namespace Ryujinx.Graphics.Gpu.State
|
|||||||
YControl = 0x4eb,
|
YControl = 0x4eb,
|
||||||
FirstVertex = 0x50d,
|
FirstVertex = 0x50d,
|
||||||
FirstInstance = 0x50e,
|
FirstInstance = 0x50e,
|
||||||
|
PointSize = 0x546,
|
||||||
ResetCounter = 0x54c,
|
ResetCounter = 0x54c,
|
||||||
RtDepthStencilEnable = 0x54e,
|
RtDepthStencilEnable = 0x54e,
|
||||||
ConditionState = 0x554,
|
ConditionState = 0x554,
|
||||||
|
@ -601,6 +601,11 @@ namespace Ryujinx.Graphics.OpenGL
|
|||||||
_vertexArray.SetIndexBuffer((Buffer)buffer.Buffer);
|
_vertexArray.SetIndexBuffer((Buffer)buffer.Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetPointSize(float size)
|
||||||
|
{
|
||||||
|
GL.PointSize(size);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetPrimitiveRestart(bool enable, int index)
|
public void SetPrimitiveRestart(bool enable, int index)
|
||||||
{
|
{
|
||||||
if (!enable)
|
if (!enable)
|
||||||
|
Loading…
Reference in New Issue
Block a user