problem with glMapBufferRange on OSX

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
bayoubengal
Halfling
Posts: 48
Joined: Wed Sep 05, 2018 3:18 pm

problem with glMapBufferRange on OSX

Post by bayoubengal » Wed Mar 27, 2019 3:00 pm

hi.

I'm continuing my adventures with Ogre 2.1 in an OSX desktop app. I have the metal side working with multiple windows. However, the Opengl side fails. The function:

GL3PlusDynamicBuffer::map( size_t start, size_t count,
size_t &outTicket )

fails because glMapBufferRange( GL_COPY_WRITE_BUFFER, 33554432, 50) fails when render cycle starts to operate on the 2nd graphics context. the gl error code is GL_INVALID_OPERATION. I've checked that none of the conditions for that error listed in the documentation are true. From what I can tell, it appears that the memory mapping works fine and correctly until it starts to operate on the 2nd context. I'm at a dead end. Every theory I have concocted to explain why it is failing has failed. Its not a threading issue. the problem occurs even if all opengl activity is confined to the main thread. The current NS and CGL contexts are set correctly at each stage. I see no abuse of the ABI.

Any ideas on what could be going wrong?
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4066
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 228
Contact:

Re: problem with glMapBufferRange on OSX

Post by dark_sylinc » Wed Mar 27, 2019 4:42 pm

Are you using 2 contexts or the same context associated with multiple windows?

Because the former is not supported: although the contexts could be set to share resources (which at driver level is already a buggy mess that never works as documented), Vaos and FBOs are not shared between the contexts, causing lots of invalid operation errors.
0 x

bayoubengal
Halfling
Posts: 48
Joined: Wed Sep 05, 2018 3:18 pm

Re: problem with glMapBufferRange on OSX

Post by bayoubengal » Wed Mar 27, 2019 5:44 pm

2 independent contexts along with 2 scene managers and 2 workspaces. the two are entirely independent. configured identically, but independent.
0 x

bayoubengal
Halfling
Posts: 48
Joined: Wed Sep 05, 2018 3:18 pm

Re: problem with glMapBufferRange on OSX

Post by bayoubengal » Wed Mar 27, 2019 6:14 pm

Based on your statement, I got it working by creating independent materials for each window. thanks.
0 x

Post Reply