Skip to content

Commit f98cab4

Browse files
authored
extensions: Remove get_properties() helper from extension wrappers (#728)
This helper function isn't consistently implemented across most extension wrappers, and promotes bad Vulkan patterns by not making it obvious to the caller that `get_physical_device_properties2()` can and should be used to fill multiple properties structs at once.
1 parent a9fbc71 commit f98cab4

File tree

6 files changed

+1
-64
lines changed

6 files changed

+1
-64
lines changed

Changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- Removed experimental AMD extensions (#607)
2424
- Removed `query_count` parameter from `get_query_pool_results()` in favour of `data.len()` (#644)
2525
- Removed misnamed, deprecated `debug_utils_set_object_name()` and `debug_utils_set_object_tag()` entirely, use `set_debug_utils_object_name()` and `set_debug_utils_object_tag()` instead (#661)
26+
- Removed `get_properties` helper from extension wrappers (and `ext::PhysicalDeviceDrm`). Directly call `get_physical_device_properties2()` with a possible chain of multiple structs instead (#728)
2627

2728
## [0.37.2] - 2022-01-11
2829

ash/src/extensions/ext/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub use self::image_compression_control::ImageCompressionControl;
1616
pub use self::image_drm_format_modifier::ImageDrmFormatModifier;
1717
pub use self::mesh_shader::MeshShader;
1818
pub use self::metal_surface::MetalSurface;
19-
pub use self::physical_device_drm::PhysicalDeviceDrm;
2019
pub use self::private_data::PrivateData;
2120
pub use self::sample_locations::SampleLocations;
2221
pub use self::tooling_info::ToolingInfo;
@@ -39,7 +38,6 @@ mod image_compression_control;
3938
mod image_drm_format_modifier;
4039
mod mesh_shader;
4140
mod metal_surface;
42-
mod physical_device_drm;
4341
mod private_data;
4442
mod sample_locations;
4543
mod tooling_info;

ash/src/extensions/ext/physical_device_drm.rs

-23
This file was deleted.

ash/src/extensions/khr/acceleration_structure.rs

-13
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ impl AccelerationStructure {
2020
Self { handle, fp }
2121
}
2222

23-
#[inline]
24-
pub unsafe fn get_properties(
25-
instance: &Instance,
26-
pdevice: vk::PhysicalDevice,
27-
) -> vk::PhysicalDeviceAccelerationStructurePropertiesKHR {
28-
let mut props_rt = vk::PhysicalDeviceAccelerationStructurePropertiesKHR::default();
29-
{
30-
let mut props = vk::PhysicalDeviceProperties2::default().push_next(&mut props_rt);
31-
instance.get_physical_device_properties2(pdevice, &mut props);
32-
}
33-
props_rt
34-
}
35-
3623
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateAccelerationStructureKHR.html>
3724
#[inline]
3825
pub unsafe fn create_acceleration_structure(

ash/src/extensions/khr/ray_tracing_pipeline.rs

-13
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ impl RayTracingPipeline {
2020
Self { handle, fp }
2121
}
2222

23-
#[inline]
24-
pub unsafe fn get_properties(
25-
instance: &Instance,
26-
pdevice: vk::PhysicalDevice,
27-
) -> vk::PhysicalDeviceRayTracingPipelinePropertiesKHR {
28-
let mut props_rt = vk::PhysicalDeviceRayTracingPipelinePropertiesKHR::default();
29-
{
30-
let mut props = vk::PhysicalDeviceProperties2::default().push_next(&mut props_rt);
31-
instance.get_physical_device_properties2(pdevice, &mut props);
32-
}
33-
props_rt
34-
}
35-
3623
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysKHR.html>
3724
#[inline]
3825
pub unsafe fn cmd_trace_rays(

ash/src/extensions/nv/ray_tracing.rs

-13
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ impl RayTracing {
2020
Self { handle, fp }
2121
}
2222

23-
#[inline]
24-
pub unsafe fn get_properties(
25-
instance: &Instance,
26-
pdevice: vk::PhysicalDevice,
27-
) -> vk::PhysicalDeviceRayTracingPropertiesNV {
28-
let mut props_rt = vk::PhysicalDeviceRayTracingPropertiesNV::default();
29-
{
30-
let mut props = vk::PhysicalDeviceProperties2::default().push_next(&mut props_rt);
31-
instance.get_physical_device_properties2(pdevice, &mut props);
32-
}
33-
props_rt
34-
}
35-
3623
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateAccelerationStructureNV.html>
3724
#[inline]
3825
pub unsafe fn create_acceleration_structure(

0 commit comments

Comments
 (0)