Skip to content

Commit

Permalink
Implement clear_buffer on web (#3426)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphlinus authored Jan 26, 2023
1 parent 659f697 commit fe2b230
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 13 additions & 5 deletions wgpu/src/backend/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit fe2b230

Please sign in to comment.