New threads API index different then context after an eglMakeCurrent.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mesa (Ubuntu) |
New
|
Undecided
|
Chris Halse Rogers |
Bug Description
Say you have 2 threads A/B.
Thread A:
Starts running application, does an eglBindAPI(OPENGL), so the threads API index is 2
eglMakeCurrent(
<renders stuff>
<start to swtich over to thread B>
eglMakeCurrent(
Thread B:
New thread created. Defaults the API index to OPENGL_ES. So the threads API index is 0.
eglcurrent.c:149: t->CurrentAPIIndex = _eglConvertApiT
eglMakeCurrent(
--The Problem--
When it gets down to _eglBindContext
On the next eglSwapBuffers, it does an _eglGetCurrentC
_eglBindContext
apiIndex = (ctx) ?
_
To get the api index.
_eglGetCurrentC
return t->CurrentConte
So possibly, when a context is bound to a thread it should check if the threads api index != context api index, if so then set the threads api index to the contexts api index.
Changed in mesa (Ubuntu): | |
assignee: | nobody → Chris Halse Rogers (raof) |
So, reading the spec (specifically, section 3.7), I believe the current mesa behaviour is wrong and you should be perfectly able to eglMakeCurrent( context) . Indeed, it looks like you should even be able to call SwapBuffers on thread 2 even without making a context current there.
However, I don't think the proposed solution is correct, either; as I read the spec we actually need the the context (and surface) to have a reference to their own API index, separate to the thread's API index - you can have multiple contexts of different APIs active on a same thread.
To the mesa devel lists!