Skip to content

Commit

Permalink
check for sm 6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Vecvec committed Sep 12, 2024
1 parent 275d082 commit 3cc9801
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions wgpu-hal/src/dx12/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,23 +195,6 @@ impl super::Adapter {
.is_ok()
};

let ray_query = {
let mut features5 = Direct3D12::D3D12_FEATURE_DATA_D3D12_OPTIONS5::default();
let has_features5 = unsafe {
device.CheckFeatureSupport(
Direct3D12::D3D12_FEATURE_D3D12_OPTIONS5,
<*mut _>::cast(&mut features5),
size_of_val(&features5) as u32,
)
}
.is_ok();
if has_features5 {
features5.RaytracingTier == Direct3D12::D3D12_RAYTRACING_TIER_1_1
} else {
false
}
};

let shader_model = if dxc_container.is_none() {
naga::back::hlsl::ShaderModel::V5_1
} else {
Expand Down Expand Up @@ -401,8 +384,19 @@ impl super::Adapter {
&& hr.is_ok()
&& features1.WaveOps.as_bool(),
);
let mut features5 = Direct3D12::D3D12_FEATURE_DATA_D3D12_OPTIONS5::default();
let has_features5 = unsafe {
device.CheckFeatureSupport(
Direct3D12::D3D12_FEATURE_D3D12_OPTIONS5,
<*mut _>::cast(&mut features5),
size_of_val(&features5) as u32,
)
}
.is_ok();
if has_features5 {
features.set(wgt::Features::RAY_QUERY, features5.RaytracingTier == Direct3D12::D3D12_RAYTRACING_TIER_1_1 && shader_model >= naga::back::hlsl::ShaderModel::V6_5);
}

features.set(wgt::Features::RAY_QUERY, ray_query);

let atomic_int64_on_typed_resource_supported = {
let mut features9 = Direct3D12::D3D12_FEATURE_DATA_D3D12_OPTIONS9::default();
Expand Down

0 comments on commit 3cc9801

Please sign in to comment.