CreateScreenshot are not working in WebGPUEngine

When I am using the BABYLON.Tools.CreateScreenshotUsingRenderTarget function in the WebGPU enviroment, I got the chrome warnning message like this:

logger.ts:107 BJS - [14:09:14]: WebGPU uncaptured error (1): [object GPUValidationError] - Destroyed texture [Texture (unlabeled 1022x556 px, TextureFormat::BGRA8Unorm)] used in a submit.
While calling [Queue].Submit([[CommandBuffer from CommandEncoder “upload”], [CommandBuffer from CommandEncoder “render”]])

And the screenshot is empty.

Is it a bug?

Additionally, will I encounter other compatibility issues in the WebGPU environment?

@Evgeni_Popov

Having a look!

so yes this is definitely a bug on our side so no worries we will fix that asap!

Fix screen capture bug with webgpu by deltakosh · Pull Request #15693 · BabylonJS/Babylon.js (github.com)

3 Likes

Great job! You’re so efficient.

I don’t understand why scene. render() needs to be deleted?

it was a fix in the past for a problem we do not have anymore.
In the context of WebGPU we cannot render outside of frame.begin/end

Okay, I understand