Fix pipeline statistics stride

This commit is contained in:
Dzmitry Malyshau 2021-07-13 11:25:10 -04:00
parent 087253dbb5
commit 33dee76462
2 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,10 @@
# Change Log
## wgpu-core-0.9.1 (2021-07-13)
- fix buffer inits delayed by a frame
- fix query resolves to initialize buffers
- fix pipeline statistics stride
## v0.9 (2021-06-18)
- Updated:
- naga to `v0.5`.

View File

@ -382,7 +382,11 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
.into());
}
let stride = query_set.elements * wgt::QUERY_SIZE;
let elements_per_query = match query_set.desc.ty {
wgt::QueryType::PipelineStatistics(ps) => ps.bits().count_ones(),
wgt::QueryType::Timestamp => 1,
};
let stride = elements_per_query * wgt::QUERY_SIZE;
let bytes_used = (stride * query_count) as BufferAddress;
let buffer_start_offset = destination_offset;