Skip to content

[Impeller] Direct encode on Vulkan doesn't account for dynamic state. #142943

@chinmaygarde

Description

@chinmaygarde

This reproduces as a validation error in Play/RendererTest.CanRenderToTexture/Vulkan and perhaps others. The error:

Trigger: Validation Error: [ VUID-vkCmdDraw-None-07839 ] Object 0: handle =
0x1208bed48, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle =
0xb6bee80000000073, name = Pipeline BoxFade Pipeline, type =
VK_OBJECT_TYPE_PIPELINE; | MessageID = 0x56f23620 | vkCmdDraw():
VK_DYNAMIC_STATE_STENCIL_REFERENCE 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_REFERENCE dynamic state enabled, and if the current
stencilTestEnable state is VK_TRUE, then vkCmdSetStencilReference must have been
called in the current command buffer prior to this drawing command
(https://vulkan.lunarg.com/doc/view/1.3.268.1/mac/1.3-extensions/vkspec.html#VUID-vkCmdDraw-None-07839)

I believe this happens because there is no call to set the stencil reference value because that value is already present in the pipeline state object. Except, we have said that it will be dynamic. So, on the begin, we must read the value from the PSO and make an explicit encode call.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions