refactor(dx12): detect UnrestrictedBufferTextureCopyPitchSupported

This commit is contained in:
Erich Gubler 2025-05-22 12:51:51 -04:00
parent 2ed308a76a
commit 517018e9ae
2 changed files with 18 additions and 0 deletions

View File

@ -200,6 +200,21 @@ impl super::Adapter {
.is_ok() .is_ok()
}; };
let unrestricted_buffer_texture_copy_pitch_supported = {
let mut features13 = Direct3D12::D3D12_FEATURE_DATA_D3D12_OPTIONS13::default();
unsafe {
device.CheckFeatureSupport(
Direct3D12::D3D12_FEATURE_D3D12_OPTIONS13,
<*mut _>::cast(&mut features13),
size_of_val(&features13) as u32,
)
}
.is_ok()
&& features13
.UnrestrictedBufferTextureCopyPitchSupported
.as_bool()
};
let mut max_sampler_descriptor_heap_size = let mut max_sampler_descriptor_heap_size =
Direct3D12::D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE; Direct3D12::D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE;
{ {
@ -304,6 +319,8 @@ impl super::Adapter {
suballocation_supported: !info.name.contains("Iris(R) Xe"), suballocation_supported: !info.name.contains("Iris(R) Xe"),
shader_model, shader_model,
max_sampler_descriptor_heap_size, max_sampler_descriptor_heap_size,
_unrestricted_buffer_texture_copy_pitch_supported:
unrestricted_buffer_texture_copy_pitch_supported,
}; };
// Theoretically vram limited, but in practice 2^20 is the limit // Theoretically vram limited, but in practice 2^20 is the limit

View File

@ -601,6 +601,7 @@ struct PrivateCapabilities {
suballocation_supported: bool, suballocation_supported: bool,
shader_model: naga::back::hlsl::ShaderModel, shader_model: naga::back::hlsl::ShaderModel,
max_sampler_descriptor_heap_size: u32, max_sampler_descriptor_heap_size: u32,
_unrestricted_buffer_texture_copy_pitch_supported: bool,
} }
#[derive(Default)] #[derive(Default)]