Implement clear_buffer on web (#3426)

This commit is contained in:
Raph Levien 2023-01-26 14:32:34 -08:00 committed by GitHub
parent 659f697705
commit fe2b230b0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View File

@ -38,6 +38,14 @@ Bottom level categories:
- Hal
-->
## Unreleased
### Changes
#### WebGPU
- Implement `CommandEncoder::clear_buffer`. By @raphlinus in [#3426](https://github.com/gfx-rs/wgpu/pull/3426)
## wgpu-0.15.0 (2023-01-25)
### Major Changes

View File

@ -2187,13 +2187,21 @@ impl crate::context::Context for Context {
fn command_encoder_clear_buffer(
&self,
_encoder: &Self::CommandEncoderId,
encoder: &Self::CommandEncoderId,
_encoder_data: &Self::CommandEncoderData,
_buffer: &crate::Buffer,
_offset: wgt::BufferAddress,
_size: Option<wgt::BufferSize>,
buffer: &crate::Buffer,
offset: wgt::BufferAddress,
size: Option<wgt::BufferSize>,
) {
//TODO
let buffer_id = &<<Context as crate::Context>::BufferId>::from(buffer.id).0;
match size {
Some(size) => {
encoder
.0
.clear_buffer_with_f64_and_f64(buffer_id, offset as f64, size.get() as f64)
}
None => encoder.0.clear_buffer_with_f64(buffer_id, offset as f64),
}
}
fn command_encoder_insert_debug_marker(