🐛 Answer a residency set's create on x86 with nil and no error
The x86 Macs answer newResidencySetWithDescriptor:error: with nil and set no error (measured: macOS 26.7.1, the AMD Radeon Pro 5300M and the Intel UHD 630, jobs m3-max-20037 and 20038). The x86 guest's device answered nil and an RgfxMetalErrorDomain error 4. It now answers nil and leaves the error out as it was, and still logs the unsupported member once. The arm64 device keeps nil and its error: an M3 makes a set (measured: macOS 27.0.1, the M3 Max, AGXG15XFamilyResidencySet, no error), which the device cannot. The base-class check (tests/inherited_tests.mm), over the x86 bundle, now holds the x86 answer.
This commit is contained in:
1 parent
72503e9c5d
commit
b74fb5d25a
2 files changed
+33
No files matched your search
@@ -134,10 +134,19 @@ constexpr const char *kArgumentLayouts = "argument buffers of a layout object";
|
||||
return nil;
|
||||
}
|
||||
|
||||
// The x86 Macs answer nil and set no error (measured: macOS 26.7.1, the AMD Radeon Pro 5300M and
|
||||
// the Intel UHD 630, the error out nil before and after), so the x86 device leaves `*error` as it
|
||||
// is. An M3 makes a set (measured: macOS 27.0.1, the M3 Max, AGXG15XFamilyResidencySet, with no
|
||||
// error), which the device cannot: the arm64 device answers nil and an error, as a use the device
|
||||
// does not support.
|
||||
- (id<MTLResidencySet>)newResidencySetWithDescriptor:(MTLResidencySetDescriptor *)desc
|
||||
error:(NSError **)error
|
||||
{
|
||||
#if defined(__arm64__)
|
||||
RGFX_UNSUPPORTED_ERROR(error, "residency sets (none on the wire)");
|
||||
#else
|
||||
RGFX_UNSUPPORTED("residency sets (none on the wire)");
|
||||
#endif
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
// or an argument or return value of another size.
|
||||
// A listed selector this macOS's base classes lack is reported, not failed: the guest's macOS can
|
||||
// differ.
|
||||
// It also checks the x86 device's answer to newResidencySetWithDescriptor:error:: nil, its error
|
||||
// out left as it was, as the x86 Macs answer (measured: macOS 26.7.1, the AMD Radeon Pro 5300M
|
||||
// and the Intel UHD 630).
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include <dlfcn.h>
|
||||
@@ -165,6 +168,26 @@ NSString *signatureDifference(Method ours, Method base)
|
||||
return nil;
|
||||
}
|
||||
|
||||
// The device's newResidencySetWithDescriptor:error: answers nil and leaves its error out as it
|
||||
// was. The member reads none of the device's state, so it is called with the class as `self`,
|
||||
// with no device made.
|
||||
void checkResidencySetAnswer(Class device)
|
||||
{
|
||||
SEL sel = sel_registerName("newResidencySetWithDescriptor:error:");
|
||||
Method m = class_getInstanceMethod(device, sel);
|
||||
if (m == nullptr) {
|
||||
fail(@"the device does not answer newResidencySetWithDescriptor:error:");
|
||||
return;
|
||||
}
|
||||
NSError *sentinel = [NSError errorWithDomain:@"inherited_tests" code:1 userInfo:nil];
|
||||
NSError *error = sentinel;
|
||||
id set = ((id(*)(id, SEL, id, NSError **))method_getImplementation(m))((id)device, sel, nil, &error);
|
||||
if (set != nil || error != sentinel)
|
||||
fail([NSString stringWithFormat:@"newResidencySetWithDescriptor:error: answers %@, error %@ (want nil, "
|
||||
@"the error out untouched)",
|
||||
set, error == sentinel ? @"untouched" : error]);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -185,6 +208,7 @@ int main(int argc, char **argv)
|
||||
printf("FAIL: RgfxMetalDevice is not a subclass of IOGPUMetalDevice, of _MTLDevice\n");
|
||||
return 1;
|
||||
}
|
||||
checkResidencySetAnswer(device);
|
||||
NSDictionary<NSString *, NSValue *> *ours = ownMethods(device);
|
||||
NSMutableSet<NSString *> *inBase = [NSMutableSet set];
|
||||
NSUInteger creators = 0, answered = 0, left = 0;
|
||||
|
||||
Reference in new issue
Block a user