diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-05-22 10:51:55 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-05-22 10:51:55 +0200 |
commit | e6a7198e7cd96f1fe0654cc6811a977821579258 (patch) | |
tree | 1115052c835ff617235d5c89140e5cd95e1c7879 /GL | |
parent | 6324bfc468f7a645d2fee59f1c921a4328a4639f (diff) |
Bug #8991: Add glXGetDrawableAttributes dispatch; fix texture format therein.
Adapted to master branch by Michel Dänzer <michel@tungstengraphics.com>.
Diffstat (limited to 'GL')
-rw-r--r-- | GL/glx/glxcmds.c | 12 | ||||
-rw-r--r-- | GL/glx/indirect_dispatch.h | 14 | ||||
-rw-r--r-- | GL/glx/indirect_table.c | 19 |
3 files changed, 30 insertions, 15 deletions
diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c index 932878f69..ed5c138b4 100644 --- a/GL/glx/glxcmds.c +++ b/GL/glx/glxcmds.c @@ -1679,6 +1679,7 @@ DoGetDrawableAttributes(__GLXclientState *cl, XID drawId) xGLXGetDrawableAttributesReply reply; CARD32 attributes[4]; int numAttribs; + PixmapPtr pixmap; glxPixmap = (__GLXpixmap *)LookupIDByType(drawId, __glXPixmapRes); if (!glxPixmap) { @@ -1693,10 +1694,19 @@ DoGetDrawableAttributes(__GLXclientState *cl, XID drawId) reply.numAttribs = numAttribs; attributes[0] = GLX_TEXTURE_TARGET_EXT; - attributes[1] = GLX_TEXTURE_RECTANGLE_EXT; attributes[2] = GLX_Y_INVERTED_EXT; attributes[3] = GL_FALSE; + /* XXX this is merely less wrong, see fdo bug #8991 */ + pixmap = (PixmapPtr) glxPixmap->pDraw; + if ((pixmap->drawable.width & (pixmap->drawable.width - 1)) || + (pixmap->drawable.height & (pixmap->drawable.height - 1)) + /* || strstr(CALL_GetString(GL_EXTENSIONS, + "GL_ARB_texture_non_power_of_two")) */) + attributes[1] = GLX_TEXTURE_RECTANGLE_EXT; + else + attributes[1] = GLX_TEXTURE_2D_EXT; + if (client->swapped) { __glXSwapGetDrawableAttributesReply(client, &reply, attributes); } else { diff --git a/GL/glx/indirect_dispatch.h b/GL/glx/indirect_dispatch.h index 17a372f91..24f4bed43 100644 --- a/GL/glx/indirect_dispatch.h +++ b/GL/glx/indirect_dispatch.h @@ -211,8 +211,6 @@ extern HIDDEN int __glXDisp_ReadPixels(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_ReadPixels(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN void __glXDisp_EdgeFlagv(GLbyte * pc); extern HIDDEN void __glXDispSwap_EdgeFlagv(GLbyte * pc); -extern HIDDEN void __glXDisp_Rotatef(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Rotatef(GLbyte * pc); extern HIDDEN void __glXDisp_TexParameterf(GLbyte * pc); extern HIDDEN void __glXDispSwap_TexParameterf(GLbyte * pc); extern HIDDEN void __glXDisp_TexParameteri(GLbyte * pc); @@ -519,6 +517,8 @@ extern HIDDEN void __glXDisp_SecondaryColor3ivEXT(GLbyte * pc); extern HIDDEN void __glXDispSwap_SecondaryColor3ivEXT(GLbyte * pc); extern HIDDEN void __glXDisp_TexCoord4iv(GLbyte * pc); extern HIDDEN void __glXDispSwap_TexCoord4iv(GLbyte * pc); +extern HIDDEN int __glXDisp_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN int __glXDispSwap_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN void __glXDisp_SampleMaskSGIS(GLbyte * pc); extern HIDDEN void __glXDispSwap_SampleMaskSGIS(GLbyte * pc); extern HIDDEN void __glXDisp_ColorTableParameteriv(GLbyte * pc); @@ -849,10 +849,8 @@ extern HIDDEN int __glXDisp_GetHistogramParameteriv(struct __GLXclientStateRec * extern HIDDEN int __glXDispSwap_GetHistogramParameteriv(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDisp_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN void __glXDisp_Rotatef(GLbyte * pc); +extern HIDDEN void __glXDispSwap_Rotatef(GLbyte * pc); extern HIDDEN int __glXDisp_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN void __glXDisp_BlendFuncSeparateEXT(GLbyte * pc); @@ -877,6 +875,10 @@ extern HIDDEN void __glXDisp_Map2f(GLbyte * pc); extern HIDDEN void __glXDispSwap_Map2f(GLbyte * pc); extern HIDDEN void __glXDisp_ProgramStringARB(GLbyte * pc); extern HIDDEN void __glXDispSwap_ProgramStringARB(GLbyte * pc); +extern HIDDEN int __glXDisp_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN int __glXDispSwap_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN int __glXDisp_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN int __glXDispSwap_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDisp_GetTexGenfv(struct __GLXclientStateRec *, GLbyte *); diff --git a/GL/glx/indirect_table.c b/GL/glx/indirect_table.c index 60d676064..9d0383c83 100644 --- a/GL/glx/indirect_table.c +++ b/GL/glx/indirect_table.c @@ -1231,8 +1231,8 @@ const struct __glXDispatchInfo Render_dispatch_info = { }; /*****************************************************************/ -/* tree depth = 13 */ -static const int_fast16_t VendorPriv_dispatch_tree[155] = { +/* tree depth = 12 */ +static const int_fast16_t VendorPriv_dispatch_tree[152] = { /* [0] -> opcode range [0, 131072], node depth 1 */ 2, 5, @@ -1474,17 +1474,12 @@ static const int_fast16_t VendorPriv_dispatch_tree[155] = { /* [149] -> opcode range [65536, 65568], node depth 12 */ 1, - 152, - EMPTY_LEAF, - - /* [152] -> opcode range [65536, 65552], node depth 13 */ - 1, LEAF(88), EMPTY_LEAF, }; -static const void *VendorPriv_function_table[96][2] = { +static const void *VendorPriv_function_table[104][2] = { /* [ 0] = 0 */ {NULL, NULL}, /* [ 1] = 1 */ {__glXDisp_GetConvolutionFilterEXT, __glXDispSwap_GetConvolutionFilterEXT}, /* [ 2] = 2 */ {__glXDisp_GetConvolutionParameterfvEXT, __glXDispSwap_GetConvolutionParameterfvEXT}, @@ -1581,6 +1576,14 @@ static const void *VendorPriv_function_table[96][2] = { /* [ 93] = 65541 */ {__glXDisp_CreateContextWithConfigSGIX, __glXDispSwap_CreateContextWithConfigSGIX}, /* [ 94] = 65542 */ {__glXDisp_CreateGLXPixmapWithConfigSGIX, __glXDispSwap_CreateGLXPixmapWithConfigSGIX}, /* [ 95] = 65543 */ {NULL, NULL}, + /* [ 96] = 65544 */ {NULL, NULL}, + /* [ 97] = 65545 */ {NULL, NULL}, + /* [ 98] = 65546 */ {__glXDisp_GetDrawableAttributesSGIX, __glXDispSwap_GetDrawableAttributesSGIX}, + /* [ 99] = 65547 */ {NULL, NULL}, + /* [ 100] = 65548 */ {NULL, NULL}, + /* [ 101] = 65549 */ {NULL, NULL}, + /* [ 102] = 65550 */ {NULL, NULL}, + /* [ 103] = 65551 */ {NULL, NULL}, }; const struct __glXDispatchInfo VendorPriv_dispatch_info = { |