Post

Replies

Boosts

Views

Activity

Measuring Mac Metal FPS
When running a macOS app rendering with Metal under the Xcode 12 debugger, the debug navigator displays FPS (frame rate) among other things. But if I launch the program outside Xcode and attach to the process, the debug navigator does not show FPS, though it does show memory usage and such. What's up with that? I tried changing the Run mode of the scheme to use the Release build instead of the the Debug build, but then rendering was quite noticeably slower. Is there some quick way to get a frame rate? I'm aware that Instruments can measure various things relating to Metal, but it's not obvious to me how to see something as simple as a frame rate.
0
0
1k
Mar ’21
Xcode build rule input files
As I understand it, when you define a custom build rule with a script, Xcode will pass each matching input file to your script though variables like INPUT_FILE_PATH. So you normally don't need to explicitly list input files. However, there is an "input files" section in the build rule definition. How is that used? I'm hoping that it only used for dependencies and deciding whether a rule needs to be run. For example, suppose my rule is compiling a source file. Normally I just want to re-run the compile if the source file changes, but if the compiler itself changes, I probably also want to recompile. Can I list the compiler as an input file?
0
0
1k
Jun ’21
SSL error on download, Sierra only
I have an app that uses NSURLDownload to download some files. I get an SSL error when running on Sierra (macOS 10.12), but it works fine on El Capitan (10.11) and High Sierra (10.13) and later. Safari has no problem downloading the same file on Sierra. Logging the NSError from the download:didFailWithError: delegate method shows: Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x7f9620045950>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, NSErrorPeerCertificateChainKey=(     "<cert(0x7f961f14ce00) s: files.frameforge.com i: R3>",     "<cert(0x7f961f12bc00) s: R3 i: ISRG Root X1>",     "<cert(0x7f961f12c400) s: ISRG Root X1 i: DST Root CA X3>" ), NSUnderlyingError=0x7f961e4af1a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=https://files.frameforge.com/webgrab/mac/ff4.0-mac-update-list.xml.wgz, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, kCFStreamPropertySSLPeerCertificates=(     "<cert(0x7f961f14ce00) s: files.frameforge.com i: R3>",     "<cert(0x7f961f12bc00) s: R3 i: ISRG Root X1>",     "<cert(0x7f961f12c400) s: ISRG Root X1 i: DST Root CA X3>" ), _kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x7f9620045950>, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., _kCFStreamErrorDomainKey=3, NSErrorFailingURLKey=https://files.frameforge.com/webgrab/mac/ff4.0-mac-update-list.xml.wgz, _kCFStreamErrorCodeKey=-9802}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://files.frameforge.com/webgrab/mac/ff4.0-mac-update-list.xml.wgz, NSErrorFailingURLStringKey=https://files.frameforge.com/webgrab/mac/ff4.0-mac-update-list.xml.wgz, NSErrorClientCertificateStateKey=0} Any idea how I could fix this? Regarding the recovery suggestion "Would you like to connect to the server anyway?", how would I do that, use an http URL?
2
0
1.3k
Jul ’21
Xcode live issues bogus errors
I have a project with several targets, which use different header paths and have some C++ code conditionalized by preprocessor symbols with #if. The targets build without error, but "live issues" produces errors, because apparently it's using the wrong headers but the right preprocessor symbols. I've tried nuking the derived data. Any other suggestions? I'm using Xcode 13.2.
1
0
561
Dec ’21
Core Image content filters broken in Big Sur
When I try to use custom Core Image filters in the contentFilters property of an NSView, they don't work in Big Sur (as of 11.0.1 beta). They do work in Catalina. Doesn't matter if they're written using Metal or Core Image Kernel Language. I've reported this as a bug, but I'm wondering if there is some trick or workaround.
2
0
1.3k
Feb ’22
Can one create an NSBitmapImageRep from floating-point data?
In the documentation of -[NSBitmapImageRep initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:], it says that the bitmap format mask can include NSBitmapFormatFloatingPointSamples, which suggests that the answer is yes, but it also says that the number of bits per component can be at most 16, which suggests that the answer is no.
1
0
1.2k
Apr ’22
ENABLE_USER_SCRIPT_SANDBOXING in Xcode 14
Anyone have more understanding of how this is supposed to work , beyond the quick help "If enabled, the build system will sandbox user scripts to disallow undeclared input/output dependencies."? When I turned it on, one of my build scripts failed. Operation not permitted error: Sandbox: bash(29174) deny(1) file-read-data In this case, the input path is to a folder (a framework) and the output path is in the build directory. The paths are definitely correct, because the script accesses them as $SCRIPT_INPUT_FILE_0 and $SCRIPT_OUTPUT_FILE_0, so the script wouldn't work at all if I had an error in the paths. I tried putting a slash at the end of an input path, and then the error was just "operation not permitted", without mentioning the sandbox.
2
2
8.6k
Jun ’22