We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3378

Summary: glBlitFramebuffer produces GL_INVALID_OPERATION after rotation on iOS when using MSAA
Product: SDL Reporter: Cole Campbell <cole.campbell>
Component: videoAssignee: Alex Szpakowski <amaranth72>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: amaranth72
Version: HG 2.1   
Hardware: iPhone/iPod touch   
OS: iOS (All)   
Attachments: Patch to fix the error in updateFrame()

Description Cole Campbell 2016-06-26 18:17:03 UTC
Created attachment 2518 [details]
Patch to fix the error in updateFrame()

Tested on an iPad Mini 2 running iOS 9.3.2

After rotating the device, the call to glBlitFramebuffer() inside of swapBuffers() in SDL_uikitopenglview produces a GL_INVALID_OPERATION error every time it is called.

This is because updateFrame() recreates the MSAA buffer as GL_RGBA8, regardless of whether this matches the attributes passed to SDL. When the buffers are supposed to be 16-bit, as they are by default, this produces a mismatch between the format of the MSAA buffer and the view buffer, giving rise to the error.

The attached patch changes this code to use the colorBufferFormat variable rather than hard-coding GL_RGBA8, as was clearly intended.
Comment 1 Alex Szpakowski 2016-07-02 16:39:10 UTC
Fixed in https://hg.libsdl.org/SDL/rev/a6ad6813b17b , thanks!