Skip to content

Commit 774ab44

Browse files
committed
Add support for QueryType::ResultStatusOnly
This type is introduced by khr_video_queue. We need it to check on the status of a video decode/encode operation.
1 parent d4312d0 commit 774ab44

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

vulkano/src/query.rs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,17 @@ impl QueryPool {
251251
}));
252252
}
253253
}
254+
QueryType::ResultStatusOnly => {
255+
if !flags.intersects(QueryResultFlags::WITH_STATUS) {
256+
return Err(Box::new(ValidationError {
257+
problem: "`self.query_type()` is `QueryType::ResultStatusOnly`, but \
258+
`flags` does not contain `QueryResultFlags::WITH_STATUS`"
259+
.into(),
260+
vuids: &["VUID-vkGetQueryPoolResults-queryType-04810"],
261+
..Default::default()
262+
}));
263+
}
264+
}
254265
QueryType::Occlusion
255266
| QueryType::PipelineStatistics(_)
256267
| QueryType::AccelerationStructureCompactedSize
@@ -388,7 +399,8 @@ impl QueryPoolCreateInfo {
388399
| QueryType::AccelerationStructureCompactedSize
389400
| QueryType::AccelerationStructureSerializationSize
390401
| QueryType::AccelerationStructureSerializationBottomLevelPointers
391-
| QueryType::AccelerationStructureSize => (),
402+
| QueryType::AccelerationStructureSize
403+
| QueryType::ResultStatusOnly => (),
392404
};
393405

394406
if query_count == 0 {
@@ -470,6 +482,8 @@ pub enum QueryType {
470482
///
471483
/// [`write_acceleration_structures_properties`]: crate::command_buffer::AutoCommandBufferBuilder::write_acceleration_structures_properties
472484
AccelerationStructureSize = ash::vk::QueryType::ACCELERATION_STRUCTURE_SIZE_KHR.as_raw(),
485+
486+
ResultStatusOnly = ash::vk::QueryType::RESULT_STATUS_ONLY_KHR.as_raw(),
473487
}
474488

475489
impl QueryType {
@@ -496,6 +510,7 @@ impl QueryType {
496510
| Self::AccelerationStructureSerializationBottomLevelPointers
497511
| Self::AccelerationStructureSize => 1,
498512
Self::PipelineStatistics(flags) => flags.count() as DeviceSize,
513+
Self::ResultStatusOnly => 0,
499514
}
500515
}
501516

@@ -550,6 +565,17 @@ impl QueryType {
550565
}));
551566
}
552567
}
568+
QueryType::ResultStatusOnly => {
569+
if !device.enabled_extensions().khr_video_queue {
570+
return Err(Box::new(ValidationError {
571+
problem: "is `QueryType::ResultStatusOnly`".into(),
572+
requires_one_of: RequiresOneOf(&[RequiresAllOf(&[
573+
Requires::DeviceExtension("khr_video_queue"),
574+
])]),
575+
..Default::default()
576+
}));
577+
}
578+
}
553579
}
554580

555581
Ok(())
@@ -575,6 +601,7 @@ impl From<&QueryType> for ash::vk::QueryType {
575601
QueryType::AccelerationStructureSize => {
576602
ash::vk::QueryType::ACCELERATION_STRUCTURE_SIZE_KHR
577603
}
604+
QueryType::ResultStatusOnly => ash::vk::QueryType::RESULT_STATUS_ONLY_KHR,
578605
}
579606
}
580607
}
@@ -708,12 +735,11 @@ vulkan_bitflags! {
708735
/// available.
709736
PARTIAL = PARTIAL,
710737

711-
/* TODO: enable
712738
// TODO: document
713739
WITH_STATUS = WITH_STATUS_KHR
714740
RequiresOneOf([
715741
RequiresAllOf([DeviceExtension(khr_video_queue)]),
716-
]),*/
742+
]),
717743
}
718744

719745
#[cfg(test)]

0 commit comments

Comments
 (0)