Skip to content

wgpu injects compute dispatches and prevents reuse of pipelines, leading to massive performance issues #8332

@djeedai

Description

@djeedai

Description

wgpu does indirect args validation on Vulkan at least by letting the user code bind pipelines and groups, then overwrite all of that with its own injected pipeline and compute dispatch, then auto-rebind the user's pipeline and finally execute the user's compute dispatch. This doubles the number of pipeline switch, and completely defeats any batching by pipeline which was precisely intended to reduce the heavy cost of switching pipeline.

The InstanceFlag::VALIDATION_INDIRECT_CALL added in v26 to presumably disable this as I understand is unusable since it breaks several DX12 features.

Repro steps

Image

Expected vs observed behavior

wgpu doesn't auto-inject any command that the user didn't explicitly perform, especially not for validation.

Platform

Windows 11 + Vulkan, this has been on-going for at least 3-4 versions, probably more. Currently at v26.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: performanceHow fast things goarea: validationIssues related to validation, diagnostics, and error handling

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions