Post not yet marked as solved
I've an app I've been working on for quite some time now. It uses SpriteKit. The windows with the scenes in them are generated programmatically. All of a sudden, when it's up and running through XCode, the console throws out a continuous stream of errors - probably in the order of 1 per second. The main one that makes up this stream is:
2022-03-07 20:07:38.765930+0000 My*App[8461:465673] [] CurrentVBLDelta returned 0 for display 1 -- ignoring unreasonable value
But others that appear slightly less frequently are:
2022-03-07 20:07:38.447800+0000 My*App[8461:465143] Metal GPU Frame Capture Enabled 2022-03-07 20:07:38.448070+0000 My*App[8461:465143] Metal API Validation Enabled 2022-03-07 20:07:38.613097+0000 My*App[8461:465640] [] [0x7f9596053820] CVCGDisplayLink::setCurrentDisplay: 1 2022-03-07 20:07:38.613415+0000 My*App[8461:465640] [] [0x7f9596053820] Bad CurrentVBLDelta for display 1 is zero. defaulting to 60Hz. 2022-03-07 20:07:38.613442+0000 My*App[8461:465640] [] [0x7f9596053800] CVDisplayLinkCreateWithCGDisplays count: 1 [displayID[0]: 0x1] [CVCGDisplayLink: 0x7f9596053820] 2022-03-07 20:07:38.613467+0000 My*App[8461:465640] [] [0x7f9596053800] CVDisplayLinkStart 2022-03-07 20:07:38.613487+0000 My*App[8461:465640] [] [0x7f9596053820] CVDisplayLink::start 2022-03-07 20:07:38.613541+0000 My*App[8461:465640] [] [0x7f9596053800] CVDisplayLinkStart 2022-03-07 20:07:38.613575+0000 My*App[8461:465640] [] [0x7f9596053820] CVDisplayLink::start 2022-03-07 20:07:38.613634+0000 My*App[8461:465671] [] [0x600000c09f10] CVXTime::reset 2022-03-07 20:07:38.613718+0000 My*App[8461:465671] [] CurrentVBLDelta returned 0 for display 1 -- ignoring unreasonable value 2022-03-07 20:07:38.639810+0000 My*App[8461:465671] [] CurrentVBLDelta returned 0 for display 1 -- ignoring unreasonable value 2022-03-07 20:07:38.639887+0000 My*App[8461:465671] [] [0x7f9596053820] CVCGDisplayLink::getDisplayTimes display: 1 -- SLSDisplayGetCurrentVBLDelta returned 0 => generating fake times 2022-03-07 20:07:38.673702+0000 My*App[8461:465653] [] [0x7f9596053820] CVCGDisplayLink::setCurrentDisplay: 1 2022-03-07 20:07:38.673748+0000 My*App[8461:465653] [] [0x7f9596053820] CVDisplayLink::stop 2022-03-07 20:07:38.673862+0000 My*App[8461:465653] [] [0x7f9596053820] Bad CurrentVBLDelta for display 1 is zero. defaulting to 60Hz. 2022-03-07 20:07:38.673883+0000 My*App[8461:465653] [] [0x7f9596053820] CVDisplayLink::start
I really don't know how else to describe this. I can only imagine having to hand over the entire project as lately I've only been working on the storyboard file so how would this affect it? To be honest the only change I can see is my upgrade to OSX 12.2.1. It's definitely something to do with SpriteKit since not initialising a window with a scene in it stops the errors from showing.
Hi,I've been usingIOReturn success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &assertionID);as detailed in this Tech Q & A to prevent the screen saver from activating in certain phases of my app. Unfortunately, since 10.11 this seems to have stopped working. There are no errors, no extra log lines generated, the app works absolutely fine and the only difference in it's operation - in El Capitan - is that the screen saver continues to show after the prerequisite amount of time.Does anyone know if there's been a change to the process of preventing this? I can't seem to find anything in docs...Todd.
Post not yet marked as solved
I appreciate this might not be possible to answer without seeing all of my code, but I'm a fair way into my project and publishing only the SceneKit stuff would be tricky as it involves extensions, various sub classes and such like. So, in the briefest manner I can:
I have a SCNScene with 2 SCNNodes. Each node has two filters applied (in this case CIGaussianBlur and CIPixellate but the issue doesn't seem to specifically apply to which filter is applied only *if* a filter is applied). With the nodes displayed correctly and not animating, if I resize the window that the scene is in I get strange re-drawing issues: the image gets drawn oddly until I release the mouse button and the draw cycle is completed. However, if I simply include these empty methodes in my subclassed SCNView:
	override func viewWillStartLiveResize() {
	}
	override func viewDidEndLiveResize() {
	}
The nodes are continually drawn correctly during a user's resize.
The entire subclass consists of:
class ImageSCNView: SCNView {
	private (set) var hasLoaded: Bool = false
	override var mouseDownCanMoveWindow: Bool {
		return true
	}
	override func viewDidMoveToWindow() {
		hasLoaded = true
	}
	override func viewWillStartLiveResize() {
	}
	override func viewDidEndLiveResize() {
	}
}
Is this in someway expected behaviour or am I lining up for a gotcha in the future? I'm assuming I've prevented the calls the the classes super so I wonder if that will be problematic in the long run...
Post not yet marked as solved
Hi,Using Xcode 11 in OSX 10.15, my OSX app is saving to the App Groups folder and when it does, I get this in Xcode's Console:VPA info: plugin is INTEL, AVD_id = 1080010, AVD_api.Create:0x123684b60Nothing else seems to happen and the file save goes ahead, but I'd just like to know if there's going to be trouble further down the line.Todd.
Post not yet marked as solved
I've a sandboxed app that I'd like to prevent screen sleep. I've seen this Q&A and used it's example code as well as thisStackOverflow question.Neither seem to work. I'm building for OSX 10.13+ in Swift, but using a bridging-header for the code.Does anyone know if there is newer methods or if the support for this has been dropped in later OSX'
Hi,I'm trying to set a background colour for my metal scene. I'm using:descriptor.colorAttachments[0].clearColor = MTLClearColorMake(Double(newColourComponenets.r), Double(newColourComponenets.g), Double(newColourComponenets.b), 1.0)Construction of a background colour using MTLClearColor(r:g:b:) gives the same outcome.When I setdescriptor.colorAttachments[0].loadAction = .loadthen the background colour is rendered, but changing it to .clear means I just get a black background.I note from here that there is a circumstance when the background colour is ignored, but due to poor writing, I can't fathom when that is. Does anyone know....?
Hi,I have continuing problems with my understanding of MVP matricies in 3D graphics (I know: I should probably give up! š but I'm far too stubborn).I'm upgrading one of my app's to run with Metal instead of OpenGL. I'd like to be able to draw a border around a viewport. My original code just used the lines in opengl but I've read in Stack Overflow that Metal doesn't directly support line drawing: a line has to be drawn with a primitive quad 'squeezed' to the desired width of a line.So that seems fine but my issue it keeping the 'line' in place while the MTKView is resized. I've got code all set up to account for resizing:func mtkView(_ view: MTKView, drawableSizeWillChange size: CGSize) {
metalViewPort.originX = 0
metalViewPort.originY = 0
metalViewPort.height = Double(size.height)
metalViewPort.width = Double(size.width)
viewPortAspect = Float(metalViewPort.width / metalViewPort.height)
rendererStatesAndDescriptors.projectionMatrix.changeAspectRatio(newAspect: viewPortAspect)
}But the placed line won't stay put on the edge of the screen as I resize the window. Should I draw the line with an orthogonal projection? Or is there a method of keeping the line on the edge of the view at all sizes?Thanks in advance,Todd.
Post not yet marked as solved
Hi, I've been studying Metal using the Apple docs and the wonderful RW tutorials.I've managed to get some primitives on screen just fine but the problem comes with depth testing.If I usefunc mtkView(_ view: MTKView, drawableSizeWillChange size: CGSize) {
metalViewPort.originX = 0
metalViewPort.originY = 0
metalViewPort.height = Double(size.height)
metalViewPort.width = Double(size.width)
}and during the draw loop://Setup code
commandEncoder.setViewport(aMetalView)
//draw stuffThe depth testing passes everything. Simply commenting out the setViewport on line 2 above makes it operate correctly and models obscure, move and rotate exactly as expected in 3D space.Before I post reams of poorly written code, can someone tell me if this is generally expected behaviour?
Hi,I've an old app that I'm trying to update. I've had the update rejected for only being targeted at iPhones (the review board said all apps need to be usable on an iPad even if only for use on an iPhone). On an iPad screen some elements sit over each other.I've been working to try and fix the UI for any size screen but to say IB in Xcode is buggy is an understatement. I thought I understood Stack Views but getting the them to work on my app seems nigh on impossible - it looks one way in Xcode and another on the simulator. So for now the app isn't functioning on later iOS'.I'm thinking that restricting the UI to portrait view will greatly ease the transition and I have seen app's that only work in portrait or only landscape.My question is: how did they get through submission? Is there a criteria for only supporting portrait or only supporting landscape? I've also had another app rejected for only working in one orientation.