From a7453835165f2670ccbd6926862854822fa71263 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Sun, 27 Jun 2021 11:20:53 +0200 Subject: [PATCH] Do multiple queries in pipeline-statistics-query test --- player/tests/data/pipeline-statistics-query.ron | 6 +++--- player/tests/test.rs | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/player/tests/data/pipeline-statistics-query.ron b/player/tests/data/pipeline-statistics-query.ron index c765b9d58..bdf9b850a 100644 --- a/player/tests/data/pipeline-statistics-query.ron +++ b/player/tests/data/pipeline-statistics-query.ron @@ -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 ), diff --git a/player/tests/test.rs b/player/tests/test.rs index f19fa9d99..26163d2a0 100644 --- a/player/tests/test.rs +++ b/player/tests/test.rs @@ -26,6 +26,7 @@ struct RawId { #[derive(serde::Deserialize)] enum ExpectedData { Raw(Vec), + U64(Vec), 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::(), 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::>(), }; if &expected_data[..] != contents {