objc2 encoding assertions interact badly with Metal debug wrappers
type: bugarea: infrastructurebackend: metalplatform: macoskind: diagnostics
In debug builds, objc2 has assertions to check the validity of method calls. These cause problems with Metal debug wrappers (e.g. `CaptureMTLDevice`), which handle some methods via catch-all fallbacks rather than implementing them under their original name and signature.
It might make sense to detect the Metal debug wrappers during hal initialization, and print a warning that feature detection may be degraded, referring to this issue. Claude points out that there are additional wrapper classes `MTLDebugDevice` and `MTLToolsDevice` in addition to `CaptureMTLDevice`, although I'm a bit surprised we haven't seen problems with `MTLDebugDevice` already if it really can show up in the same way as `CaptureMTLDevice`.
Related issues:
- Addressing this in some way in objc2: https://github.com/madsmtm/objc2/issues/645
- #9282 <!-- [iOS] Panic on CaptureMTLDevice when requesting adapter with Xcode GPU Frame Capture enabled (v29.0.0) -->
- #9284 <!-- fix(metal): Check respondsToSelector before feature detection calls -->
- #9471 <!-- Method not found: CaptureMTLDevice supportsShaderBarycentricCoordinates -->
- #9472 <!-- fix(metal): Check ObjC introspection for supportsShaderBarycentricCoordinates -->
- #9756 <!-- Raytraced apps not working when launched from Xcode -->
- #9757 <!-- Workaround xcode misreporting ray tracing support -->
0 条评论