Post

Replies

Boosts

Views

Activity

Xcode 16 doesn't open file with warning/error (C++)
Xcode 16 breaks fundamental feature of error/warning clickthrough to a given header or .cpp file. The issues list will jump to the point of include, instead of the actual error/warning. There's not even a highlighted line since these files aren't the source of the error. Not really sure how this one got through QA since Apple uses Xcode internally. Now I'm constantly having to scour the report navigator, open the items, and then manually jump to file/line.
1
1
508
Oct ’24
How to receive keyboard/mouse on VisionOS?
I tried using the GameController APIs for this, but they didn't seem to work. Is that the recommended API for handling keyboard/mouse? The notifications for mouse and keyboard connect/disconnect don't seem to be defined for visionOS. The visionOS 2.0 touts keyboard and mouse support. The simulator can even forward keyboard/mouse to the app. But there don't seem to be any sample code of how to programatically receive either of these. The game controller works fine (on device, not on Simulator).
1
0
606
Nov ’24
Why can't Xcode projects be opened in multiple workspaces
So Xcode has projects. And I breakup my code/libraries/targets into those. So why after 20 years of Xcode, can a workspace, that holds projects not display the same project opened in another workspace? The workspace redirects all output the project would normally generate in DerivedData to a completely different folder by default. What this means is I have to shut one workspace, and then open the other workspace with a different set of projects to see the ones that are shared. The workspace can't build because it can't open the project shared with another one that is open. VS sln files don't have this issue, so why do workspace files.
1
0
103
Jun ’25
Metal ClampToZero should be ClampToEdge until uv outside [0,1].
The problem with ClampToEdge is that it stretches the outer strip of pixels even when uv goes outside [0,1]. So the typcial change is to use ClampToZero. The problem with ClampToZero/Border of 0 is that it pulls in black transparent color into images. What would be better is for this to double up the edge pixels of the texture (ClampToEdge), and only once uv exceeds 0,1 then bilerp the transparent color. Currently ClampToZero pulls in black and drops alpha at the edges of small images leading to poor edges of small textures.
2
0
1k
Jun ’21
MTKView on macOS is printing CVDisplayLink strings on M1
How do I suppress these strings? These are flooding my logs when I hit pause/resume. These seem to have been left in the debug/release builds. I'm on Xcode 13.1, and building for macOS 10.15. But I'm running on an M1 mac. 2022-02-26 12:56:43.169437-0800 app[96801:1760817] [] [0x1238a0000] CVDisplayLinkStart 2022-02-26 12:56:43.169584-0800 app[96801:1760817] [] [0x1238a0020] CVDisplayLink::start 2022-02-26 12:56:43.169772-0800 app[96801:1761488] [] [0x6000029f6bc0] CVXTime::reset 2022-02-26 12:56:43.926183-0800 app[96801:1760817] [] [0x1238a0000] CVDisplayLinkStop
2
0
685
Feb ’22
Why is there no UTI for gltf/glb/metallib files?
I need to be able to drop these onto my app kram. But using the UTType library reports the following: metallib - "application/octet-stream" gltf - "model/gltf+json", glb - "model/gltf+binary"  [UTType typeWithFilenameExtension: @"metallib"].identifier,    [UTType typeWithFilenameExtension: @"gltf"].identifier,  [UTType typeWithFilenameExtension: @"glb"].identifier dyn.ah62d4rv4ge8043pyqf0g24pc, // ick - metallib dyn.ah62d4rv4ge80s5dyq2,    // ick - gltf dyn.ah62d4rv4ge80s5dc     // ick - glb  ```
2
0
941
Oct ’22
Why can't MSL cast float4x4 to float3x3?
The memory layout doesn't change in this sort of cast, and this is a common construct when transforming normal and tangents. float3 normal = input.normal * (float3x3)skinTfm; no matching conversion for functional-style cast from 'metal::float4x4' (aka 'matrix<float, 4, 4>') to 'metal::float3x3' (aka 'matrix<float, 3, 3>')
2
0
1.8k
Mar ’23
clang multiarch doens't work with precompiled headers
So I found out clang can do multiarch compiles (-arch arm64 -arch x86_64). But Apple seems to have left precompiled header support out. So I built the pch separately for each arch. That all works. The next problem is that one needs to specify -include-pch foo.x64.pch and -include-pch foo.arm64.pch on the command line. This doesn't work on the compile line, since it tries to prepend arm64 AST to a x64 .o file, and vice versa. So there is -Xarch_arm64 and -Xarch_x86_64 . But that option is limited to one argument. But "-include-pch foo.x64.pch" is two arguments. More details of failed attempts here: https://github.com/llvm/llvm-project/issues/114626 And no splitting out the builds isn't the same, because then -valid_arch I don't think skips the other build. This are all libraries being built by Make, and then the universal app built using an Xcode project from the libraries.
2
0
621
Nov ’24
Accelerate simd library isn't complete for C++/ObjC/ObjC++
When you use the simd classes like float3/matrix3x3 on Swift they are great. I can write and run code like this from existing math routines that are readily found on the web. let value = m[0][0] * v[0] When you try to do this in C++/ObjC, the code becomes this. This is not code readily found on the web, and is a big pain to convert. float value = m.columns[0][0] * v[0]; Can the float3x3 and other wrappers to simd_float3x3 provide an operator[] to the column and other operations like splatting since v[0] above pulls the data out of simd registers. We currently have to derive off the matrix classes, but it seems like functionality that should be provided in the C/C++ simd classes. A vector math library should promote better code readability than this. We seem to not be able to derive off the vector types which is an issue below. I also have code based on classes that takes 3 elements that suddenly has to convert to this less readble form. float3 v(x,y,z) - float3 v(simd_make_float3(x,y,z)) And then there's this code that should fill all values like init repeating in Swift. This is error prone in converting existing simd code to Accelerate simd. So then we try to wrap the float3, can't derive off them, and then lose all swizzling support, operators, etc. Then have to roll our own ops on that struct that holds a float3. What's the recommended way to make this more C++ like without more compiler support float3 v = {3} - 3,0,0 wasn't expecting that float3 v(3) doesn't compile v = {3,0,0} is completely different syntax, and doesn't line up with MSL and most simd libraries struct myfloat3 : float3 doesn't work struct myfloat3 { float3 v; - works, but loses swizzles, operators, etc explicit myfloat3(float value) myfloat3(float x, float y, float z) ... }
3
0
2.2k
Jun ’21
QLThumbnailProvider doesn't work
How do you get a macOS 10.15 QuickLook extension to work? I added the provider from the Xcode template. The .appex file is in the app bundle under Contents/Plugins/foo-thumb.appex Can these Quicklook thumbnail providers override the system. So if macOS doesn't handle thumbnails for most types of ktx or any ktx2 files, can I override that with my own Quicklook plugin? I tried using qlmanage with -m, and all I see are qlgenerators in there. I don't see any .appex files registered or listed. So when I try this on ktx (org.krhonos.ktx) and ktx2 files (public.ktx2) a thumbnail isn't generated. qlmanager just seems to hang without the -x argument. And on the one file that worked, it pops up a thumbnail but I don't think it was generated by my appex. sudo qlmanage -t /Users/Foo/tests/Toof-a.ktx -c org.khronos.ktx -x Testing Quick Look thumbnails with files using server: /Users/Foo/tests/Toof-a.kt - force using content type UTI: org.khronos.ktx 2021-05-28 10:04:52.471 qlmanage[23522:4229132] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x984b, name = 'com.apple.tsm.portname' See /usr/include/servers/bootstrap_defs.h for the error codes. 2021-05-28 10:04:52.477 qlmanage[23522:4229132] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x6607, name = 'com.apple.coredrag' See /usr/include/servers/bootstrap_defs.h for the error codes. * No thumbnail created for /Users/Foo/tests/Toof-a.ktx Done producing thumbnails
3
0
2.2k
Jun ’21
Hidden NSTableView shows vertical scrollbar and responds to gestures
This must be a bug in NSTableView, but when I hide the view, the NSScroller shows its scrollbar moving through an empty list and still responds to vertical gestures. Since this is over a view that already handles panning, this causes a giant deadzone where the table was displayed and vertical panning stops on that section of the view because the table view is intercepting it. All I do is supply an NSTableViewDelegate. The autohide property is set on the scrollers. This should not be responding to gestures either.
Topic: UI Frameworks SubTopic: AppKit Tags:
3
0
973
Apr ’22
How to detect ProMotion VRR on iOS
There was a good 2021 WWDC presentation on using ProMotion on iOS, and using Adaptive Sync (ProMotion) on macOS. But while the macOS presentation showed how to detect ProMotion (fullscreen + min/maxInterval mismatch). The iOS side doesn't have this same mechanism. The talk mentions Metal sample code for the talk, but I don't see ProMotion mentioned anywhere in the Metal samples when I do search. https://developer.apple.com/videos/play/wwdc2021/10147/
3
0
1.5k
Jun ’23
Xcode needs to support natvis files
Visual Studio, Stadia, and JetBrains are supporting natvis files, where Xcode is still stuck on lldb python files that even Xcode no longer uses to debug data structures. Apple has converted all of their scripts to native code, so there are no samples of how to write complex lldb visualizer rules. There is already an lldb-eval that can bring in natvis files, so something like this should be brought to Xcode. C++ packages like EASTL only ship with a natvis file, and it's far simpler to edit and write than the lldb rules and python scripting.
3
0
1.3k
Mar ’24
Xcode 16 doesn't open file with warning/error (C++)
Xcode 16 breaks fundamental feature of error/warning clickthrough to a given header or .cpp file. The issues list will jump to the point of include, instead of the actual error/warning. There's not even a highlighted line since these files aren't the source of the error. Not really sure how this one got through QA since Apple uses Xcode internally. Now I'm constantly having to scour the report navigator, open the items, and then manually jump to file/line.
Replies
1
Boosts
1
Views
508
Activity
Oct ’24
How to receive keyboard/mouse on VisionOS?
I tried using the GameController APIs for this, but they didn't seem to work. Is that the recommended API for handling keyboard/mouse? The notifications for mouse and keyboard connect/disconnect don't seem to be defined for visionOS. The visionOS 2.0 touts keyboard and mouse support. The simulator can even forward keyboard/mouse to the app. But there don't seem to be any sample code of how to programatically receive either of these. The game controller works fine (on device, not on Simulator).
Replies
1
Boosts
0
Views
606
Activity
Nov ’24
Why can't Xcode projects be opened in multiple workspaces
So Xcode has projects. And I breakup my code/libraries/targets into those. So why after 20 years of Xcode, can a workspace, that holds projects not display the same project opened in another workspace? The workspace redirects all output the project would normally generate in DerivedData to a completely different folder by default. What this means is I have to shut one workspace, and then open the other workspace with a different set of projects to see the ones that are shared. The workspace can't build because it can't open the project shared with another one that is open. VS sln files don't have this issue, so why do workspace files.
Replies
1
Boosts
0
Views
103
Activity
Jun ’25
Metal ClampToZero should be ClampToEdge until uv outside [0,1].
The problem with ClampToEdge is that it stretches the outer strip of pixels even when uv goes outside [0,1]. So the typcial change is to use ClampToZero. The problem with ClampToZero/Border of 0 is that it pulls in black transparent color into images. What would be better is for this to double up the edge pixels of the texture (ClampToEdge), and only once uv exceeds 0,1 then bilerp the transparent color. Currently ClampToZero pulls in black and drops alpha at the edges of small images leading to poor edges of small textures.
Replies
2
Boosts
0
Views
1k
Activity
Jun ’21
MTKView on macOS is printing CVDisplayLink strings on M1
How do I suppress these strings? These are flooding my logs when I hit pause/resume. These seem to have been left in the debug/release builds. I'm on Xcode 13.1, and building for macOS 10.15. But I'm running on an M1 mac. 2022-02-26 12:56:43.169437-0800 app[96801:1760817] [] [0x1238a0000] CVDisplayLinkStart 2022-02-26 12:56:43.169584-0800 app[96801:1760817] [] [0x1238a0020] CVDisplayLink::start 2022-02-26 12:56:43.169772-0800 app[96801:1761488] [] [0x6000029f6bc0] CVXTime::reset 2022-02-26 12:56:43.926183-0800 app[96801:1760817] [] [0x1238a0000] CVDisplayLinkStop
Replies
2
Boosts
0
Views
685
Activity
Feb ’22
Why is there no UTI for gltf/glb/metallib files?
I need to be able to drop these onto my app kram. But using the UTType library reports the following: metallib - "application/octet-stream" gltf - "model/gltf+json", glb - "model/gltf+binary"  [UTType typeWithFilenameExtension: @"metallib"].identifier,    [UTType typeWithFilenameExtension: @"gltf"].identifier,  [UTType typeWithFilenameExtension: @"glb"].identifier dyn.ah62d4rv4ge8043pyqf0g24pc, // ick - metallib dyn.ah62d4rv4ge80s5dyq2,    // ick - gltf dyn.ah62d4rv4ge80s5dc     // ick - glb  ```
Replies
2
Boosts
0
Views
941
Activity
Oct ’22
Why can't MSL cast float4x4 to float3x3?
The memory layout doesn't change in this sort of cast, and this is a common construct when transforming normal and tangents. float3 normal = input.normal * (float3x3)skinTfm; no matching conversion for functional-style cast from 'metal::float4x4' (aka 'matrix<float, 4, 4>') to 'metal::float3x3' (aka 'matrix<float, 3, 3>')
Replies
2
Boosts
0
Views
1.8k
Activity
Mar ’23
xcode 13/14/15 generate errors but then still runs the build
My build generates 10 errors, and sometimes it halts the "build and run" as expected. Most of the time, it just runs the previously successful build anyways. Seems like a basic tenent of an IDE to not do this unless I've explicitly enabled the run.
Replies
2
Boosts
0
Views
688
Activity
Oct ’23
clang multiarch doens't work with precompiled headers
So I found out clang can do multiarch compiles (-arch arm64 -arch x86_64). But Apple seems to have left precompiled header support out. So I built the pch separately for each arch. That all works. The next problem is that one needs to specify -include-pch foo.x64.pch and -include-pch foo.arm64.pch on the command line. This doesn't work on the compile line, since it tries to prepend arm64 AST to a x64 .o file, and vice versa. So there is -Xarch_arm64 and -Xarch_x86_64 . But that option is limited to one argument. But "-include-pch foo.x64.pch" is two arguments. More details of failed attempts here: https://github.com/llvm/llvm-project/issues/114626 And no splitting out the builds isn't the same, because then -valid_arch I don't think skips the other build. This are all libraries being built by Make, and then the universal app built using an Xcode project from the libraries.
Replies
2
Boosts
0
Views
621
Activity
Nov ’24
Accelerate simd library isn't complete for C++/ObjC/ObjC++
When you use the simd classes like float3/matrix3x3 on Swift they are great. I can write and run code like this from existing math routines that are readily found on the web. let value = m[0][0] * v[0] When you try to do this in C++/ObjC, the code becomes this. This is not code readily found on the web, and is a big pain to convert. float value = m.columns[0][0] * v[0]; Can the float3x3 and other wrappers to simd_float3x3 provide an operator[] to the column and other operations like splatting since v[0] above pulls the data out of simd registers. We currently have to derive off the matrix classes, but it seems like functionality that should be provided in the C/C++ simd classes. A vector math library should promote better code readability than this. We seem to not be able to derive off the vector types which is an issue below. I also have code based on classes that takes 3 elements that suddenly has to convert to this less readble form. float3 v(x,y,z) - float3 v(simd_make_float3(x,y,z)) And then there's this code that should fill all values like init repeating in Swift. This is error prone in converting existing simd code to Accelerate simd. So then we try to wrap the float3, can't derive off them, and then lose all swizzling support, operators, etc. Then have to roll our own ops on that struct that holds a float3. What's the recommended way to make this more C++ like without more compiler support float3 v = {3} - 3,0,0 wasn't expecting that float3 v(3) doesn't compile v = {3,0,0} is completely different syntax, and doesn't line up with MSL and most simd libraries struct myfloat3 : float3 doesn't work struct myfloat3 { float3 v; - works, but loses swizzles, operators, etc explicit myfloat3(float value) myfloat3(float x, float y, float z) ... }
Replies
3
Boosts
0
Views
2.2k
Activity
Jun ’21
QLThumbnailProvider doesn't work
How do you get a macOS 10.15 QuickLook extension to work? I added the provider from the Xcode template. The .appex file is in the app bundle under Contents/Plugins/foo-thumb.appex Can these Quicklook thumbnail providers override the system. So if macOS doesn't handle thumbnails for most types of ktx or any ktx2 files, can I override that with my own Quicklook plugin? I tried using qlmanage with -m, and all I see are qlgenerators in there. I don't see any .appex files registered or listed. So when I try this on ktx (org.krhonos.ktx) and ktx2 files (public.ktx2) a thumbnail isn't generated. qlmanager just seems to hang without the -x argument. And on the one file that worked, it pops up a thumbnail but I don't think it was generated by my appex. sudo qlmanage -t /Users/Foo/tests/Toof-a.ktx -c org.khronos.ktx -x Testing Quick Look thumbnails with files using server: /Users/Foo/tests/Toof-a.kt - force using content type UTI: org.khronos.ktx 2021-05-28 10:04:52.471 qlmanage[23522:4229132] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x984b, name = 'com.apple.tsm.portname' See /usr/include/servers/bootstrap_defs.h for the error codes. 2021-05-28 10:04:52.477 qlmanage[23522:4229132] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x6607, name = 'com.apple.coredrag' See /usr/include/servers/bootstrap_defs.h for the error codes. * No thumbnail created for /Users/Foo/tests/Toof-a.ktx Done producing thumbnails
Replies
3
Boosts
0
Views
2.2k
Activity
Jun ’21
Please fix forums so they can be read and ask questions from Google Chrome
Bad Message 431 reason: Request Header Fields Too Large That's the result I get trying click on any forum message from Google Chrome. Safari doesn't exhibit this issue, so please fix the html that drives for forums so that more browsers are supported.
Replies
3
Boosts
0
Views
1.6k
Activity
Mar ’22
Hidden NSTableView shows vertical scrollbar and responds to gestures
This must be a bug in NSTableView, but when I hide the view, the NSScroller shows its scrollbar moving through an empty list and still responds to vertical gestures. Since this is over a view that already handles panning, this causes a giant deadzone where the table was displayed and vertical panning stops on that section of the view because the table view is intercepting it. All I do is supply an NSTableViewDelegate. The autohide property is set on the scrollers. This should not be responding to gestures either.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
3
Boosts
0
Views
973
Activity
Apr ’22
How to detect ProMotion VRR on iOS
There was a good 2021 WWDC presentation on using ProMotion on iOS, and using Adaptive Sync (ProMotion) on macOS. But while the macOS presentation showed how to detect ProMotion (fullscreen + min/maxInterval mismatch). The iOS side doesn't have this same mechanism. The talk mentions Metal sample code for the talk, but I don't see ProMotion mentioned anywhere in the Metal samples when I do search. https://developer.apple.com/videos/play/wwdc2021/10147/
Replies
3
Boosts
0
Views
1.5k
Activity
Jun ’23
Xcode needs to support natvis files
Visual Studio, Stadia, and JetBrains are supporting natvis files, where Xcode is still stuck on lldb python files that even Xcode no longer uses to debug data structures. Apple has converted all of their scripts to native code, so there are no samples of how to write complex lldb visualizer rules. There is already an lldb-eval that can bring in natvis files, so something like this should be brought to Xcode. C++ packages like EASTL only ship with a natvis file, and it's far simpler to edit and write than the lldb rules and python scripting.
Replies
3
Boosts
0
Views
1.3k
Activity
Mar ’24