wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

beginRenderPass device mismatched crashes

Open sagudev opened this issue 1 year ago • 3 comments

Description As in https://github.com/gfx-rs/wgpu/issues/5582 beginRenderPass should do validation (so wgpu-core). Currently this can cause crash on webgpu:api,validation,encoding,beginRenderPass:depth_stencil_attachment,device_mismatch:* (crash is also visible on firefox).

If using https://github.com/sagudev/wgpu/commit/3c28720afed88c3aaab5513cb21e141ff3ddd5b7 this is also reproducible on wgpu using cts runner.

Given that this isn't first time of device mismatch error I believe all assertDeviceMatch should probably be removed (they are simply wrong as they trigger dom exception instead of validation error, hence CTS test failures) and add device validation checks to wgpu_core.

sagudev avatar Apr 29 '24 07:04 sagudev

here we actually need to invalidate pass per step 5 in device timeline https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-beginrenderpass so validation error will need to happen in end pass.

sagudev avatar Apr 29 '24 07:04 sagudev

I believe all assertDeviceMatch should probably be removed.

That sounds right to me, all the validation should be in wgpu-core.

@crowlKats thoughts on this?

teoxoy avatar Apr 29 '24 09:04 teoxoy

I think this will be harder as I though because, even though we can detect error in beginRenderPass we only need to return invalid (is this even possible in wgpu?) pass and then when doing encoder finish raising validation error.

sagudev avatar May 03 '24 05:05 sagudev