Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 20 ---------- dlls/d3d11/state.c | 8 +++- dlls/wined3d/context.c | 7 ++-- dlls/wined3d/cs.c | 6 +-- dlls/wined3d/device.c | 62 +++++++++++++++++++++++++----- dlls/wined3d/state.c | 85 +++++++++++++++++++++--------------------- dlls/wined3d/surface.c | 4 +- include/wine/wined3d.h | 6 +++ 8 files changed, 115 insertions(+), 83 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 212881a9b7..555d998da2 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -929,11 +929,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); struct d3d_rasterizer_state *rasterizer_state_impl; const D3D11_RASTERIZER_DESC *desc; - union - { - DWORD d; - float f; - } scale_bias, const_bias;
TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state);
@@ -941,13 +936,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon if (!(rasterizer_state_impl = unsafe_impl_from_ID3D11RasterizerState(rasterizer_state))) { wined3d_device_set_rasterizer_state(device->wined3d_device, NULL); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_FILLMODE, WINED3D_FILL_SOLID); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_CULLMODE, WINED3D_CULL_BACK); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, 0); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, 0); - 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_ANTIALIASEDLINEENABLE, FALSE); wined3d_mutex_unlock(); return; } @@ -955,16 +944,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon wined3d_device_set_rasterizer_state(device->wined3d_device, rasterizer_state_impl->wined3d_state);
desc = &rasterizer_state_impl->desc; - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_FILLMODE, desc->FillMode); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_CULLMODE, desc->CullMode); - scale_bias.f = desc->SlopeScaledDepthBias; - const_bias.f = desc->DepthBias; - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SLOPESCALEDEPTHBIAS, scale_bias.d); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, const_bias.d); - 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_ANTIALIASEDLINEENABLE, desc->AntialiasedLineEnable); wined3d_mutex_unlock(); }
diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index 92b75f8e1f..dd2eb6306e 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -1076,9 +1076,15 @@ static HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, str return E_FAIL; }
+ wined3d_desc.fill_mode = desc->FillMode; + wined3d_desc.cull_mode = desc->CullMode; wined3d_desc.front_ccw = desc->FrontCounterClockwise; - wined3d_desc.depth_clip = desc->DepthClipEnable; + wined3d_desc.depth_bias = desc->DepthBias; wined3d_desc.depth_bias_clamp = desc->DepthBiasClamp; + wined3d_desc.scale_bias = desc->SlopeScaledDepthBias; + wined3d_desc.depth_clip = desc->DepthClipEnable; + wined3d_desc.scissor = desc->ScissorEnable; + wined3d_desc.line_antialias = desc->AntialiasedLineEnable;
/* We cannot fail after creating a wined3d_rasterizer_state object. It * would lead to double free. */ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index af2b00f88e..f4a5189ba1 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -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); context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE)); gl_info->gl_ops.gl.p_glDisable(GL_CULL_FACE); - context_invalidate_state(context, STATE_RENDER(WINED3D_RS_CULLMODE)); + gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST); + context_invalidate_state(context, STATE_RASTERIZER); gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST); 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]) { 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");
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);
return TRUE; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index ec17b59d71..dbdf5f2ec2 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -614,7 +614,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * op->rt_count = rt_count; op->fb = &cs->fb; 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]); op->color = *color; op->depth = depth; @@ -1150,12 +1150,12 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const device_invalidate_state(device, STATE_RENDER(WINED3D_RS_ZENABLE)); device_invalidate_state(device, STATE_RENDER(WINED3D_RS_STENCILENABLE)); device_invalidate_state(device, STATE_RENDER(WINED3D_RS_STENCILWRITEMASK)); - device_invalidate_state(device, STATE_RENDER(WINED3D_RS_DEPTHBIAS)); + device_invalidate_state(device, STATE_RASTERIZER); } else if (prev) { if (prev->format->depth_bias_scale != op->view->format->depth_bias_scale) - device_invalidate_state(device, STATE_RENDER(WINED3D_RS_DEPTHBIAS)); + device_invalidate_state(device, STATE_RASTERIZER); if (prev->format->stencil_size != op->view->format->stencil_size) device_invalidate_state(device, STATE_RENDER(WINED3D_RS_STENCILREF)); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 118c99e7f5..5fb05b67ce 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3475,11 +3475,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, const struct wined3d_stateblock_state *state = &stateblock->stateblock_state; const struct wined3d_saved_states *changed = &stateblock->changed; const unsigned int word_bit_count = sizeof(DWORD) * CHAR_BIT; + BOOL set_rasterizer_state = FALSE, set_blend_state; struct wined3d_blend_state *blend_state; unsigned int i, j, start, idx; struct wined3d_color colour; struct wined3d_range range; - BOOL set_blend_state; DWORD map, stage;
TRACE("device %p, stateblock %p.\n", device, stateblock); @@ -3576,21 +3576,63 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, { j = wined3d_bit_scan(&map); idx = i * word_bit_count + j; - if (idx != WINED3D_RS_BLENDFACTOR) - { - wined3d_device_set_render_state(device, idx, state->rs[idx]); - continue; - }
- if (!set_blend_state) + switch (idx) { - blend_state = wined3d_device_get_blend_state(device, &colour); - wined3d_color_from_d3dcolor(&colour, state->rs[idx]); - wined3d_device_set_blend_state(device, blend_state, &colour); + case WINED3D_RS_BLENDFACTOR: + if (!set_blend_state) + { + blend_state = wined3d_device_get_blend_state(device, &colour); + wined3d_color_from_d3dcolor(&colour, state->rs[idx]); + wined3d_device_set_blend_state(device, blend_state, &colour); + } + break; + + case WINED3D_RS_FILLMODE: + case WINED3D_RS_CULLMODE: + case WINED3D_RS_SLOPESCALEDEPTHBIAS: + case WINED3D_RS_DEPTHBIAS: + case WINED3D_RS_SCISSORTESTENABLE: + case WINED3D_RS_ANTIALIASEDLINEENABLE: + set_rasterizer_state = TRUE; + break; + + default: + wined3d_device_set_render_state(device, idx, state->rs[idx]); } } }
+ if (set_rasterizer_state) + { + struct wined3d_rasterizer_state *rasterizer_state; + struct wined3d_rasterizer_state_desc desc; + union + { + DWORD d; + float f; + } bias; + + desc.fill_mode = state->rs[WINED3D_RS_FILLMODE]; + desc.cull_mode = state->rs[WINED3D_RS_CULLMODE]; + desc.front_ccw = FALSE; + bias.d = state->rs[WINED3D_RS_DEPTHBIAS]; + desc.depth_bias = bias.f; + desc.depth_bias_clamp = 0.0f; + bias.d = state->rs[WINED3D_RS_SLOPESCALEDEPTHBIAS]; + desc.scale_bias = bias.f; + desc.depth_clip = TRUE; + desc.scissor = state->rs[WINED3D_RS_SCISSORTESTENABLE]; + desc.line_antialias = state->rs[WINED3D_RS_ANTIALIASEDLINEENABLE]; + + if (SUCCEEDED(wined3d_rasterizer_state_create(device, &desc, + NULL, &wined3d_null_parent_ops, &rasterizer_state))) + { + wined3d_device_set_rasterizer_state(device, rasterizer_state); + wined3d_rasterizer_state_decref(rasterizer_state); + } + } + for (i = 0; i < ARRAY_SIZE(changed->textureState); ++i) { map = changed->textureState[i]; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index a4d88e1bfc..0c8a7a59ce 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -171,10 +171,9 @@ void state_nop(struct wined3d_context *context, const struct wined3d_state *stat TRACE("%s: nop in current pipe config.\n", debug_d3dstate(state_id)); }
-static void state_fillmode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +static void fillmode(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; - enum wined3d_fill_mode mode = state->render_states[WINED3D_RS_FILLMODE]; + enum wined3d_fill_mode mode = r ? r->desc.fill_mode : WINED3D_FILL_SOLID;
switch (mode) { @@ -256,13 +255,13 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ context_apply_state(context, state, STATE_TRANSFORM(WINED3D_TS_PROJECTION)); }
-static void state_cullmode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +static void cullmode(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; + enum wined3d_cull mode = r ? r->desc.cull_mode : WINED3D_CULL_BACK;
/* glFrontFace() is set in context.c at context init and on an * offscreen / onscreen rendering switch. */ - switch (state->render_states[WINED3D_RS_CULLMODE]) + switch (mode) { case WINED3D_CULL_NONE: gl_info->gl_ops.gl.p_glDisable(GL_CULL_FACE); @@ -281,8 +280,7 @@ static void state_cullmode(struct wined3d_context *context, const struct wined3d checkGLcall("glCullFace(GL_BACK)"); break; default: - FIXME("Unrecognized cull mode %#x.\n", - state->render_states[WINED3D_RS_CULLMODE]); + FIXME("Unrecognized cull mode %#x.\n", mode); } }
@@ -1709,9 +1707,9 @@ static void state_msaa(struct wined3d_context *context, const struct wined3d_sta static void state_line_antialias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; + const struct wined3d_rasterizer_state *r = state->rasterizer_state;
- if (state->render_states[WINED3D_RS_EDGEANTIALIAS] - || state->render_states[WINED3D_RS_ANTIALIASEDLINEENABLE]) + if (state->render_states[WINED3D_RS_EDGEANTIALIAS] || (r && r->desc.line_antialias)) { gl_info->gl_ops.gl.p_glEnable(GL_LINE_SMOOTH); checkGLcall("glEnable(GL_LINE_SMOOTH)"); @@ -1723,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 (state->render_states[WINED3D_RS_SCISSORTESTENABLE]) + if (r && r->desc.scissor) { gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST); checkGLcall("glEnable(GL_SCISSOR_TEST)"); @@ -1754,25 +1750,25 @@ static void state_scissor(struct wined3d_context *context, const struct wined3d_ * * Note that SLOPESCALEDEPTHBIAS is a scaling factor for the depth slope, and * doesn't need to be scaled to account for GL vs D3D differences. */ -static void state_depthbias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +static void depthbias(struct wined3d_context *context, const struct wined3d_state *state) { const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; + const struct wined3d_rasterizer_state *r = state->rasterizer_state; + float scale_bias = r ? r->desc.scale_bias : 0.0f; + union + { + DWORD d; + float f; + } const_bias;
- if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS] - || state->render_states[WINED3D_RS_DEPTHBIAS]) + const_bias.f = r ? r->desc.depth_bias : 0.0f; + + if (scale_bias || const_bias.f) { const struct wined3d_rendertarget_view *depth = state->fb->depth_stencil; float factor, units, scale, clamp;
- union - { - DWORD d; - float f; - } scale_bias, const_bias; - clamp = state->rasterizer_state ? state->rasterizer_state->desc.depth_bias_clamp : 0.0f; - scale_bias.d = state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS]; - const_bias.d = state->render_states[WINED3D_RS_DEPTHBIAS];
if (context->d3d_info->wined3d_creation_flags & WINED3D_LEGACY_DEPTH_BIAS) { @@ -1794,7 +1790,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 scale = 0.0f; }
- factor = scale_bias.f; + factor = scale_bias; units = const_bias.f * scale; }
@@ -4324,31 +4320,39 @@ static void depth_clip(const struct wined3d_rasterizer_state *r, const struct wi static void rasterizer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; + const struct wined3d_rasterizer_state *r = state->rasterizer_state; GLenum mode;
- mode = state->rasterizer_state && state->rasterizer_state->desc.front_ccw ? GL_CCW : GL_CW; + mode = r && r->desc.front_ccw ? GL_CCW : GL_CW; if (context->render_offscreen) mode = (mode == GL_CW) ? GL_CCW : GL_CW;
gl_info->gl_ops.gl.p_glFrontFace(mode); checkGLcall("glFrontFace"); - if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_DEPTHBIAS))) - state_depthbias(context, state, STATE_RENDER(WINED3D_RS_DEPTHBIAS)); - depth_clip(state->rasterizer_state, gl_info); + fillmode(r, gl_info); + cullmode(r, gl_info); + depthbias(context, state); + depth_clip(r, gl_info); + scissor(r, gl_info); + state_line_antialias(context, state, STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE)); }
static void rasterizer_cc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; + const struct wined3d_rasterizer_state *r = state->rasterizer_state; GLenum mode;
- mode = state->rasterizer_state && state->rasterizer_state->desc.front_ccw ? GL_CCW : GL_CW; + mode = r && r->desc.front_ccw ? GL_CCW : GL_CW;
gl_info->gl_ops.gl.p_glFrontFace(mode); checkGLcall("glFrontFace"); - if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_DEPTHBIAS))) - state_depthbias(context, state, STATE_RENDER(WINED3D_RS_DEPTHBIAS)); - depth_clip(state->rasterizer_state, gl_info); + fillmode(r, gl_info); + cullmode(r, gl_info); + depthbias(context, state); + depth_clip(r, gl_info); + scissor(r, gl_info); + state_line_antialias(context, state, STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE)); }
static void psorigin_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) @@ -4509,7 +4513,6 @@ const struct wined3d_state_entry_template misc_state_template[] = { STATE_RENDER(WINED3D_RS_DESTBLEND), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), state_blend }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), state_line_antialias}, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE), { STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE), state_line_antialias}, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SEPARATEALPHABLENDENABLE), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SRCBLENDALPHA), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DESTBLENDALPHA), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, @@ -4588,7 +4591,6 @@ const struct wined3d_state_entry_template misc_state_template[] = { STATE_RENDER(WINED3D_RS_ZENABLE), { STATE_RENDER(WINED3D_RS_ZENABLE), state_zenable }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_WRAPU), { STATE_RENDER(WINED3D_RS_WRAPU), state_wrapu }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_WRAPV), { STATE_RENDER(WINED3D_RS_WRAPV), state_wrapv }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_FILLMODE), { STATE_RENDER(WINED3D_RS_FILLMODE), state_fillmode }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_LINEPATTERN), { STATE_RENDER(WINED3D_RS_LINEPATTERN), state_linepattern }, WINED3D_GL_LEGACY_CONTEXT }, { STATE_RENDER(WINED3D_RS_LINEPATTERN), { STATE_RENDER(WINED3D_RS_LINEPATTERN), state_linepattern_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_MONOENABLE), { STATE_RENDER(WINED3D_RS_MONOENABLE), state_monoenable }, WINED3D_GL_EXT_NONE }, @@ -4596,7 +4598,6 @@ const struct wined3d_state_entry_template misc_state_template[] = { STATE_RENDER(WINED3D_RS_PLANEMASK), { STATE_RENDER(WINED3D_RS_PLANEMASK), state_planemask }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ZWRITEENABLE), { STATE_RENDER(WINED3D_RS_ZWRITEENABLE), state_zwriteenable }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_LASTPIXEL), { STATE_RENDER(WINED3D_RS_LASTPIXEL), state_lastpixel }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_CULLMODE), { STATE_RENDER(WINED3D_RS_CULLMODE), state_cullmode }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ZFUNC), { STATE_RENDER(WINED3D_RS_ZFUNC), state_zfunc }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_DITHERENABLE), { STATE_RENDER(WINED3D_RS_DITHERENABLE), state_ditherenable }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_SUBPIXEL), { STATE_RENDER(WINED3D_RS_SUBPIXEL), state_subpixel }, WINED3D_GL_EXT_NONE }, @@ -4660,15 +4661,12 @@ 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_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_SCISSORTESTENABLE), { STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE), state_scissor }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_SLOPESCALEDEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), NULL }, 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_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_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), state_colorwrite3 }, EXT_DRAW_BUFFERS2 }, { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE }, /* Samplers */ { STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE }, @@ -5426,16 +5424,17 @@ static void validate_state_table(struct wined3d_state_entry *state_table) { { 1, 1}, { 3, 3}, + { 8, 8}, { 17, 18}, - { 21, 21}, + { 21, 22}, { 42, 45}, { 47, 47}, { 61, 127}, {149, 150}, {169, 169}, - {177, 177}, + {174, 177}, {193, 193}, - {196, 197}, + {195, 197}, { 0, 0}, }; static const DWORD simple_states[] = diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index c0f28099cf..d8dc379c1a 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -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); - 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, 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));
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, dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, GL_COLOR_BUFFER_BIT, gl_filter); diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index a2a5fb8191..c1fa3db5ad 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2033,9 +2033,15 @@ struct wined3d_blend_state_desc
struct wined3d_rasterizer_state_desc { + enum wined3d_fill_mode fill_mode; + enum wined3d_cull cull_mode; BOOL front_ccw; + float depth_bias; float depth_bias_clamp; + float scale_bias; BOOL depth_clip; + BOOL scissor; + BOOL line_antialias; };
struct wined3d_sampler_desc