Posts

Post not yet marked as solved
1 Replies
1.1k Views
Hi, I have a shader that needs one line of code inserted at runtime, based on a choice made by the user. I can do this using the .newLibraryWithSource( ... method on my MTLDevice. In order to do this, I load the contents of my .metal file into a String, and then pass that String as an argument to newLibrary WithSource, after making the appropriate modification. The problem is that this requires runtime compilation of an entire Metal library. It doesn't seem to have much of a negative impact on performance because it does not need to be done repeatedly; however, it seems very cumbersome from the perspective of code management. Is there any way to merge Metal Libraries? If there is, then I could convert the line that needs to be changed to a function, and minimize the amount of code that needs to be compiled at runtime. Thank you.
Posted Last updated
.
Post not yet marked as solved
3 Replies
6.6k Views
Using MacOS 10.14.1 (Mojave), Xcode 10.1Summary: Certain builds cause extreme memory usageWhen performing certain builds on Xcode (for any device, virtual or actual), the memory usage becomes excessive.In Activity Monitor, these are the stats: Physical Memory, 16 GB, Memory used 15.62 GB, Cached Files: 385 MB, Swap Used: 1.24 GB, App Memory 640 MB, Wired Memory 13.8 GB, Compressed: 1.17 GB. The memory for Xcode itself is aboug 400 MB, with aboug 300 MB Compressed.Memory pressure in the Activity Monitory is red.This situation is caused by the build action in Xcode. I have run this without any other apps running, and the result is the same.Given the fact that memory is swapping, the build takes a very long time and the computer is otherwise unusable. When the build finally completes, the system eventually recovers, to this status: Physical Memory: 16 GB, Memory Used: 8.79 GB, Cached Files: 2.87 GB, Swap Used: 913.8 MB, App Memory 2.88 GB, Wired Memory 4.75 GB, Compressed: 1.12 GBThe computer becomes usable at that point. App memory is very high - SimStreamProcessorService is uing 706 MB, lidb-rpc-server is using 514 MB - I don't know what either of those are. Swap Used is still greater than 0, but it must be mostly filled with XCode so does not affect other processes.This does not happen with every Xcode build. A different project, with seemingly more complexity than the problematic project, builds quickly with no memory issues.I can provide more details about the problematic project if that might help. It is relativley simple. It uses the VLC library, which is not used by the project that compiles without a problem, but it has used VLC in the past without this problem. The project also uses WKWebView and ReplayKit.Thanks,Geoff
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.3k Views
Hi, I installed Xcode 12 yesterday, and am having some serious problems. (All the problems below happen after cleaning build folder, deleting derived data folder and rebooting the computer) 1) Value of slider in xib file does not match the value immediately after loading. Slider is clearly set to a value of 4 in the xib file, and that is what it has been when the app loads the xib file prior to Xcode 12. Now, after these two lines are executed gc = [[GameControllerIOS alloc]init]; [[NSBundle mainBundle] loadNibNamed:@"GameControllerIOS" owner:gc  options:nil]; the value of the slider is 1 instead of 4. 2) Metal animations in the iPhone XS simulator are very slow now. Prior to Xcode 12 they ran at 60 FPS, now they run at 15 FPS. On the actual iPhone, the animations still run at 60 FPS. 3) I am getting a zombie crash in a section of code that has not been modified in a very long time. All of these are concerning. I'm willing to accept possible blame for #3, which is occurring for an object that at one point has a retain count of over 20 because it is being added to a variety of dictionaries and arrays. I don't know that to make of #2 - I think that being able to run Metal code on the simulator is recent. However, unless there is some other way to load a xib file, I don't see how #1 can be my fault. It has been working for years as is. Thanks for your help.
Posted Last updated
.
Post not yet marked as solved
0 Replies
553 Views
Hi, I just upgraded to Xcode 12.0 . Running an app which uses Metal in the iPhone XS simulator. Before upgrade, the app was running at 60 FPS. With the new version of Xcode, the app is running at 15 FPS. This also happens on the iPhone 11 simulator. No problem on the actual iPhone XS device - runs smoothly at 60 FPS just like before. Any ideas?
Posted Last updated
.
Post not yet marked as solved
0 Replies
491 Views
Hi, Perhaps the textures are too complicated for something like this to be done simply, but... I have two depth textures, same size, same pixel format, each created with a separate rendering pass. One to calculate shadows created by stationary objects, the other to calculate shadows created by moving objects. Is there an easy way to combine the two textures, so that I end up with a single texture that I can use "sample_compare" inside a shader? Or is the best way to pass both textures to the shader and do samplecompare twice? Thanks
Posted Last updated
.