【发布时间】:2021-11-19 12:25:44
【问题描述】:
我在 C++ 应用程序中使用 id<MTLLibrary> shaderLib = [myMetalDevice newLibraryWithSource:source options:options error:&error]; 在运行时编译金属着色器。
我在日志中收到很多关于未使用变量的类似消息:
[Metal Compiler Warning] Warning: Compilation succeeded with:
program_source:61:14: warning: unused variable 'myVariableName'
float4x4 myVariableName;
有没有办法抑制这些警告? 如果可能,我想忽略具有特定警告类型的消息。 禁用 Metal API Validation 和 Debug executable 没有帮助(即使在 Release 中)。
以下是我找到的相关线索,但没有答案:
Arkit/SceneKit on iOS 14 throws new Warning (Metal)
https://developer.apple.com/forums/thread/659856
https://developer.apple.com/documentation/metal/mtldevice/1433431-newlibrarywithsource
我目前在 macOS Big Sur 11.5 上使用 xcode 12.5。
【问题讨论】: