juj/wasm_webgpu

wgpu_is_valid_object does not validate the underlying dawn object in lib_webgpu_dawn.cpp

DavidMohrhardt opened this issue · 3 comments

It seems the function implementation for wgpu_is_valid_object only checks to see if the handle is valid and whether the handle has been registered to the object table but not whether the underlying .dawnObject is valid. This behavior seems incongruous with the name of the function and I wanna double check whether this is the intended behavior.

juj commented

That is an interesting question.

the function implementation for wgpu_is_valid_object only checks to see if the handle is valid and whether the handle has been registered to the object table

This is true.

Going over the WebIDL spec, it does not seem like there exists a JavaScript-exposed function call that would allow querying whether an object handle is valid for its .dawnObject handle. That seems like an internal browser implementation detail.

Or do you have a specific JS function in mind that would be possible to use to detect this?