Skip to content

Commit ed77133

Browse files
committed
glState: Also track the scissor test state.
1 parent 50ae457 commit ed77133

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Layers/xrRenderGL/glState.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ void glState::Apply()
6262

6363
CHK_GL(glDepthMask(m_pDepthStencilState.DepthWriteMask ? GL_TRUE : GL_FALSE));
6464

65+
if (m_pRasterizerState.ScissorEnable)
66+
glEnable(GL_SCISSOR_TEST);
67+
else
68+
glDisable(GL_SCISSOR_TEST);
69+
6570
if (m_pBlendState.BlendEnable)
6671
glEnable(GL_BLEND);
6772
else
@@ -99,6 +104,10 @@ void glState::UpdateRenderState(u32 name, u32 value)
99104
m_pRasterizerState.CullMode = (D3DCULL)value;
100105
break;
101106

107+
case D3DRS_SCISSORTESTENABLE:
108+
m_pRasterizerState.ScissorEnable = value;
109+
break;
110+
102111
case D3DRS_ZENABLE:
103112
m_pDepthStencilState.DepthEnable = value ? TRUE : FALSE;
104113
break;

src/Layers/xrRenderGL/glState.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
typedef struct
66
{
77
D3DCULL CullMode;
8+
BOOL ScissorEnable;
89
} D3D_RASTERIZER_STATE;
910

1011
typedef struct

0 commit comments

Comments
 (0)