mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Do multiple queries in pipeline-statistics-query test
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
name: "Queried number of compute invocations is correct",
|
||||
buffer: (index: 0, epoch: 1),
|
||||
offset: 0,
|
||||
data: Raw([0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]),
|
||||
data: U64([0x0, 0x2A]),
|
||||
),
|
||||
],
|
||||
actions: [
|
||||
@@ -38,14 +38,14 @@
|
||||
desc: (
|
||||
label: Some("Compute Invocation QuerySet"),
|
||||
count: 2,
|
||||
ty: PipelineStatistics((bits: 0x10)), // COMPUTE_SHADER_INVOCATIONS
|
||||
ty: PipelineStatistics((bits: 0x18)), // FRAGMENT_SHADER_INVOCATIONS | COMPUTE_SHADER_INVOCATIONS
|
||||
),
|
||||
),
|
||||
CreateBuffer(
|
||||
Id(0, 1, Empty),
|
||||
(
|
||||
label: Some("Compute Invocation Result Buffer"),
|
||||
size: 8,
|
||||
size: 16,
|
||||
usage: (
|
||||
bits: 9, // COPY_DST | MAP_READ
|
||||
),
|
||||
|
||||
@@ -26,6 +26,7 @@ struct RawId {
|
||||
#[derive(serde::Deserialize)]
|
||||
enum ExpectedData {
|
||||
Raw(Vec<u8>),
|
||||
U64(Vec<u64>),
|
||||
File(String, usize),
|
||||
}
|
||||
|
||||
@@ -33,6 +34,7 @@ impl ExpectedData {
|
||||
fn len(&self) -> usize {
|
||||
match self {
|
||||
ExpectedData::Raw(vec) => vec.len(),
|
||||
ExpectedData::U64(vec) => vec.len() * std::mem::size_of::<u64>(),
|
||||
ExpectedData::File(_, size) => *size,
|
||||
}
|
||||
}
|
||||
@@ -137,6 +139,10 @@ impl Test<'_> {
|
||||
|
||||
bin
|
||||
}
|
||||
ExpectedData::U64(vec) => vec
|
||||
.into_iter()
|
||||
.flat_map(|u| u.to_ne_bytes().to_vec())
|
||||
.collect::<Vec<u8>>(),
|
||||
};
|
||||
|
||||
if &expected_data[..] != contents {
|
||||
|
||||
Reference in New Issue
Block a user