Post

Replies

Boosts

Views

Activity

MTLDebugCommandBuffer lockPurgeableObjects
I'm using Xcode 13 after recently updating to MacOS Monterey, and only after updating am I getting this error: [MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion `MTLResource 0x14a8a8cc0 (label: null), referenced in cmd buffer 0x149091400 (label: null) is in volatile or empty purgeable state at commit' I haven't changed my code at all between updating to the latest OS, and it worked perfectly before. How can I fix this? I don't think there should be any reason that I can't use a command buffer on a texture resource with a volatile/empty purgeable state.
4
0
3.3k
Jan ’22
How to parse ascii characters in Swift?
I have a string encoded as ascii characters that contains letters and numbers. When I print out the string it looks like the numbers are not showing up properly. The string is being read from a data object where I convert everything to an Int8 type and construct a Character from that: for i in 0..<dataLength { let byte: Int8 = readByte() let char = Character(unicodeScalarLiteral: .init(.init(byte))) print("Character: ", char, char.asciiValue) } Example.) "40" appears as "@D". I was able to print out the ascii codes of these and found it to be [64, 68], but I'm not sure how to now convert it to the number 40.
4
0
2.1k
Feb ’22