Expand metal combined ds workaround

This workaround is needed unless the system is MacOS 13.1+
with architecture at least AMD gcn-4.

Bug: dawn:1389
Change-Id: I3a85be150a0c5ca8b0b74e4b097906f278dd3049
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118023
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng 2023-01-31 18:13:43 +00:00 committed by Dawn LUCI CQ
parent 1468185602
commit 3da942086d
1 changed files with 19 additions and 0 deletions

View File

@ -276,6 +276,25 @@ void Device::InitTogglesFromDriver() {
if (gpu_info::IsAMD(vendorId) || gpu_info::IsIntel(vendorId)) {
SetToggle(Toggle::MetalUseCombinedDepthStencilFormatForStencil8, true);
}
// Local testing shows the workaround is needed on AMD Radeon HD 8870M (gcn-1) MacOS 12.1;
// not on AMD Radeon Pro 555 (gcn-4) MacOS 13.1.
// Conservatively enable the workaround on AMD unless the system is MacOS 13.1+
// with architecture at least AMD gcn-4.
bool isLessThanAMDGN4OrMac13Dot1 = false;
if (gpu_info::IsAMDGCN1(vendorId, deviceId) || gpu_info::IsAMDGCN2(vendorId, deviceId) ||
gpu_info::IsAMDGCN3(vendorId, deviceId)) {
isLessThanAMDGN4OrMac13Dot1 = true;
} else if (gpu_info::IsAMD(vendorId)) {
if (@available(macos 13.1, *)) {
} else {
isLessThanAMDGN4OrMac13Dot1 = true;
}
}
if (isLessThanAMDGN4OrMac13Dot1) {
SetToggle(Toggle::MetalUseBothDepthAndStencilAttachmentsForCombinedDepthStencilFormats,
true);
}
#endif
}