[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Shared resources between contexts
On Fri, Jan 6, 2012 at 4:27 PM, Glenn Maynard <firstname.lastname@example.org> wrote:
That's not what you said. You said "multiple contexts for one
canvas". That doesn't mean they share the same OpenGL context, it
means they're completely separate OpenGL contexts that happen to
output to the same canvas. The canvas is just the drawing area on the
page; it's essentially the default framebuffer. I don't know why
you'd want to do that, but it's definitely not possible.
(Not that I really understand what you're saying now. Two contexts
are not "the same". If you have two contexts, then they have separate
state, such as whether GL_BLEND is enabled, regardless of whether
they're sharing resources or not.)
If you're going to split #3 into two separate questions then those questions are:
Q: #3.a "how do I get a synonmyous context?"
A: call canvas.getContext
Q: #3.b "how do I draw onto the same canvas with two contexts?"
A.1: OpenGL/DirectX have no notion of sharing frontbuffers therefore not possible directly
A.2: If answer #1 is implemented, context the second can do RTT and share this texture with context the first, which falls under the domain of resource sharing to which #1 is the qustion.
Therefore, #3 is either satisfied by other means, or not possible, and what's left is #1 and #2.