diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index f57b62e598..475f46dbcf 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -430,11 +430,8 @@ impl crate::Device for super::Device { Flags: conv::map_buffer_usage_to_resource_flags(desc.usage), }; - let (resource, allocation) = suballocation::create_buffer_resource( - DeviceAllocationContext::from(self), - desc, - raw_desc, - )?; + let (resource, allocation) = + suballocation::create_buffer(DeviceAllocationContext::from(self), desc, raw_desc)?; if let Some(label) = desc.label { unsafe { resource.SetName(&windows::core::HSTRING::from(label)) } @@ -514,11 +511,8 @@ impl crate::Device for super::Device { Flags: conv::map_texture_usage_to_resource_flags(desc.usage), }; - let (resource, allocation) = suballocation::create_texture_resource( - DeviceAllocationContext::from(self), - desc, - raw_desc, - )?; + let (resource, allocation) = + suballocation::create_texture(DeviceAllocationContext::from(self), desc, raw_desc)?; if let Some(label) = desc.label { unsafe { resource.SetName(&windows::core::HSTRING::from(label)) } @@ -1586,7 +1580,7 @@ impl crate::Device for super::Device { Flags: Direct3D12::D3D12_RESOURCE_FLAG_NONE, }; - let (buffer, allocation) = suballocation::create_buffer_resource( + let (buffer, allocation) = suballocation::create_buffer( DeviceAllocationContext::from(self), &buffer_desc, raw_buffer_desc, @@ -2294,7 +2288,7 @@ impl crate::Device for super::Device { Flags: Direct3D12::D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, }; - let (resource, allocation) = suballocation::create_acceleration_structure_resource( + let (resource, allocation) = suballocation::create_acceleration_structure( DeviceAllocationContext::from(self), desc, raw_desc, diff --git a/wgpu-hal/src/dx12/suballocation.rs b/wgpu-hal/src/dx12/suballocation.rs index 5ad72cdbc4..ea217fe2ff 100644 --- a/wgpu-hal/src/dx12/suballocation.rs +++ b/wgpu-hal/src/dx12/suballocation.rs @@ -92,7 +92,7 @@ impl<'a> From<&'a super::CommandEncoder> for DeviceAllocationContext<'a> { } } -pub(crate) fn create_buffer_resource( +pub(crate) fn create_buffer( ctx: DeviceAllocationContext, desc: &crate::BufferDescriptor, raw_desc: Direct3D12::D3D12_RESOURCE_DESC, @@ -102,7 +102,7 @@ pub(crate) fn create_buffer_resource( // Workaround for Intel Xe drivers if !ctx.shared.private_caps.suballocation_supported { - let resource = create_committed_buffer_resource(ctx, desc, raw_desc)?; + let resource = create_committed_buffer(ctx, desc, raw_desc)?; return Ok((resource, Allocation::none(AllocationType::Buffer))); } @@ -151,14 +151,14 @@ pub(crate) fn create_buffer_resource( )) } -pub(crate) fn create_texture_resource( +pub(crate) fn create_texture( ctx: DeviceAllocationContext, desc: &crate::TextureDescriptor, raw_desc: Direct3D12::D3D12_RESOURCE_DESC, ) -> Result<(Direct3D12::ID3D12Resource, Allocation), crate::DeviceError> { // Workaround for Intel Xe drivers if !ctx.shared.private_caps.suballocation_supported { - let resource = create_committed_texture_resource(ctx, desc, raw_desc)?; + let resource = create_committed_texture(ctx, desc, raw_desc)?; return Ok((resource, Allocation::none(AllocationType::Texture))); } @@ -201,14 +201,14 @@ pub(crate) fn create_texture_resource( )) } -pub(crate) fn create_acceleration_structure_resource( +pub(crate) fn create_acceleration_structure( ctx: DeviceAllocationContext, desc: &crate::AccelerationStructureDescriptor, raw_desc: Direct3D12::D3D12_RESOURCE_DESC, ) -> Result<(Direct3D12::ID3D12Resource, Allocation), crate::DeviceError> { // Workaround for Intel Xe drivers if !ctx.shared.private_caps.suballocation_supported { - let resource = create_committed_acceleration_structure_resource(ctx, desc, raw_desc)?; + let resource = create_committed_acceleration_structure(ctx, desc, raw_desc)?; return Ok(( resource, Allocation::none(AllocationType::AccelerationStructure), @@ -317,7 +317,7 @@ impl From for crate::DeviceError { } } -pub(crate) fn create_committed_buffer_resource( +pub(crate) fn create_committed_buffer( ctx: DeviceAllocationContext, desc: &crate::BufferDescriptor, raw_desc: Direct3D12::D3D12_RESOURCE_DESC, @@ -365,7 +365,7 @@ pub(crate) fn create_committed_buffer_resource( resource.ok_or(crate::DeviceError::Unexpected) } -pub(crate) fn create_committed_texture_resource( +pub(crate) fn create_committed_texture( ctx: DeviceAllocationContext, _desc: &crate::TextureDescriptor, raw_desc: Direct3D12::D3D12_RESOURCE_DESC, @@ -402,7 +402,7 @@ pub(crate) fn create_committed_texture_resource( resource.ok_or(crate::DeviceError::Unexpected) } -pub(crate) fn create_committed_acceleration_structure_resource( +pub(crate) fn create_committed_acceleration_structure( ctx: DeviceAllocationContext, _desc: &crate::AccelerationStructureDescriptor, raw_desc: Direct3D12::D3D12_RESOURCE_DESC,