[PATCH 2/2] wined3d: Check for stencil reference change in vulkan backend.

Jan Sikorski jsikorski at codeweavers.com
Wed Feb 3 05:37:46 CST 2021


> 
> On 3 Feb 2021, at 12:14, Henri Verbeet <hverbeet at gmail.com> wrote:
> 
> On Wed, 3 Feb 2021 at 11:01, Jan Sikorski <jsikorski at codeweavers.com> wrote:
>> +    if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_STENCIL_REF)
>> +            && state->depth_stencil_state && state->depth_stencil_state->desc.stencil)
>> +    {
>> +        VK_CALL(vkCmdSetStencilReference(vk_command_buffer, VK_STENCIL_FACE_FRONT_AND_BACK,
>> +            state->stencil_ref & ((1 << state->fb.depth_stencil->format->stencil_size) - 1)));
>> +    }
>> +
> The check for stencil enable above works because we always invalidate
> the stencil reference when setting the depth/stencil state in
> wined3d_cs_exec_set_depth_stencil_state(), but it seems fragile to
> rely on that.

That’s what I intended, it makes sense to me. Are you proposing to always set it regardless wether it was changed? I think the same is true for STATE_BLEND_FACTOR?

> Dynamic state needs to be invalidated when the current command buffer
> is ended in wined3d_context_vk_submit_command_buffer().

Right, thanks, I forgot about that.

- Janek


More information about the wine-devel mailing list