WebGPU-Step-By-Step
WebGPU-Step-By-Step copied to clipboard
does not match the size of the other attachments
看报错信息,是size不匹配,这是我的一个解决方法。

Do not forget to return the "size" in function "InitGPU()" in helper.ts file, and then you can set the texture size when you call "device.createTexture()". It jusk like this:
const depthTexture = device.createTexture({
size: [gpu.size[0], gpu.size[1], 1],
format: "depth24plus",
usage: GPUTextureUsage.RENDER_ATTACHMENT
});