Skip to content

Commit

Permalink
Support D3D12RelaxMinSubgroupSizeTo8 toggle in new subgroup size API
Browse files Browse the repository at this point in the history
Bug: 354751907
Change-Id: I686a1c94083f35aab0fd9ab0cd4163b59efd2d64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/219154
Reviewed-by: Loko Kung <[email protected]>
Auto-Submit: David Neto <[email protected]>
Commit-Queue: David Neto <[email protected]>
  • Loading branch information
dneto0 authored and Dawn LUCI CQ committed Dec 12, 2024
1 parent 888be54 commit f06ff13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/dawn/native/Adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ wgpu::Status AdapterBase::APIGetInfo(AdapterInfo* info) const {

mPhysicalDevice->PopulateBackendProperties(unpacked);

if (auto* subgroupsProperties = unpacked.Get<AdapterPropertiesSubgroups>()) {
if (mPhysicalDevice->GetBackendType() == wgpu::BackendType::D3D12 &&
mTogglesState.IsEnabled(Toggle::D3D12RelaxMinSubgroupSizeTo8)) {
subgroupsProperties->subgroupMinSize =
std::min(subgroupsProperties->subgroupMinSize, 8u);
}
}

// Allocate space for all strings.
size_t allocSize = mPhysicalDevice->GetVendorName().length() +
mPhysicalDevice->GetArchitectureName().length() +
Expand Down
2 changes: 2 additions & 0 deletions src/dawn/native/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ DeviceBase::DeviceBase(AdapterBase* adapter,
GetDefaultLimits(&mLimits.v1, adapter->GetFeatureLevel());
}
// Get experimentalSubgroupLimits from physical device
// TODO(crbug.com/382520104): Remove this since these are now exposed as
// properties on AdapterInfo.
mLimits.experimentalSubgroupLimits =
GetPhysicalDevice()->GetLimits().experimentalSubgroupLimits;
if (GetPhysicalDevice()->GetBackendType() == wgpu::BackendType::D3D12 &&
Expand Down

0 comments on commit f06ff13

Please sign in to comment.