Get counterSets and counters using Objective-C style

Bug=dawn:1102

Change-Id: I656938f180ac3436a40ba8720e54618c8921504b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72760
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Li Hao 2021-12-14 08:41:26 +00:00 committed by Dawn LUCI CQ
parent 483bead0e2
commit 4682ae0034
1 changed files with 2 additions and 2 deletions

View File

@ -194,7 +194,7 @@ namespace dawn_native { namespace metal {
// MTLDevices counterSets property declares which counter sets it supports. Check // MTLDevices counterSets property declares which counter sets it supports. Check
// whether it's available on the device before requesting a counter set. // whether it's available on the device before requesting a counter set.
id<MTLCounterSet> counterSet = nil; id<MTLCounterSet> counterSet = nil;
for (id<MTLCounterSet> set in device.counterSets) { for (id<MTLCounterSet> set in [device counterSets]) {
if ([set.name caseInsensitiveCompare:counterSetName] == NSOrderedSame) { if ([set.name caseInsensitiveCompare:counterSetName] == NSOrderedSame) {
counterSet = set; counterSet = set;
break; break;
@ -211,7 +211,7 @@ namespace dawn_native { namespace metal {
// if there is a counter unsupported. // if there is a counter unsupported.
for (MTLCommonCounter counterName : counterNames) { for (MTLCommonCounter counterName : counterNames) {
bool found = false; bool found = false;
for (id<MTLCounter> counter in counterSet.counters) { for (id<MTLCounter> counter in [counterSet counters]) {
if ([counter.name caseInsensitiveCompare:counterName] == NSOrderedSame) { if ([counter.name caseInsensitiveCompare:counterName] == NSOrderedSame) {
found = true; found = true;
break; break;