mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 14:31:08 +01:00
refactor(dx12): detect UnrestrictedBufferTextureCopyPitchSupported
This commit is contained in:
1 parent
2ea52e021f
commit
f3dad2265d
2 files changed
+18
No files matched your search
@@ -200,6 +200,21 @@ impl super::Adapter {
|
||||
.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 =
|
||||
Direct3D12::D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE;
|
||||
{
|
||||
@@ -304,6 +319,8 @@ impl super::Adapter {
|
||||
suballocation_supported: !info.name.contains("Iris(R) Xe"),
|
||||
shader_model,
|
||||
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
|
||||
|
||||
@@ -601,6 +601,7 @@ struct PrivateCapabilities {
|
||||
suballocation_supported: bool,
|
||||
shader_model: naga::back::hlsl::ShaderModel,
|
||||
max_sampler_descriptor_heap_size: u32,
|
||||
_unrestricted_buffer_texture_copy_pitch_supported: bool,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
||||
Reference in new issue
Block a user