wined3d: Move the scissor test state to wined3d_rasterizer_state.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
327d1792dc
commit
a6009fa21f
|
@ -936,7 +936,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
|
||||||
if (!(rasterizer_state_impl = unsafe_impl_from_ID3D11RasterizerState(rasterizer_state)))
|
if (!(rasterizer_state_impl = unsafe_impl_from_ID3D11RasterizerState(rasterizer_state)))
|
||||||
{
|
{
|
||||||
wined3d_device_set_rasterizer_state(device->wined3d_device, NULL);
|
wined3d_device_set_rasterizer_state(device->wined3d_device, NULL);
|
||||||
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, FALSE);
|
|
||||||
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, FALSE);
|
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, FALSE);
|
||||||
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ANTIALIASEDLINEENABLE, FALSE);
|
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ANTIALIASEDLINEENABLE, FALSE);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
@ -946,7 +945,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
|
||||||
wined3d_device_set_rasterizer_state(device->wined3d_device, rasterizer_state_impl->wined3d_state);
|
wined3d_device_set_rasterizer_state(device->wined3d_device, rasterizer_state_impl->wined3d_state);
|
||||||
|
|
||||||
desc = &rasterizer_state_impl->desc;
|
desc = &rasterizer_state_impl->desc;
|
||||||
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SCISSORTESTENABLE, desc->ScissorEnable);
|
|
||||||
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, desc->MultisampleEnable);
|
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, desc->MultisampleEnable);
|
||||||
wined3d_device_set_render_state(device->wined3d_device,
|
wined3d_device_set_render_state(device->wined3d_device,
|
||||||
WINED3D_RS_ANTIALIASEDLINEENABLE, desc->AntialiasedLineEnable);
|
WINED3D_RS_ANTIALIASEDLINEENABLE, desc->AntialiasedLineEnable);
|
||||||
|
|
|
@ -1083,6 +1083,7 @@ static HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, str
|
||||||
wined3d_desc.depth_bias_clamp = desc->DepthBiasClamp;
|
wined3d_desc.depth_bias_clamp = desc->DepthBiasClamp;
|
||||||
wined3d_desc.scale_bias = desc->SlopeScaledDepthBias;
|
wined3d_desc.scale_bias = desc->SlopeScaledDepthBias;
|
||||||
wined3d_desc.depth_clip = desc->DepthClipEnable;
|
wined3d_desc.depth_clip = desc->DepthClipEnable;
|
||||||
|
wined3d_desc.scissor = desc->ScissorEnable;
|
||||||
|
|
||||||
/* We cannot fail after creating a wined3d_rasterizer_state object. It
|
/* We cannot fail after creating a wined3d_rasterizer_state object. It
|
||||||
* would lead to double free. */
|
* would lead to double free. */
|
||||||
|
|
|
@ -3150,11 +3150,10 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
|
||||||
gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
|
gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
|
||||||
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE));
|
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE));
|
||||||
gl_info->gl_ops.gl.p_glDisable(GL_CULL_FACE);
|
gl_info->gl_ops.gl.p_glDisable(GL_CULL_FACE);
|
||||||
|
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
|
||||||
context_invalidate_state(context, STATE_RASTERIZER);
|
context_invalidate_state(context, STATE_RASTERIZER);
|
||||||
gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST);
|
gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST);
|
||||||
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_STENCILENABLE));
|
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_STENCILENABLE));
|
||||||
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
|
|
||||||
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
|
|
||||||
if (gl_info->supported[ARB_POINT_SPRITE])
|
if (gl_info->supported[ARB_POINT_SPRITE])
|
||||||
{
|
{
|
||||||
gl_info->gl_ops.gl.p_glDisable(GL_POINT_SPRITE_ARB);
|
gl_info->gl_ops.gl.p_glDisable(GL_POINT_SPRITE_ARB);
|
||||||
|
@ -3428,7 +3427,7 @@ BOOL wined3d_context_gl_apply_clear_state(struct wined3d_context_gl *context_gl,
|
||||||
checkGLcall("setting up state for clear");
|
checkGLcall("setting up state for clear");
|
||||||
|
|
||||||
context_invalidate_state(&context_gl->c, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE));
|
context_invalidate_state(&context_gl->c, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE));
|
||||||
context_invalidate_state(&context_gl->c, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
|
context_invalidate_state(&context_gl->c, STATE_RASTERIZER);
|
||||||
context_invalidate_state(&context_gl->c, STATE_SCISSORRECT);
|
context_invalidate_state(&context_gl->c, STATE_SCISSORRECT);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -614,7 +614,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
|
||||||
op->rt_count = rt_count;
|
op->rt_count = rt_count;
|
||||||
op->fb = &cs->fb;
|
op->fb = &cs->fb;
|
||||||
SetRect(&op->draw_rect, vp->x, vp->y, vp->x + vp->width, vp->y + vp->height);
|
SetRect(&op->draw_rect, vp->x, vp->y, vp->x + vp->width, vp->y + vp->height);
|
||||||
if (state->render_states[WINED3D_RS_SCISSORTESTENABLE])
|
if (state->rasterizer_state && state->rasterizer_state->desc.scissor)
|
||||||
IntersectRect(&op->draw_rect, &op->draw_rect, &state->scissor_rects[0]);
|
IntersectRect(&op->draw_rect, &op->draw_rect, &state->scissor_rects[0]);
|
||||||
op->color = *color;
|
op->color = *color;
|
||||||
op->depth = depth;
|
op->depth = depth;
|
||||||
|
|
|
@ -3602,6 +3602,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
|
||||||
case WINED3D_RS_CULLMODE:
|
case WINED3D_RS_CULLMODE:
|
||||||
case WINED3D_RS_SLOPESCALEDEPTHBIAS:
|
case WINED3D_RS_SLOPESCALEDEPTHBIAS:
|
||||||
case WINED3D_RS_DEPTHBIAS:
|
case WINED3D_RS_DEPTHBIAS:
|
||||||
|
case WINED3D_RS_SCISSORTESTENABLE:
|
||||||
set_rasterizer_state = TRUE;
|
set_rasterizer_state = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3631,6 +3632,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
|
||||||
bias.d = state->rs[WINED3D_RS_SLOPESCALEDEPTHBIAS];
|
bias.d = state->rs[WINED3D_RS_SLOPESCALEDEPTHBIAS];
|
||||||
desc.scale_bias = bias.f;
|
desc.scale_bias = bias.f;
|
||||||
desc.depth_clip = TRUE;
|
desc.depth_clip = TRUE;
|
||||||
|
desc.scissor = state->rs[WINED3D_RS_SCISSORTESTENABLE];
|
||||||
|
|
||||||
if ((entry = wine_rb_get(&device->rasterizer_states, &desc)))
|
if ((entry = wine_rb_get(&device->rasterizer_states, &desc)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1721,11 +1721,9 @@ static void state_line_antialias(struct wined3d_context *context, const struct w
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_scissor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void scissor(const struct wined3d_rasterizer_state *r, const struct wined3d_gl_info *gl_info)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
if (r && r->desc.scissor)
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_SCISSORTESTENABLE])
|
|
||||||
{
|
{
|
||||||
gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST);
|
gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST);
|
||||||
checkGLcall("glEnable(GL_SCISSOR_TEST)");
|
checkGLcall("glEnable(GL_SCISSOR_TEST)");
|
||||||
|
@ -4335,6 +4333,7 @@ static void rasterizer(struct wined3d_context *context, const struct wined3d_sta
|
||||||
fillmode(r, gl_info);
|
fillmode(r, gl_info);
|
||||||
cullmode(r, gl_info);
|
cullmode(r, gl_info);
|
||||||
depth_clip(r, gl_info);
|
depth_clip(r, gl_info);
|
||||||
|
scissor(r, gl_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rasterizer_cc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void rasterizer_cc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
|
@ -4351,6 +4350,7 @@ static void rasterizer_cc(struct wined3d_context *context, const struct wined3d_
|
||||||
fillmode(r, gl_info);
|
fillmode(r, gl_info);
|
||||||
cullmode(r, gl_info);
|
cullmode(r, gl_info);
|
||||||
depth_clip(r, gl_info);
|
depth_clip(r, gl_info);
|
||||||
|
scissor(r, gl_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void psorigin_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void psorigin_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
|
@ -4660,7 +4660,6 @@ const struct wined3d_state_entry_template misc_state_template[] =
|
||||||
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite }, WINED3D_GL_EXT_NONE },
|
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite }, WINED3D_GL_EXT_NONE },
|
||||||
{ STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop }, WINED3D_GL_BLEND_EQUATION },
|
{ STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop }, WINED3D_GL_BLEND_EQUATION },
|
||||||
{ STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop_w }, WINED3D_GL_EXT_NONE },
|
{ STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop_w }, WINED3D_GL_EXT_NONE },
|
||||||
{ STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE), { STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE), state_scissor }, WINED3D_GL_EXT_NONE },
|
|
||||||
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), state_colorwrite1 }, EXT_DRAW_BUFFERS2 },
|
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), state_colorwrite1 }, EXT_DRAW_BUFFERS2 },
|
||||||
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
|
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
|
||||||
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), state_colorwrite2 }, EXT_DRAW_BUFFERS2 },
|
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), state_colorwrite2 }, EXT_DRAW_BUFFERS2 },
|
||||||
|
@ -5432,7 +5431,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table)
|
||||||
{ 61, 127},
|
{ 61, 127},
|
||||||
{149, 150},
|
{149, 150},
|
||||||
{169, 169},
|
{169, 169},
|
||||||
{175, 175},
|
{174, 175},
|
||||||
{177, 177},
|
{177, 177},
|
||||||
{193, 193},
|
{193, 193},
|
||||||
{195, 197},
|
{195, 197},
|
||||||
|
|
|
@ -131,7 +131,7 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
|
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
|
||||||
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
|
context_invalidate_state(context, STATE_RASTERIZER);
|
||||||
|
|
||||||
gl_info->fbo_ops.glBlitFramebuffer(src_rect->left, src_rect->top, src_rect->right, src_rect->bottom,
|
gl_info->fbo_ops.glBlitFramebuffer(src_rect->left, src_rect->top, src_rect->right, src_rect->bottom,
|
||||||
dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST);
|
dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST);
|
||||||
|
@ -267,7 +267,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co
|
||||||
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
|
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
|
||||||
|
|
||||||
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
|
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
|
||||||
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
|
context_invalidate_state(context, STATE_RASTERIZER);
|
||||||
|
|
||||||
gl_info->fbo_ops.glBlitFramebuffer(src_rect->left, src_rect->top, src_rect->right, src_rect->bottom,
|
gl_info->fbo_ops.glBlitFramebuffer(src_rect->left, src_rect->top, src_rect->right, src_rect->bottom,
|
||||||
dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, GL_COLOR_BUFFER_BIT, gl_filter);
|
dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, GL_COLOR_BUFFER_BIT, gl_filter);
|
||||||
|
|
|
@ -2040,6 +2040,7 @@ struct wined3d_rasterizer_state_desc
|
||||||
float depth_bias_clamp;
|
float depth_bias_clamp;
|
||||||
float scale_bias;
|
float scale_bias;
|
||||||
BOOL depth_clip;
|
BOOL depth_clip;
|
||||||
|
BOOL scissor;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wined3d_sampler_desc
|
struct wined3d_sampler_desc
|
||||||
|
|
Loading…
Reference in New Issue