diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-05-22 10:51:53 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-05-22 10:51:53 +0200 |
commit | 6324bfc468f7a645d2fee59f1c921a4328a4639f (patch) | |
tree | 4af1f10313cddc14b68de9e4cc530dbb86191b98 /GL/glx/glxext.c | |
parent | 5006d08d7fc56d3d380cc6b75297f94e8594eb54 (diff) |
AIGLX: Zero-copy texture-from-pixmap.
When available, use the 2D driver texOffsetStart hook and the 3D driver
setTexOffset hook to save the overhead of passing the pixmap data to
glTex(Sub)Image.
The basic idea is to update the driver specific 'offset' for bound pixmaps
before dispatching a GLX render request and to flush immediately afterwards
if there are any pixmaps bound. This should ensure that the 3D driver can
use pixmaps for texturing directly regardless of the X server moving them
around.
Diffstat (limited to 'GL/glx/glxext.c')
-rw-r--r-- | GL/glx/glxext.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/GL/glx/glxext.c b/GL/glx/glxext.c index ca874e33b..c09120c12 100644 --- a/GL/glx/glxext.c +++ b/GL/glx/glxext.c @@ -238,9 +238,9 @@ GLboolean __glXFreeContext(__GLXcontext *cx) * the latter case we need to lift the DRI lock manually. */ if (!glxBlockClients) { - __glXleaveServer(); + __glXleaveServer(GL_FALSE); cx->destroy(cx); - __glXenterServer(); + __glXenterServer(GL_FALSE); } else { cx->next = glxPendingDestroyContexts; glxPendingDestroyContexts = cx; @@ -439,49 +439,49 @@ void glxResumeClients(void) AttendClient(__glXClients[i]->client); } - __glXleaveServer(); + __glXleaveServer(GL_FALSE); for (cx = glxPendingDestroyContexts; cx != NULL; cx = next) { next = cx->next; cx->destroy(cx); } glxPendingDestroyContexts = NULL; - __glXenterServer(); + __glXenterServer(GL_FALSE); } static void -__glXnopEnterServer(void) +__glXnopEnterServer(GLboolean rendering) { } static void -__glXnopLeaveServer(void) +__glXnopLeaveServer(GLboolean rendering) { } -static void (*__glXenterServerFunc)(void) = __glXnopEnterServer; -static void (*__glXleaveServerFunc)(void) = __glXnopLeaveServer; +static void (*__glXenterServerFunc)(GLboolean) = __glXnopEnterServer; +static void (*__glXleaveServerFunc)(GLboolean) = __glXnopLeaveServer; -void __glXsetEnterLeaveServerFuncs(void (*enter)(void), - void (*leave)(void)) +void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean), + void (*leave)(GLboolean)) { __glXenterServerFunc = enter; __glXleaveServerFunc = leave; } -void __glXenterServer(void) +void __glXenterServer(GLboolean rendering) { glxServerLeaveCount--; if (glxServerLeaveCount == 0) - (*__glXenterServerFunc)(); + (*__glXenterServerFunc)(rendering); } -void __glXleaveServer(void) +void __glXleaveServer(GLboolean rendering) { if (glxServerLeaveCount == 0) - (*__glXleaveServerFunc)(); + (*__glXleaveServerFunc)(rendering); glxServerLeaveCount++; } @@ -546,11 +546,12 @@ static int __glXDispatch(ClientPtr client) opcode, client->swapped); if (proc != NULL) { - __glXleaveServer(); + GLboolean rendering = opcode <= X_GLXRenderLarge; + __glXleaveServer(rendering); retval = (*proc)(cl, (GLbyte *) stuff); - __glXenterServer(); + __glXenterServer(rendering); } else { retval = BadRequest; |