Skip to content

Dynamic state line width setting sometimes discarded #206

@krolli

Description

@krolli

When user attempts to create graphics pipeline with VK_DYNAMIC_STATE_LINE_WIDTH and polygon mode other than VK_POLYGON_MODE_LINE, Vulkan back-end will create graphics pipeline without this dynamic state setting. This can potentially lead to several issues, such as:

  • any calls to vkCmdSetLineWidth while this pipeline is bound are invalid, causing correct code to break (triggering validation errors as well)
  • certain sequences of pipeline binding that relied on dynamic state remaining undisturbed will be broken

This currently affects https://github.com/SaschaWillems/Vulkan (specifically https://github.com/SaschaWillems/Vulkan/blob/master/examples/pipelines/pipelines.cpp#L152) where line width is set while pipeline with fill mode is bound. Even though all created pipelines use line width as dynamic state, only wireframe pipeline actually has this setting.

My understanding is that this is due to gfx-hal storing dynamic state information as part of line polygon mode enum variant. Other dynamic states may be affected by this problem as well, depending on how they are represented in gfx-hal structures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions