autoResizeDrawable strange behavior

Hi,

MacOS version: 12.2.1 Xcode version: 13.2.1

I'm using MTKView and setting a drawableSize = 1024,768 and autoResizeDrawable = NO, however, drawableSizeWillChange() is being called on app startup, just once, and never again, with a different drawableSize.

Maybe it has to do with incorrect drawable size?

Thanks

Hi wasintw, could it be that the app itself is calling drawableSizeWillChange at the start of the application? For example, our generated Metal example project in Xcode does this

Hi! I saw what you mention in this sample code [https://developer.apple.com/documentation/metal/basic_tasks_and_concepts/using_metal_to_draw_a_view_s_contents?language=objc]. If I do the same in my test app then I get two calls: the explicit one and after it, the one that comes directly from NSApplicationMain->[MTKView _resizeDrawable]. After this second call the behavior is the expected and no more calls to drawableSizeWillChange are received. My implementation doesn't have the explicit call and I always receive the call from NSApplicationMain->[MTKView _resizeDrawable] on startup.

I removed the explicit call in the sample code and it doesn't receive any call to drawableSizeWillChange when autoResizeDrawable = NO.

What is more annoying is that it doesn't happen always.

Unfortunately we have been unable to reproduce the issue thus far. If you have a sample project that consistently reproduces the issue for you, feel free to file a Feedback Assistant ticket with the following information:

macOS/iOS versions of the development device and target device (you mentioned it in the original post but it would help to replicate the information in the ticket).The Xcode version used.A sample project that reproduces the issue for you.

Once you have filed the ticket, please share the Feedback Assistant ID here and we will investigate the issue further.

autoResizeDrawable strange behavior
 
 
Q