Skip to content

Commit

Permalink
extensions: Remove get_properties() helper from extension wrappers (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
MarijnS95 authored Mar 30, 2023
1 parent a9fbc71 commit f98cab4
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 64 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed experimental AMD extensions (#607)
- Removed `query_count` parameter from `get_query_pool_results()` in favour of `data.len()` (#644)
- 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)
- 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)

## [0.37.2] - 2022-01-11

Expand Down
2 changes: 0 additions & 2 deletions ash/src/extensions/ext/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub use self::image_compression_control::ImageCompressionControl;
pub use self::image_drm_format_modifier::ImageDrmFormatModifier;
pub use self::mesh_shader::MeshShader;
pub use self::metal_surface::MetalSurface;
pub use self::physical_device_drm::PhysicalDeviceDrm;
pub use self::private_data::PrivateData;
pub use self::sample_locations::SampleLocations;
pub use self::tooling_info::ToolingInfo;
Expand All @@ -39,7 +38,6 @@ mod image_compression_control;
mod image_drm_format_modifier;
mod mesh_shader;
mod metal_surface;
mod physical_device_drm;
mod private_data;
mod sample_locations;
mod tooling_info;
23 changes: 0 additions & 23 deletions ash/src/extensions/ext/physical_device_drm.rs

This file was deleted.

13 changes: 0 additions & 13 deletions ash/src/extensions/khr/acceleration_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ impl AccelerationStructure {
Self { handle, fp }
}

#[inline]
pub unsafe fn get_properties(
instance: &Instance,
pdevice: vk::PhysicalDevice,
) -> vk::PhysicalDeviceAccelerationStructurePropertiesKHR {
let mut props_rt = vk::PhysicalDeviceAccelerationStructurePropertiesKHR::default();
{
let mut props = vk::PhysicalDeviceProperties2::default().push_next(&mut props_rt);
instance.get_physical_device_properties2(pdevice, &mut props);
}
props_rt
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateAccelerationStructureKHR.html>
#[inline]
pub unsafe fn create_acceleration_structure(
Expand Down
13 changes: 0 additions & 13 deletions ash/src/extensions/khr/ray_tracing_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ impl RayTracingPipeline {
Self { handle, fp }
}

#[inline]
pub unsafe fn get_properties(
instance: &Instance,
pdevice: vk::PhysicalDevice,
) -> vk::PhysicalDeviceRayTracingPipelinePropertiesKHR {
let mut props_rt = vk::PhysicalDeviceRayTracingPipelinePropertiesKHR::default();
{
let mut props = vk::PhysicalDeviceProperties2::default().push_next(&mut props_rt);
instance.get_physical_device_properties2(pdevice, &mut props);
}
props_rt
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysKHR.html>
#[inline]
pub unsafe fn cmd_trace_rays(
Expand Down
13 changes: 0 additions & 13 deletions ash/src/extensions/nv/ray_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ impl RayTracing {
Self { handle, fp }
}

#[inline]
pub unsafe fn get_properties(
instance: &Instance,
pdevice: vk::PhysicalDevice,
) -> vk::PhysicalDeviceRayTracingPropertiesNV {
let mut props_rt = vk::PhysicalDeviceRayTracingPropertiesNV::default();
{
let mut props = vk::PhysicalDeviceProperties2::default().push_next(&mut props_rt);
instance.get_physical_device_properties2(pdevice, &mut props);
}
props_rt
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateAccelerationStructureNV.html>
#[inline]
pub unsafe fn create_acceleration_structure(
Expand Down

0 comments on commit f98cab4

Please sign in to comment.