SceneKit material corruption without glFlush()

Originator:me
Number:rdar://12262327 Date Originated:09-Sep-2012 12:15 AM
Status:Open Resolved:
Product:Mac OS X Product Version:10.8.2 (12C31a)
Classification:Crash/Hang/Data Loss Reproducible:Always (almost)
 
09-Sep-2012 12:15 AM Jonathon Mah:
To increase performance in our app that uses SceneKit, we have an SCNRenderer with an OpenGL context shared with the main SCNView's context. This renderer allows us to asynchronously (but not without blocking, Radar 12226081) do the first render of a material, which can generate mipmaps and other expensive things.

After calling -[SCNRenderer render], without manually calling glFlush() the material can be corrupted when later used in the main SCNView. See attached screen recording. The source code for that app is available here: https://github.com/jmah/SceneKitPreloadTest

The corruption is more evident when using the Intel HD Graphics 4000 GPU. Incorrect drawing is also visible when using Nvidia GeForce GT 650M, but usually appears as black rather than random junk.

I've marked this as Crash/Hang/Data Loss because in addition to the graphical corruption, there appeared to be multiple crashes and hangs in the Intel driver. A hang log and kernel panic log are also attached.


09-Sep-2012 12:15 AM Jonathon Mah:
'Material Corruption.mov' and 'Retronym MacBookPro10,1 2012-09-08.spx.zip' were successfully uploaded

09-Sep-2012 12:16 AM Jonathon Mah:
'Kernel_2012-09-08-212130_Retronym.panic' was successfully uploaded

09-Sep-2012 12:16 AM Jonathon Mah:
'Hang log.txt' was successfully uploaded

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!