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 | 10 ++++------ include/wine/wined3d.h | 1 + 8 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index c913a590dab..a386abd4c00 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -765,7 +765,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetDepthStencilState(ID3
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); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_STENCILPASS, front->StencilPassOp); if (front->StencilFailOp != back->StencilFailOp || front->StencilDepthFailOp != back->StencilDepthFailOp || front->StencilPassOp != back->StencilPassOp @@ -775,7 +774,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetDepthStencilState(ID3 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); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BACK_STENCILPASS, back->StencilPassOp); } else { diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index 14d91c68e86..f2fe8a5910b 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -799,7 +799,9 @@ 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.pass_op = desc->FrontFace.StencilPassOp; wined3d_desc.front.func = desc->FrontFace.StencilFunc; + wined3d_desc.back.pass_op = desc->BackFace.StencilPassOp; wined3d_desc.back.func = desc->BackFace.StencilFunc;
/* We cannot fail after creating a wined3d_depth_stencil_state object. It diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 4ab21cd7998..f950f2a4711 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -119,12 +119,10 @@ static const struct wined3d_state_entry_template misc_state_template_vk[] = {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_STENCILPASS), {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_BACK_STENCILPASS), {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)}}, {STATE_RENDER(WINED3D_RS_WRAP2), {STATE_RENDER(WINED3D_RS_WRAP0)}}, diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index 23b4fcbc90c..e5e2a275fd0 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -2047,7 +2047,7 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte 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.passOp = vk_stencil_op_from_wined3d(state->render_states[WINED3D_RS_STENCILPASS]); + 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]); key->ds_desc.front.compareOp = vk_compare_op_from_wined3d(d->desc.front.func); @@ -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.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; key->ds_desc.back.writeMask = d->desc.stencil_write_mask; @@ -2066,8 +2067,6 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte { key->ds_desc.back.failOp = vk_stencil_op_from_wined3d( state->render_states[WINED3D_RS_BACK_STENCILFAIL]); - key->ds_desc.back.passOp = vk_stencil_op_from_wined3d( - state->render_states[WINED3D_RS_BACK_STENCILPASS]); 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 c72ae633fcc..8ba834c4f5d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3686,9 +3686,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, break;
case WINED3D_RS_BACK_STENCILFUNC: + case WINED3D_RS_BACK_STENCILPASS: case WINED3D_RS_STENCILENABLE: case WINED3D_RS_STENCILFUNC: case WINED3D_RS_STENCILMASK: + case WINED3D_RS_STENCILPASS: case WINED3D_RS_STENCILWRITEMASK: case WINED3D_RS_TWOSIDEDSTENCILMODE: case WINED3D_RS_ZENABLE: @@ -3850,10 +3852,12 @@ 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.pass_op = state->rs[WINED3D_RS_STENCILPASS]; desc.front.func = state->rs[WINED3D_RS_STENCILFUNC];
if (state->rs[WINED3D_RS_TWOSIDEDSTENCILMODE]) { + desc.back.pass_op = state->rs[WINED3D_RS_BACK_STENCILPASS]; desc.back.func = state->rs[WINED3D_RS_BACK_STENCILFUNC]; } else diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index e3f0e0bdb85..c8098a885ab 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2441,12 +2441,10 @@ static const struct wined3d_state_entry_template misc_state_template_no3d[] = {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_STENCILPASS), {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_BACK_STENCILPASS), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_WRAP0), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_WRAP1), {STATE_VDECL}}, {STATE_RENDER(WINED3D_RS_WRAP2), {STATE_VDECL}}, diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 1819155fae3..1934c9d3a16 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1086,10 +1086,10 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ 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]); depthFail = gl_stencil_op(state->render_states[WINED3D_RS_STENCILZFAIL]); - stencilPass = gl_stencil_op(state->render_states[WINED3D_RS_STENCILPASS]); + stencilPass = gl_stencil_op(d->desc.front.pass_op); stencilFail_back = gl_stencil_op(state->render_states[WINED3D_RS_BACK_STENCILFAIL]); depthFail_back = gl_stencil_op(state->render_states[WINED3D_RS_BACK_STENCILZFAIL]); - stencilPass_back = gl_stencil_op(state->render_states[WINED3D_RS_BACK_STENCILPASS]); + stencilPass_back = gl_stencil_op(d->desc.back.pass_op);
TRACE("(twosided %d, ref %x, mask %x, " "GL_FRONT: func: %x, fail %x, zfail %x, zpass %x " @@ -4768,12 +4768,10 @@ const struct wined3d_state_entry_template misc_state_template_gl[] = { 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_STENCILPASS), { 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_BACK_STENCILPASS), { 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 }, { STATE_RENDER(WINED3D_RS_WRAP2), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, @@ -5573,7 +5571,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) { 42, 45}, { 47, 47}, { 52, 52}, - { 56, 56}, + { 55, 56}, { 58, 59}, { 61, 127}, {149, 150}, @@ -5581,7 +5579,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) {168, 169}, {171, 171}, {174, 177}, - {189, 193}, + {188, 193}, {195, 197}, {206, 209}, { 0, 0}, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index f9a4402873f..ee3a8547841 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 pass_op; enum wined3d_cmp_func func; };