DiligentGraphics / DiligentCore

A modern cross-platform low-level graphics API
http://diligentgraphics.com/diligent-engine/
Apache License 2.0
631 stars 136 forks source link

[bug] WebGPU: Begin/EndDebugGroup broken #627

Open WangHoi opened 1 month ago

WangHoi commented 1 month ago

Problem

Bug only happens in WebGPU backend, D3D11/12/Vulkan works.

WebGPU validation error:

Diligent Engine: ERROR: WebGPU: Command cannot be recorded while [CommandEncoder (unlabeled)] is locked and [ComputePassEncoder (unlabeled)] is currently open.
 - While encoding [CommandEncoder (unlabeled)].PopDebugGroup().

Environment

Diligent Engine: newest master branch OS: Win11 24H2 Hardware: Ryzen AI9 370HX, RTX 4060 Laptop.

Sample to re-produce:

wgpu_dbgrp.zip

Simplified sample: a DispatchCompute, follows by two Draw.

WangHoi commented 1 month ago

Personal reason suspect:

Outer command pass debug group commands, submitted with compute pass encoder open.

TheMostDiligent commented 1 month ago

In WebGPU, you can have a debug group that either spans draw commands or compute commands. Debug groups that cover both draw and compute don't work.

WangHoi commented 1 month ago

The sample is three Debug group, one cover just Compute, two cover just Draw. No mixed debug spans.