From 55cd8388d2983f8df62318e2b5b03207e8564e81 Mon Sep 17 00:00:00 2001 From: David Koloski Date: Wed, 21 Sep 2022 18:03:50 -0400 Subject: [PATCH 1/2] Set length of buffer after filling --- Changelog.md | 4 ++++ ash/src/extensions/khr/ray_tracing_pipeline.rs | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 78d73cdbb..7d0a2e016 100644 --- a/Changelog.md +++ b/Changelog.md @@ -29,6 +29,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed experimental AMD extensions (#607) +### Fixed + +- `khr::RayTracingPipeline`: Set the buffer length in `get_ray_tracing_capture_replay_shader_group_handles` so it no longer always returns an empty `Vec` (#658) + ## [0.37.0] - 2022-03-23 ### Changed diff --git a/ash/src/extensions/khr/ray_tracing_pipeline.rs b/ash/src/extensions/khr/ray_tracing_pipeline.rs index f82077401..6825cf20f 100644 --- a/ash/src/extensions/khr/ray_tracing_pipeline.rs +++ b/ash/src/extensions/khr/ray_tracing_pipeline.rs @@ -113,7 +113,7 @@ impl RayTracingPipeline { ) -> VkResult> { let mut data: Vec = Vec::with_capacity(data_size); - (self + let err_code = (self .fp .get_ray_tracing_capture_replay_shader_group_handles_khr)( self.handle, @@ -122,8 +122,9 @@ impl RayTracingPipeline { group_count, data_size, data.as_mut_ptr() as *mut _, - ) - .result_with_success(data) + ); + data.set_len(data_size); + err_code.result_with_success(data) } /// From 099d365ee60733e8cd06f010ab9e81246f39cd09 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Thu, 22 Sep 2022 00:17:38 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- ash/src/extensions/khr/ray_tracing_pipeline.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/ash/src/extensions/khr/ray_tracing_pipeline.rs b/ash/src/extensions/khr/ray_tracing_pipeline.rs index 6825cf20f..9e409e336 100644 --- a/ash/src/extensions/khr/ray_tracing_pipeline.rs +++ b/ash/src/extensions/khr/ray_tracing_pipeline.rs @@ -112,7 +112,6 @@ impl RayTracingPipeline { data_size: usize, ) -> VkResult> { let mut data: Vec = Vec::with_capacity(data_size); - let err_code = (self .fp .get_ray_tracing_capture_replay_shader_group_handles_khr)(