(WebGPU) Issue with Mismatched Attachment Sizes in Render Pass

Encountered a rendering issue where the ‘TextureView_SwapChain_ResolveTarget’ has different dimensions (2806x615) compared to other attachments (12x8).

I have two scenes, the simple scene works and this happens on the complex scene. Can anyone hint me in a right direction ?

Here is the full error from the console warnings (1011 of them before it stopped)

"The resolve target [TextureView "TextureView_SwapChain_ResolveTarget"] size (width: 2806, height: 615) does not match the size of the other attachments (width: 12, height: 8).
 - While validating colorAttachments[0].
 - While encoding [CommandEncoder "render"].BeginRenderPass([RenderPassDescriptor "MainRenderPass"])."

I’m not sure how it can happen, as the resolve + depth/stencil textures are created with the current canvas width/height, which should be the dimensions of the swap chain texture…
What operating system are you testing? Are you able to setup a repro in the Playground?

I am using Windows 11, an Nvidia 3080TI, and a Chromium-based browser (updated as of 02.02.24), and I was not able to set up an example in the playground without a lot of effort. :slight_smile:

However, I found a solution for my issue:

Since my canvas may resize, I had to use Babylon.WebGPUEngine.resize(true); otherwise, it would not display and would print tons of warning messages in the console.

I am also taking notes on the changes I need to make to add support for WebGPU and could post the notes on the forum when I am finished.

In fact, you need to call engine.resize every time the canvas size changes, to keep the textures at the right dimensions. This is also something you’d normally do in WebGL.

I also do that and it worked without forceSetSize on WebGL. WebGPU seems to require to set forceSetSize=true it in my case.