The touch input stutter issue that exists since iOS 16 on devices with Pro Motion Displays has not been fixed yet. I filed a bug report in July but there isn't any progress since months.
I see the problem in all games I tried. My game is fast paced so the stutters are quite obvious and I receive a lot of complaining emails.
My game did run smoothly on Pro Motion devices with iOS 15. Is there a known workaround? I am seeing other developers having the same issue but I can't find any solutions.
Other threads about this issue:
IPhone 14 Pro stuttering in most games when using touch controls
FPS drops when tapping the screen on iPhone 13 Pro Max
General
RSS for tagDelve into the world of graphics and game development. Discuss creating stunning visuals, optimizing game mechanics, and share resources for game developers.
Post
Replies
Boosts
Views
Activity
In visionOS, once an immersive space is opened, the background color is solid black. How do I change this? I just need to set a static color without any shading, but I can't find any documentation or examples on how to do this, and the template that comes with Xcode 15.1 beta 3 doesn't change the background color.
I've searched around for information, but all I can find points back to MTKView.clearColor, which I can't use when drawing into an immersive space, since immersive spaces on visionOS use Compositor Services and not MTKView or CAMetalLayer for drawing 3D content.
I have a Unity project that I have moved to URP to work with the Vision Pro's PolySpatial framework. I have it to the point that everything in my scene loads into the Simulator except for LineRenderers, even with URP/Lit shaders. Is there something special I need to do to make these visible?
Hi,
In a metal shader I have a user-defined struct with a square brackets operator.
This is a simplified version of it:
struct MyData
{
float data[12];
float operator[](int i) const
{
return data[i];
}
};
I pass a device buffer of that type in a compute kernel function:
device const MyData* myDataBuffer
Using the operator with a thread-space object works fine:
MyData data_object = myDataBuffer[0];
float x = data_object[0]; // ok
..but trying to use it with the device-space buffer fails:
float x = myDataBuffer[0][0]; // compilation error
No viable overloaded operator[] for type 'const device MyData'
Candidate function not viable: address space mismatch in 'this' argument ('const device MyData'), parameter type must be 'const MyData'
For other operators I could define the function outside the struct and pass a reference to a device-memory object but
the function for the square brackets operator can only be a member function.
Am I missing something that could make the above statement compile?
Hi,
my MoltenVk app suffers slow frame rates and stutter. The Metal Profiler, Display Tab lists several "Cannot go direct to display due to display rejected" warnings. Anyone with deeper insights?
I am trying to create a custom CGColorSpace in Swift on macOS but am not sure I really understand the concepts.
I want to use a custom color space called Spot1 and if I extract the spot color from a PDF I get the following:
"ColorSpace<Dictionary>" = {
"Cs2<Array>" = (
Separation,
Spot1,
DeviceCMYK,
{
"BitsPerSample<Integer>" = 8;
"Domain<Array>" = (
0,
1
);
"Filter<Name>" = FlateDecode;
"FunctionType<Integer>" = 0;
"Length<Integer>" = 526;
"Range<Array>" = (
0,
1,
0,
1,
0,
1,
0,
1
);
"Size<Array>" = (
1024
);
}
);
};
How can I create this same color space using the CGColorSpace(propertyListPlist: CFPropertyList) API
func createSpot1() -> CGColorSpace? {
let dict0 : NSDictionary = [
"BitsPerSample": 8,
"Domain" : [0,1],
"Filter" : "FlateDecode",
"FunctionType" : 0,
"Length" : 526,
"Range" : [0,1,0,1,0,1,0,1],
"Size" : [1024]]
let dict : NSDictionary = [
"Cs2" : ["Separation","Spot1", "DeviceCMYK", dict0]
]
let space = CGColorSpace(propertyListPlist: dict as CFPropertyList)
if space == nil {
DebugLog("Spot1 color space is nil!")
}
return space
}
I did not know that you can also get GPTK when you're working on an AppleTV app. I'm getting back into game programming so I booted up an app I installed on my AppleTV a few months ago and the display showed GPTK so I was able to see performance.
Drew
My environment: Tensorflow: 2.14, tf-metal: 1.1, M3 Max
I am working on an GAN full of residual sum and concatenation. It is trained correctly if using CPU only. However, if I enable GPU, it would cause:
oc("mps_slice_1"("(mpsFileLoc): /AppleInternal/Library/BuildRoots/d615290d-668b-11ee-9734-0697ca55970a/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm":359:0)): error: 'mps.slice' op failed: length value 32 does not fit within the dimension size (33) with start value (32)
/AppleInternal/Library/BuildRoots/d615290d-668b-11ee-9734-0697ca55970a/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphExecutable.mm:2133: failed assertion `Error: MLIR pass manager failed'
Some customization I guess might be related to the error:
tf.bitwise.bitwise_xor, tf.concat, tf.pad in custom layers
numpy.random in train steps.
Another debug hint I found is that the "32" is the number of channel of my models' conv layer, and change as I change the number of channel.
Is there anyone know what is wrong? Thank you so much
I am trying to control the orientation of a box in Scene Kit (iOS) using gestures. I am using the translation in x and y to update the x and y rotation of the SCNNode.
After a long search I have realised that x and y rotation will always lead to z rotation, thanks to this excellent post: [https://gamedev.stackexchange.com/questions/136174/im-rotating-an-object-on-two-axes-so-why-does-it-keep-twisting-around-the-thir?newreg=130c66c673f848a7be2873bf675573a9)
So I am trying to get the z rotation causes, and then remove this from my object by applying the inverse quaternion however when I rotate the object 90 deg around x, and then 90 deg around Y it behaves VERY weirdly.
It is almost behaving as it is in gimbal lock, but I did not think that using quaternion in the way that I am would cause gimbal lock in this way.
I am sure it is something I am missing, or perhaps I am not able to remove the z rotation in this way.
Thanks!
I have added a video of the strange behaviour here [https://github.com/marcusraty/RotationExample/blob/main/Example.MP4)
And the code example is here [https://github.com/marcusraty/RotationExample)
We plan to release a new app version with Apple Game Center login ability and wondering if that will require any additional review or verification by Apple upon app submission.
In addition I can add, that we already add Game Center support in provision profile and activated Game Center in app store connect few app versions ago.
Hi everyone
When I try to load the model with binary .ply format, MDLAsset can’t read the data as binary
(I tried debugging and checking the buffer but I didn’t see any data)
But when I change the model to ASCII format then model display normally.
If you know the reason, please tell me how to fix it. Thank you
is there a way to debug Metal raytracing intersection functions?
how is that done? i cannot see the intersection functions in the Xcode shader debugger.
I have a metal compute kernel that crashes MTLCompiler when I try to load the .metallib on an iPhone SE running iOS 14.4. I get the following error:
MTLCompiler: Compilation failed with XPC_ERROR_CONNECTION_INTERRUPTED on 3 try
Unable to init metal: Compiler encountered an internal error
By selectively commenting out code I narrowed it down to the use of SIMD permute functions. These functions are supported by the iOS/Metal version running on the device, but not by the actual hardware (according to the metal features set table). I have 2 variants of this code, one that uses the SIMD permute functions and one that doesn't.
My thought was to check the GPU family in Swift, then set a function constant supportsSIMDPermute and use this to ensure the correct variation runs on the device, like this:
constant bool supportsSIMDPermute [[ function_constant(1) ]];
// kernel code
if(supportsSIMDPermute) {
// variant of code that uses SIMD permute
} else {
// Variant that uses slightly slower code that does not use SIMD permute
}
The library compiles without complaints in Xcode, but then crashes the on-device compiler when loading the library. Is this expected behaviour?
For better memory usage when working with MTLTextures (editing + displaying in render passes, compute shaders, etc.) is it possible to save the texture to the app's Documents folder, and then use an UnsafeMutablePointer to access/modify the contents of the texture before displaying in a render pass? And would this be performant (i.e 60fps)? That way the texture won't be directly in memory all the time, but the contents can still be edited and displayed when needed.
Translated Report (Full Report Below)
Process: Asphalt8 [1703]
Path: /Applications/Asphalt8.app/Contents/MacOS/Asphalt8
Identifier: com.gameloft.asphalt8
Version: 7.4.0 (5.0.144)
Code Type: X86-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2023-11-22 19:06:58.3982 +0800
OS Version: macOS 14.1.1 (23B81)
Report Version: 12
Anonymous UUID: AEBBC989-7D55-FCAB-97CE-851A3B261A43
Sleep/Wake UUID: A1667D0D-B0AE-49E2-A94C-7E34B07BA5B8
Time Awake Since Boot: 1308 seconds
Time Since Wake: 444 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000000c0
Exception Codes: 0x0000000000000001, 0x00000000000000c0
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [1703]
VM Region Info: 0xc0 is not in any region. Bytes before following region: 140737487834944
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
shared memory 7ffffff81000-7ffffff82000 [ 4K] r-x/r-x SM=SHM
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 Asphalt8 0x10ecdfda2 0x10d56e000 + 24583586
1 Asphalt8 0x10ecdfac5 0x10d56e000 + 24582853
2 Asphalt8 0x10ec30adb 0x10d56e000 + 23866075
3 Asphalt8 0x10d7fecc9 0x10d56e000 + 2690249
4 Asphalt8 0x10ec103c6 0x10d56e000 + 23733190
5 Asphalt8 0x10d57b89d 0x10d56e000 + 55453
6 Asphalt8 0x10d57bc85 0x10d56e000 + 56453
7 Asphalt8 0x10d575947 0x10d56e000 + 31047
8 CoreFoundation 0x7ff81b872ef6 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 137
9 CoreFoundation 0x7ff81b902cac ___CFXRegistrationPost_block_invoke + 86
10 CoreFoundation 0x7ff81b902bfd _CFXRegistrationPost + 530
11 CoreFoundation 0x7ff81b842e49 _CFXNotificationPost + 826
12 Foundation 0x7ff81c72422e -[NSNotificationCenter postNotificationName:object:userInfo:] + 82
13 AppKit 0x7ff81edf603a -[NSApplication _postDidFinishNotification] + 311
14 AppKit 0x7ff81edf5d82 -[NSApplication _sendFinishLaunchingNotification] + 215
15 AppKit 0x7ff81edf3e27 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 542
16 AppKit 0x7ff81edf3a7c -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 679
17 Foundation 0x7ff81c74cd4e -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 308
18 Foundation 0x7ff81c74cb61 _NSAppleEventManagerGenericHandler + 80
19 AE 0x7ff8228ea9da 0x7ff8228df000 + 47578
20 AE 0x7ff8228ea228 0x7ff8228df000 + 45608
21 AE 0x7ff8228e3b7d aeProcessAppleEvent + 409
22 HIToolbox 0x7ff8265f3664 AEProcessAppleEvent + 55
23 AppKit 0x7ff81ededbae _DPSNextEvent + 1689
24 AppKit 0x7ff81f6e1348 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1304
25 AppKit 0x7ff81eddedfa -[NSApplication run] + 603
26 AppKit 0x7ff81edb2e10 NSApplicationMain + 816
27 Asphalt8 0x10d586484 0x10d56e000 + 99460
28 dyld 0x7ff81b41a3a6 start + 1942
I am attempting to install Apple's Game Porting Toolkit. I have been following the 'read me' instructions that Apple provides when you install the Game Porting Toolkit package on Apple's developer website. I ran $ brew -v install apple/apple/game-porting-toolkit, which downloaded for around 20 minutes before it reached:
==> Pouring pkg-config--0.29.2_3.sonoma.bottle.tar.gz
ln -s ../Cellar/pkg-config/0.29.2_3/bin/pkg-config pkg-config
ln -s ../../Cellar/pkg-config/0.29.2_3/share/aclocal/pkg.m4 pkg.m4
ln -s ../../Cellar/pkg-config/0.29.2_3/share/doc/pkg-config pkg-config
ln -s ../../../Cellar/pkg-config/0.29.2_3/share/man/man1/pkg-config.1 pkg-config.1
Error: No such file or directory @ rb_sysopen - /Users/anna/Library/Caches/Homebrew/downloads/c5b6da58fb5d679eeb1765833596e7394625255fb46b165955fc4c4de746080e--pkg-config--0.29.2_3.sonoma.bottle.tar.gz
I am completely stumped as to what to do in this case. I've tried uninstalling and reinstalling homebrew, trying to install GPTK on a fresh user on my mac, and running brew cleanup and trying to GPTK install again. I would really appreciate any help or suggestions for me to fix this!
This is the output of brew doctor:
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libtlImageIO.dylib
/usr/local/lib/libtliadjust50.dylib
/usr/local/lib/libtliclean30.dylib
/usr/local/lib/libtlidejpeg40.dylib
/usr/local/lib/libtlieffecta11.dylib
/usr/local/lib/libtlieffecta12.dylib
/usr/local/lib/libtliinfocus10.dylib
/usr/local/lib/libtlistar10.dylib
And this is the output of brew config
HOMEBREW_VERSION: 4.1.20
ORIGIN: https://github.com/Homebrew/brew
HEAD: d3d51d3448966b5250b5c60110c945040054803d
Last commit: 8 days ago
Core tap JSON: 19 Nov 22:15 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.6zCg6FefHr/org.macosforge.xquartz:0
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit westmere
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 14.1.1-x86_64
CLT: 15.1.0.0.1.1699597245
Xcode: 15.1 => /Applications/Xcode-beta.app/Contents/Developer
Rosetta 2: true
I'm trying to use MTLIO Resource Loading in XCode 15.1 b3, but MTLIOCommandQueue, Buffer, etc, come up as undefined types. The Apple sample MetalFastResourceLoading seems to work. But creating a new project from template doesn't recognize the symbols. Anyone see similar?
Digging in, it seems the MTLIOCommandQueue.h file in Simulator 17.2 only contains
#import <Metal/MTLDefines.h>
#import <Metal/MTLDevice.h>
Whereas the working sample that links to 14.x contains lots of code. Also, the iOS 17.2 Framework ALSO contains headers with code. However, building for device also comes up with undefined symbols.
In addition, the documentation for the type
https://developer.apple.com/documentation/metal/mtliocommandqueue
lists support for iOS 16+, Vision Beta, etc. Does anyone know if earlier betas work?
a circle can be exactly represented as a rational quadratic b-spline curve.
in the curve raytracing example a simd_float3 type was used for control points.
a rational curve, however, requires an additional homogenious control point coordinate w.
is this supported?
the math is straightforward an it would open great opportunities to efficiently render solid primitives like torus and tube.
[AGXA11Device originalObject]: unrecognized selector sent to instance 0x116858c00
Metal `_MTLCreateGLMetalDevice + 76
Any friends konw?
Kacey gave a great discussion of USD Fundamentals using a Chess Set as an example. Is there a link to the complete set of usda files used in the example?
tag: [wwdc2022-10129]