glx: Compute number of attributes in GetDrawableAttributes on the fly
This doesn't have any effect yet, but is needed to properly build the reply for pbuffers. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
468b57324f
commit
d11f13e383
|
@ -1893,13 +1893,23 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
|
||||||
xGLXGetDrawableAttributesReply reply;
|
xGLXGetDrawableAttributesReply reply;
|
||||||
__GLXdrawable *pGlxDraw;
|
__GLXdrawable *pGlxDraw;
|
||||||
CARD32 attributes[6];
|
CARD32 attributes[6];
|
||||||
int numAttribs, error;
|
int numAttribs = 0, error;
|
||||||
|
|
||||||
if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
|
if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
|
||||||
DixGetAttrAccess, &pGlxDraw, &error))
|
DixGetAttrAccess, &pGlxDraw, &error))
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
numAttribs = 3;
|
attributes[0] = GLX_TEXTURE_TARGET_EXT;
|
||||||
|
attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT :
|
||||||
|
GLX_TEXTURE_RECTANGLE_EXT;
|
||||||
|
numAttribs++;
|
||||||
|
attributes[2] = GLX_Y_INVERTED_EXT;
|
||||||
|
attributes[3] = GL_FALSE;
|
||||||
|
numAttribs++;
|
||||||
|
attributes[4] = GLX_EVENT_MASK;
|
||||||
|
attributes[5] = pGlxDraw->eventMask;
|
||||||
|
numAttribs++;
|
||||||
|
|
||||||
reply = (xGLXGetDrawableAttributesReply) {
|
reply = (xGLXGetDrawableAttributesReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -1907,14 +1917,6 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
|
||||||
.numAttribs = numAttribs
|
.numAttribs = numAttribs
|
||||||
};
|
};
|
||||||
|
|
||||||
attributes[0] = GLX_TEXTURE_TARGET_EXT;
|
|
||||||
attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT :
|
|
||||||
GLX_TEXTURE_RECTANGLE_EXT;
|
|
||||||
attributes[2] = GLX_Y_INVERTED_EXT;
|
|
||||||
attributes[3] = GL_FALSE;
|
|
||||||
attributes[4] = GLX_EVENT_MASK;
|
|
||||||
attributes[5] = pGlxDraw->eventMask;
|
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
__glXSwapGetDrawableAttributesReply(client, &reply, attributes);
|
__glXSwapGetDrawableAttributesReply(client, &reply, attributes);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue