SelectionOutlineLayer error when WebGPU's compatibilityMode is false

When WebGPU’s compatibilityMode is set to false, an error occurs if you toggle the selection state of a mesh with child instances using the SelectionOutlineLayer.

Please check the minimum repro for details.

In this example, we select a sphere with child instances using selectionOutlineLayer, then deselect it using clearSelection, and attempt to select it again after a delay.
However, when we try to select it again, rendering stops and the following error occurs.

[Buffer "BabylonWebGPUDevice1_DataBufferUniqueId=45_CopyDst_Vertex_Storage_size128"] used in submit while destroyed.
 - While calling [Queue].Submit([[CommandBuffer from CommandEncoder "[562|0] - UploadEncoder"], [CommandBuffer from CommandEncoder "[562|0] - RenderEncoder"]])

Please let me know if this is a known issue or limitation.

Thank you for this great framework!

A temporary workaround is to create a new instance of SelectionOutlineLayer each time a selection is made, rather than reusing the existing one.

Thanks for reporting, here’s the fix:

1 Like

Thank you for confirming and for the quick fix!