From: Francisco Casas <fcasas@codeweavers.com> Since the pipeline is created with VK_DYNAMIC_STATE_STENCIL_OP, this function needs to be called before submitting drawing commands. Otherwise we get the following Vulkan validation error: VUID-vkCmdDrawIndexed-None-07848(ERROR / SPEC): msgNum: -2099106103 - Validation Error: [ VUID-vkCmdDrawIndexed-None-07848 ] [...] vkCmdDrawIndexed(): VK_DYNAMIC_STATE_STENCIL_OP state not set for this command buffer. The Vulkan spec states: If the bound graphics pipeline state was created with the VK_DYNAMIC_STATE_STENCIL_OP dynamic state enabled then vkCmdSetStencilOp must have been called in the current command buffer prior to this drawing command [...]. --- dlls/wined3d/context_vk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index f70990eaac2..629b3c3e974 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -4304,7 +4304,7 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c VK_CALL(vkCmdSetDepthWriteEnableEXT(vk_command_buffer, d->desc.depth_write)); VK_CALL(vkCmdSetDepthCompareOpEXT(vk_command_buffer, vk_compare_op_from_wined3d(d->desc.depth_func))); VK_CALL(vkCmdSetStencilTestEnableEXT(vk_command_buffer, stencil_enable)); - if (stencil_enable) + if (state->fb.depth_stencil) { VK_CALL(vkCmdSetStencilOpEXT(vk_command_buffer, VK_STENCIL_FACE_FRONT_BIT, vk_stencil_op_from_wined3d(d->desc.front.fail_op), -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11688