WebGPU: Implement chromium-experimental-sampling-resource-table
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// TODO(https://crbug.com/435317394): The extension struct exposed by webgpu.hnit. Use the*
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable table);Proposal says `setResourceTable(GPUResourceTable? table)` so that the resource table can be unset by passing null to setResourceTable. Is that intended?
exception_state.ThrowTypeError(Shall we have a TODO to address this?
wgpu::BindingResource dawn_resource = AsDawnType(resource, exception_state);Throwing an exception on ExceptionState does not abort C++ execution, you should have something like:
```cpp
wgpu::BindingResource dawn_resource = AsDawnType(resource, exception_state);
if (exception_state.HadException()) {
return;
}
```
Same for `insert()` below
[RaisesException] void update(GPUIndex32 slot, GPUBindingResource resource);
[RaisesException] GPUIndex32 insert(GPUBindingResource resource);
[RaisesException] void remove(GPUIndex32 slot);
Use `undefined` not `void` for consistency with other WebGPU methods.
// TODO(https://crbug.com/435317394): The extension struct exposed by webgpu.hCorentin Walleznit. Use the*
Done
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable table);Proposal says `setResourceTable(GPUResourceTable? table)` so that the resource table can be unset by passing null to setResourceTable. Is that intended?
It's a leftover from a previous version of the proposal that I forgot to fix. I guess we can keep like this and see later fixed to handle null in the implementation though.
Corentin WallezNit: remove empty line
Done
// Copyright 2019 The Chromium AuthorsCorentin Walleznit. 2026
Done
exception_state.ThrowTypeError(Shall we have a TODO to address this?
We are likely never going to add external textures to resource tables. Because they are composite bindings they are too difficult to handle.
wgpu::BindingResource dawn_resource = AsDawnType(resource, exception_state);Throwing an exception on ExceptionState does not abort C++ execution, you should have something like:
```cpp
wgpu::BindingResource dawn_resource = AsDawnType(resource, exception_state);
if (exception_state.HadException()) {
return;
}
```Same for `insert()` below
Done
[RaisesException] void update(GPUIndex32 slot, GPUBindingResource resource);
[RaisesException] GPUIndex32 insert(GPUBindingResource resource);
[RaisesException] void remove(GPUIndex32 slot);
Use `undefined` not `void` for consistency with other WebGPU methods.
Looking at `gpu_buffer.idl` and `gpu_compute_pass_encoder.idl` we seem to use `void` consistently in Blink so keeping as is.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable table);Corentin WallezProposal says `setResourceTable(GPUResourceTable? table)` so that the resource table can be unset by passing null to setResourceTable. Is that intended?
It's a leftover from a previous version of the proposal that I forgot to fix. I guess we can keep like this and see later fixed to handle null in the implementation though.
It seems like you now check `nullptr` in `GPUComputePassEncoder::setResourceTable`. Why not in the IDL then?
[RaisesException] void update(GPUIndex32 slot, GPUBindingResource resource);
[RaisesException] GPUIndex32 insert(GPUBindingResource resource);
[RaisesException] void remove(GPUIndex32 slot);
Corentin WallezUse `undefined` not `void` for consistency with other WebGPU methods.
Looking at `gpu_buffer.idl` and `gpu_compute_pass_encoder.idl` we seem to use `void` consistently in Blink so keeping as is.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable table);Corentin WallezProposal says `setResourceTable(GPUResourceTable? table)` so that the resource table can be unset by passing null to setResourceTable. Is that intended?
FrIt's a leftover from a previous version of the proposal that I forgot to fix. I guess we can keep like this and see later fixed to handle null in the implementation though.
It seems like you now check `nullptr` in `GPUComputePassEncoder::setResourceTable`. Why not in the IDL then?
The code checks it to call `SetResourceTable(nullptr)` which is actually supported in Dawn at the moment and unsets the resource table for the rest of the compute encoder, so it's handling both cases of the `?` or am I missing something?
[RaisesException] void update(GPUIndex32 slot, GPUBindingResource resource);
[RaisesException] GPUIndex32 insert(GPUBindingResource resource);
[RaisesException] void remove(GPUIndex32 slot);
Corentin WallezUse `undefined` not `void` for consistency with other WebGPU methods.
FrLooking at `gpu_buffer.idl` and `gpu_compute_pass_encoder.idl` we seem to use `void` consistently in Blink so keeping as is.
In that case, update `undefined destroy` to `void destroy` above
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
GPUResourceTable* GPUDevice::createResourceTable(I've just realized we were missing this check:
> - if desc.size > 65536 throw a RangeError and return.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable table);Corentin WallezProposal says `setResourceTable(GPUResourceTable? table)` so that the resource table can be unset by passing null to setResourceTable. Is that intended?
FrIt's a leftover from a previous version of the proposal that I forgot to fix. I guess we can keep like this and see later fixed to handle null in the implementation though.
Corentin WallezIt seems like you now check `nullptr` in `GPUComputePassEncoder::setResourceTable`. Why not in the IDL then?
The code checks it to call `SetResourceTable(nullptr)` which is actually supported in Dawn at the moment and unsets the resource table for the rest of the compute encoder, so it's handling both cases of the `?` or am I missing something?
Why not applying this change then?
```suggestion
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable? table);
```
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable table);Corentin WallezProposal says `setResourceTable(GPUResourceTable? table)` so that the resource table can be unset by passing null to setResourceTable. Is that intended?
FrIt's a leftover from a previous version of the proposal that I forgot to fix. I guess we can keep like this and see later fixed to handle null in the implementation though.
Corentin WallezIt seems like you now check `nullptr` in `GPUComputePassEncoder::setResourceTable`. Why not in the IDL then?
FrThe code checks it to call `SetResourceTable(nullptr)` which is actually supported in Dawn at the moment and unsets the resource table for the rest of the compute encoder, so it's handling both cases of the `?` or am I missing something?
Why not applying this change then?
```suggestion
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable? table);
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable table);Corentin WallezProposal says `setResourceTable(GPUResourceTable? table)` so that the resource table can be unset by passing null to setResourceTable. Is that intended?
FrIt's a leftover from a previous version of the proposal that I forgot to fix. I guess we can keep like this and see later fixed to handle null in the implementation though.
Corentin WallezIt seems like you now check `nullptr` in `GPUComputePassEncoder::setResourceTable`. Why not in the IDL then?
FrThe code checks it to call `SetResourceTable(nullptr)` which is actually supported in Dawn at the moment and unsets the resource table for the rest of the compute encoder, so it's handling both cases of the `?` or am I missing something?
Corentin WallezWhy not applying this change then?
```suggestion
[RuntimeEnabled=WebGPUExperimentalResourceTable] void setResourceTable(GPUResourceTable? table);
```
I clearly need to wake up still ^^
Done
I've just realized we were missing this check:
> - if desc.size > 65536 throw a RangeError and return.
Good catch! Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
FYI I think you'll need to global-interface-listing wpt tests as you're adding a new method in IDL
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
WebGPU: Implement chromium-experimental-sampling-resource-table
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |