Remove device argument from acceleration structure and RT pipeline fns (#378)
This handle is already held onto when creating the safe wrapper object,
but is inconsistently required again in some but not all functions.
Remove it from every function and use the internal handle instead.
Closes: #377
Fixes: 05747b2
("Update Vulkan-Headers to 1.2.162 with stable ray-tracing spec (#341)")
This commit is contained in:
parent
6b4e6c8166
commit
9881d98182
|
@ -125,7 +125,6 @@ impl AccelerationStructure {
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkBuildAccelerationStructuresKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkBuildAccelerationStructuresKHR.html>"]
|
||||||
pub unsafe fn build_acceleration_structures(
|
pub unsafe fn build_acceleration_structures(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
deferred_operation: vk::DeferredOperationKHR,
|
deferred_operation: vk::DeferredOperationKHR,
|
||||||
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR],
|
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR],
|
||||||
build_range_infos: &[&[vk::AccelerationStructureBuildRangeInfoKHR]],
|
build_range_infos: &[&[vk::AccelerationStructureBuildRangeInfoKHR]],
|
||||||
|
@ -139,7 +138,7 @@ impl AccelerationStructure {
|
||||||
|
|
||||||
self.acceleration_structure_fn
|
self.acceleration_structure_fn
|
||||||
.build_acceleration_structures_khr(
|
.build_acceleration_structures_khr(
|
||||||
device,
|
self.handle,
|
||||||
deferred_operation,
|
deferred_operation,
|
||||||
infos.len() as _,
|
infos.len() as _,
|
||||||
infos.as_ptr(),
|
infos.as_ptr(),
|
||||||
|
@ -151,43 +150,47 @@ impl AccelerationStructure {
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyAccelerationStructureKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyAccelerationStructureKHR.html>"]
|
||||||
pub unsafe fn copy_acceleration_structure(
|
pub unsafe fn copy_acceleration_structure(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
deferred_operation: vk::DeferredOperationKHR,
|
deferred_operation: vk::DeferredOperationKHR,
|
||||||
info: &vk::CopyAccelerationStructureInfoKHR,
|
info: &vk::CopyAccelerationStructureInfoKHR,
|
||||||
) -> VkResult<()> {
|
) -> VkResult<()> {
|
||||||
self.acceleration_structure_fn
|
self.acceleration_structure_fn
|
||||||
.copy_acceleration_structure_khr(device, deferred_operation, info as *const _)
|
.copy_acceleration_structure_khr(self.handle, deferred_operation, info as *const _)
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyAccelerationStructureToMemoryKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyAccelerationStructureToMemoryKHR.html>"]
|
||||||
pub unsafe fn copy_acceleration_structure_to_memory(
|
pub unsafe fn copy_acceleration_structure_to_memory(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
deferred_operation: vk::DeferredOperationKHR,
|
deferred_operation: vk::DeferredOperationKHR,
|
||||||
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
|
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
|
||||||
) -> VkResult<()> {
|
) -> VkResult<()> {
|
||||||
self.acceleration_structure_fn
|
self.acceleration_structure_fn
|
||||||
.copy_acceleration_structure_to_memory_khr(device, deferred_operation, info as *const _)
|
.copy_acceleration_structure_to_memory_khr(
|
||||||
|
self.handle,
|
||||||
|
deferred_operation,
|
||||||
|
info as *const _,
|
||||||
|
)
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyMemoryToAccelerationStructureKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyMemoryToAccelerationStructureKHR.html>"]
|
||||||
pub unsafe fn copy_memory_to_acceleration_structure(
|
pub unsafe fn copy_memory_to_acceleration_structure(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
deferred_operation: vk::DeferredOperationKHR,
|
deferred_operation: vk::DeferredOperationKHR,
|
||||||
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
|
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
|
||||||
) -> VkResult<()> {
|
) -> VkResult<()> {
|
||||||
self.acceleration_structure_fn
|
self.acceleration_structure_fn
|
||||||
.copy_memory_to_acceleration_structure_khr(device, deferred_operation, info as *const _)
|
.copy_memory_to_acceleration_structure_khr(
|
||||||
|
self.handle,
|
||||||
|
deferred_operation,
|
||||||
|
info as *const _,
|
||||||
|
)
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWriteAccelerationStructuresPropertiesKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWriteAccelerationStructuresPropertiesKHR.html>"]
|
||||||
pub unsafe fn write_acceleration_structures_properties(
|
pub unsafe fn write_acceleration_structures_properties(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
acceleration_structures: &[vk::AccelerationStructureKHR],
|
acceleration_structures: &[vk::AccelerationStructureKHR],
|
||||||
query_type: vk::QueryType,
|
query_type: vk::QueryType,
|
||||||
data: &mut [u8],
|
data: &mut [u8],
|
||||||
|
@ -195,7 +198,7 @@ impl AccelerationStructure {
|
||||||
) -> VkResult<()> {
|
) -> VkResult<()> {
|
||||||
self.acceleration_structure_fn
|
self.acceleration_structure_fn
|
||||||
.write_acceleration_structures_properties_khr(
|
.write_acceleration_structures_properties_khr(
|
||||||
device,
|
self.handle,
|
||||||
acceleration_structures.len() as _,
|
acceleration_structures.len() as _,
|
||||||
acceleration_structures.as_ptr(),
|
acceleration_structures.as_ptr(),
|
||||||
query_type,
|
query_type,
|
||||||
|
@ -239,11 +242,10 @@ impl AccelerationStructure {
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAccelerationStructureHandleKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAccelerationStructureHandleKHR.html>"]
|
||||||
pub unsafe fn get_acceleration_structure_device_address(
|
pub unsafe fn get_acceleration_structure_device_address(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
info: &vk::AccelerationStructureDeviceAddressInfoKHR,
|
info: &vk::AccelerationStructureDeviceAddressInfoKHR,
|
||||||
) -> vk::DeviceAddress {
|
) -> vk::DeviceAddress {
|
||||||
self.acceleration_structure_fn
|
self.acceleration_structure_fn
|
||||||
.get_acceleration_structure_device_address_khr(device, info as *const _)
|
.get_acceleration_structure_device_address_khr(self.handle, info as *const _)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html>"]
|
||||||
|
@ -269,14 +271,13 @@ impl AccelerationStructure {
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceAccelerationStructureCompatibilityKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceAccelerationStructureCompatibilityKHR.html>"]
|
||||||
pub unsafe fn get_device_acceleration_structure_compatibility(
|
pub unsafe fn get_device_acceleration_structure_compatibility(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
version: &vk::AccelerationStructureVersionInfoKHR,
|
version: &vk::AccelerationStructureVersionInfoKHR,
|
||||||
) -> vk::AccelerationStructureCompatibilityKHR {
|
) -> vk::AccelerationStructureCompatibilityKHR {
|
||||||
let mut compatibility = vk::AccelerationStructureCompatibilityKHR::default();
|
let mut compatibility = vk::AccelerationStructureCompatibilityKHR::default();
|
||||||
|
|
||||||
self.acceleration_structure_fn
|
self.acceleration_structure_fn
|
||||||
.get_device_acceleration_structure_compatibility_khr(
|
.get_device_acceleration_structure_compatibility_khr(
|
||||||
device,
|
self.handle,
|
||||||
version,
|
version,
|
||||||
&mut compatibility as *mut _,
|
&mut compatibility as *mut _,
|
||||||
);
|
);
|
||||||
|
@ -287,7 +288,6 @@ impl AccelerationStructure {
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAccelerationStructureBuildSizesKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAccelerationStructureBuildSizesKHR.html>"]
|
||||||
pub unsafe fn get_acceleration_structure_build_sizes(
|
pub unsafe fn get_acceleration_structure_build_sizes(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
build_type: vk::AccelerationStructureBuildTypeKHR,
|
build_type: vk::AccelerationStructureBuildTypeKHR,
|
||||||
build_info: &vk::AccelerationStructureBuildGeometryInfoKHR,
|
build_info: &vk::AccelerationStructureBuildGeometryInfoKHR,
|
||||||
max_primitive_counts: &[u32],
|
max_primitive_counts: &[u32],
|
||||||
|
@ -298,7 +298,7 @@ impl AccelerationStructure {
|
||||||
|
|
||||||
self.acceleration_structure_fn
|
self.acceleration_structure_fn
|
||||||
.get_acceleration_structure_build_sizes_khr(
|
.get_acceleration_structure_build_sizes_khr(
|
||||||
device,
|
self.handle,
|
||||||
build_type,
|
build_type,
|
||||||
build_info as *const _,
|
build_info as *const _,
|
||||||
max_primitive_counts.as_ptr(),
|
max_primitive_counts.as_ptr(),
|
||||||
|
|
|
@ -107,7 +107,6 @@ impl RayTracingPipeline {
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.html>"]
|
||||||
pub unsafe fn get_ray_tracing_capture_replay_shader_group_handles(
|
pub unsafe fn get_ray_tracing_capture_replay_shader_group_handles(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
pipeline: vk::Pipeline,
|
pipeline: vk::Pipeline,
|
||||||
first_group: u32,
|
first_group: u32,
|
||||||
group_count: u32,
|
group_count: u32,
|
||||||
|
@ -117,7 +116,7 @@ impl RayTracingPipeline {
|
||||||
|
|
||||||
self.ray_tracing_fn
|
self.ray_tracing_fn
|
||||||
.get_ray_tracing_capture_replay_shader_group_handles_khr(
|
.get_ray_tracing_capture_replay_shader_group_handles_khr(
|
||||||
device,
|
self.handle,
|
||||||
pipeline,
|
pipeline,
|
||||||
first_group,
|
first_group,
|
||||||
group_count,
|
group_count,
|
||||||
|
@ -150,13 +149,12 @@ impl RayTracingPipeline {
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRayTracingShaderGroupStackSizeKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRayTracingShaderGroupStackSizeKHR.html>"]
|
||||||
pub unsafe fn get_ray_tracing_shader_group_stack_size(
|
pub unsafe fn get_ray_tracing_shader_group_stack_size(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
|
||||||
pipeline: vk::Pipeline,
|
pipeline: vk::Pipeline,
|
||||||
group: u32,
|
group: u32,
|
||||||
group_shader: vk::ShaderGroupShaderKHR,
|
group_shader: vk::ShaderGroupShaderKHR,
|
||||||
) -> vk::DeviceSize {
|
) -> vk::DeviceSize {
|
||||||
self.ray_tracing_fn
|
self.ray_tracing_fn
|
||||||
.get_ray_tracing_shader_group_stack_size_khr(device, pipeline, group, group_shader)
|
.get_ray_tracing_shader_group_stack_size_khr(self.handle, pipeline, group, group_shader)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetRayTracingPipelineStackSizeKHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetRayTracingPipelineStackSizeKHR.html>"]
|
||||||
|
|
Loading…
Reference in a new issue