Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 2 -- dlls/d3d11/state.c | 2 ++ dlls/wined3d/adapter_vk.c | 2 -- dlls/wined3d/context_vk.c | 5 ++--- dlls/wined3d/device.c | 4 ++++ dlls/wined3d/directx.c | 2 -- dlls/wined3d/state.c | 9 ++++----- include/wine/wined3d.h | 1 + 8 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index a386abd4c00..81e5f89a878 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -763,7 +763,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetDepthStencilState(ID3 { wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_STENCILREF, stencil_ref);
- wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_STENCILFAIL, front->StencilFailOp); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_STENCILZFAIL, front->StencilDepthFailOp); if (front->StencilFailOp != back->StencilFailOp || front->StencilDepthFailOp != back->StencilDepthFailOp @@ -771,7 +770,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetDepthStencilState(ID3 || front->StencilFunc != back->StencilFunc) { wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_TWOSIDEDSTENCILMODE, TRUE); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BACK_STENCILFAIL, back->StencilFailOp); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BACK_STENCILZFAIL, back->StencilDepthFailOp); } diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index f2fe8a5910b..eba3dde6143 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -799,8 +799,10 @@ HRESULT d3d_depthstencil_state_create(struct d3d_device *device, const D3D11_DEP wined3d_desc.stencil = desc->StencilEnable; wined3d_desc.stencil_read_mask = desc->StencilReadMask; wined3d_desc.stencil_write_mask = desc->StencilWriteMask; + wined3d_desc.front.fail_op = desc->FrontFace.StencilFailOp; wined3d_desc.front.pass_op = desc->FrontFace.StencilPassOp; wined3d_desc.front.func = desc->FrontFace.StencilFunc; + wined3d_desc.back.fail_op = desc->BackFace.StencilFailOp; wined3d_desc.back.pass_op = desc->BackFace.StencilPassOp; wined3d_desc.back.func = desc->BackFace.StencilFunc;
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index f950f2a4711..cc24ba3e2c4 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -117,11 +117,9 @@ static const struct wined3d_state_entry_template misc_state_template_vk[] = {STATE_RENDER(WINED3D_RS_ANISOTROPY), {STATE_RENDER(WINED3D_RS_ANISOTROPY), state_nop}}, {STATE_RENDER(WINED3D_RS_FLUSHBATCH), {STATE_RENDER(WINED3D_RS_FLUSHBATCH), state_nop}}, {STATE_RENDER(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT), {STATE_RENDER(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT), state_nop}}, - {STATE_RENDER(WINED3D_RS_STENCILFAIL), {STATE_RENDER(WINED3D_RS_ZFUNC)}}, {STATE_RENDER(WINED3D_RS_STENCILZFAIL), {STATE_RENDER(WINED3D_RS_ZFUNC)}}, {STATE_RENDER(WINED3D_RS_STENCILREF), {STATE_RENDER(WINED3D_RS_ZFUNC)}}, {STATE_RENDER(WINED3D_RS_TWOSIDEDSTENCILMODE), {STATE_RENDER(WINED3D_RS_ZFUNC)}}, - {STATE_RENDER(WINED3D_RS_BACK_STENCILFAIL), {STATE_RENDER(WINED3D_RS_ZFUNC)}}, {STATE_RENDER(WINED3D_RS_BACK_STENCILZFAIL), {STATE_RENDER(WINED3D_RS_ZFUNC)}}, {STATE_RENDER(WINED3D_RS_WRAP0), {STATE_RENDER(WINED3D_RS_WRAP0), state_nop}}, {STATE_RENDER(WINED3D_RS_WRAP1), {STATE_RENDER(WINED3D_RS_WRAP0)}}, diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index e5e2a275fd0..1a6b3bffe67 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -2046,7 +2046,7 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte key->ds_desc.stencilTestEnable = state->fb.depth_stencil && d->desc.stencil; if (key->ds_desc.stencilTestEnable) { - key->ds_desc.front.failOp = vk_stencil_op_from_wined3d(state->render_states[WINED3D_RS_STENCILFAIL]); + key->ds_desc.front.failOp = vk_stencil_op_from_wined3d(d->desc.front.fail_op); key->ds_desc.front.passOp = vk_stencil_op_from_wined3d(d->desc.front.pass_op); key->ds_desc.front.depthFailOp = vk_stencil_op_from_wined3d( state->render_states[WINED3D_RS_STENCILZFAIL]); @@ -2056,6 +2056,7 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte key->ds_desc.front.reference = state->render_states[WINED3D_RS_STENCILREF] & ((1 << state->fb.depth_stencil->format->stencil_size) - 1);
+ key->ds_desc.back.failOp = vk_stencil_op_from_wined3d(d->desc.back.fail_op); key->ds_desc.back.passOp = vk_stencil_op_from_wined3d(d->desc.back.pass_op); key->ds_desc.back.compareOp = vk_compare_op_from_wined3d(d->desc.back.func); key->ds_desc.back.compareMask = d->desc.stencil_read_mask; @@ -2065,8 +2066,6 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
if (state->render_states[WINED3D_RS_TWOSIDEDSTENCILMODE]) { - key->ds_desc.back.failOp = vk_stencil_op_from_wined3d( - state->render_states[WINED3D_RS_BACK_STENCILFAIL]); key->ds_desc.back.depthFailOp = vk_stencil_op_from_wined3d( state->render_states[WINED3D_RS_BACK_STENCILZFAIL]); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 8ba834c4f5d..87bd5288f29 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3685,9 +3685,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, set_blend_state = TRUE; break;
+ case WINED3D_RS_BACK_STENCILFAIL: case WINED3D_RS_BACK_STENCILFUNC: case WINED3D_RS_BACK_STENCILPASS: case WINED3D_RS_STENCILENABLE: + case WINED3D_RS_STENCILFAIL: case WINED3D_RS_STENCILFUNC: case WINED3D_RS_STENCILMASK: case WINED3D_RS_STENCILPASS: @@ -3852,11 +3854,13 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, desc.stencil = state->rs[WINED3D_RS_STENCILENABLE]; desc.stencil_read_mask = state->rs[WINED3D_RS_STENCILMASK]; desc.stencil_write_mask = state->rs[WINED3D_RS_STENCILWRITEMASK]; + desc.front.fail_op = state->rs[WINED3D_RS_STENCILFAIL]; desc.front.pass_op = state->rs[WINED3D_RS_STENCILPASS]; desc.front.func = state->rs[WINED3D_RS_STENCILFUNC];
if (state->rs[WINED3D_RS_TWOSIDEDSTENCILMODE]) { + desc.back.fail_op = state->rs[WINED3D_RS_BACK_STENCILFAIL]; desc.back.pass_op = state->rs[WINED3D_RS_BACK_STENCILPASS]; desc.back.func = state->rs[WINED3D_RS_BACK_STENCILFUNC]; } diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index c8098a885ab..818dd46c40f 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2439,11 +2439,9 @@ static const struct wined3d_state_entry_template misc_state_template_no3d[] = {STATE_RENDER(WINED3D_RS_ANISOTROPY), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_FLUSHBATCH), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT), {STATE_VDECL}}, - {STATE_RENDER(WINED3D_RS_STENCILFAIL), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_STENCILZFAIL), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_STENCILREF), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_TWOSIDEDSTENCILMODE), {STATE_VDECL}}, - {STATE_RENDER(WINED3D_RS_BACK_STENCILFAIL), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_BACK_STENCILZFAIL), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_WRAP0), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_WRAP1), {STATE_VDECL}}, diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 1934c9d3a16..20c0c60bc54 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1084,10 +1084,10 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ func_back = GL_ALWAYS; mask = d->desc.stencil_read_mask; ref = state->render_states[WINED3D_RS_STENCILREF] & ((1 << state->fb.depth_stencil->format->stencil_size) - 1); - stencilFail = gl_stencil_op(state->render_states[WINED3D_RS_STENCILFAIL]); + stencilFail = gl_stencil_op(d->desc.front.fail_op); depthFail = gl_stencil_op(state->render_states[WINED3D_RS_STENCILZFAIL]); stencilPass = gl_stencil_op(d->desc.front.pass_op); - stencilFail_back = gl_stencil_op(state->render_states[WINED3D_RS_BACK_STENCILFAIL]); + stencilFail_back = gl_stencil_op(d->desc.back.fail_op); depthFail_back = gl_stencil_op(state->render_states[WINED3D_RS_BACK_STENCILZFAIL]); stencilPass_back = gl_stencil_op(d->desc.back.pass_op);
@@ -4766,11 +4766,9 @@ const struct wined3d_state_entry_template misc_state_template_gl[] = { STATE_RENDER(WINED3D_RS_ANISOTROPY), { STATE_RENDER(WINED3D_RS_ANISOTROPY), state_anisotropy }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FLUSHBATCH), { STATE_RENDER(WINED3D_RS_FLUSHBATCH), state_flushbatch }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT),{ STATE_RENDER(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT),state_translucentsi }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_STENCILFAIL), { STATE_DEPTH_STENCIL, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_STENCILZFAIL), { STATE_DEPTH_STENCIL, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_STENCILREF), { STATE_DEPTH_STENCIL, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_TWOSIDEDSTENCILMODE), { STATE_DEPTH_STENCIL, NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_BACK_STENCILFAIL), { STATE_DEPTH_STENCIL, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_BACK_STENCILZFAIL), { STATE_DEPTH_STENCIL, NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_WRAP0), { STATE_RENDER(WINED3D_RS_WRAP0), state_wrap }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_WRAP1), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, @@ -5570,7 +5568,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) { 40, 40}, { 42, 45}, { 47, 47}, - { 52, 52}, + { 52, 53}, { 55, 56}, { 58, 59}, { 61, 127}, @@ -5579,6 +5577,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) {168, 169}, {171, 171}, {174, 177}, + {186, 186}, {188, 193}, {195, 197}, {206, 209}, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index ee3a8547841..a57007826fe 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2038,6 +2038,7 @@ struct wined3d_blend_state_desc
struct wined3d_stencil_op_desc { + enum wined3d_stencil_op fail_op; enum wined3d_stencil_op pass_op; enum wined3d_cmp_func func; };