summaryrefslogtreecommitdiff
path: root/GL
diff options
context:
space:
mode:
authorAdam Jackson <ajax@benzedrine.nwnk.net>2007-01-22 22:12:27 -0500
committerAdam Jackson <ajax@benzedrine.nwnk.net>2007-01-22 22:12:27 -0500
commitc919f880d757cc6ec8be1a96f42400d810db52ee (patch)
treebe36b01e68df2bc061d535ed923755510bf42977 /GL
parentfd838c02be3b3755efb872fd05a51fce99c46ae3 (diff)
Bug #8991: Add glXGetDrawableAttributes dispatch; fix texture format therein.
Diffstat (limited to 'GL')
-rw-r--r--GL/glx/glxcmds.c25
-rw-r--r--GL/glx/glxdri.c13
-rw-r--r--GL/glx/glxutil.h2
-rw-r--r--GL/glx/indirect_dispatch.h34
-rw-r--r--GL/glx/indirect_dispatch_swap.c2
-rw-r--r--GL/glx/indirect_table.c29
6 files changed, 61 insertions, 44 deletions
diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
index ccdf3fa00..1585b36bb 100644
--- a/GL/glx/glxcmds.c
+++ b/GL/glx/glxcmds.c
@@ -59,6 +59,19 @@
#include "indirect_table.h"
#include "indirect_util.h"
+_X_HIDDEN int
+glxCountBits(int word)
+{
+ int ret = 0;
+
+ while (word) {
+ ret += (word & 1);
+ word >>= 1;
+ }
+
+ return ret;
+}
+
/************************************************************************/
void
@@ -1660,6 +1673,7 @@ DoGetDrawableAttributes(__GLXclientState *cl, XID drawId)
xGLXGetDrawableAttributesReply reply;
CARD32 attributes[4];
int numAttribs;
+ PixmapPtr pixmap;
glxPixmap = (__GLXpixmap *)LookupIDByType(drawId, __glXPixmapRes);
if (!glxPixmap) {
@@ -1674,10 +1688,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 (!(glxCountBits(pixmap->drawable.width) == 1 &&
+ glxCountBits(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/glxdri.c b/GL/glx/glxdri.c
index e03570468..36464a6e9 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -289,19 +289,6 @@ __glXDRIcontextForceCurrent(__GLXcontext *baseContext)
&context->driContext);
}
-static int
-glxCountBits(int word)
-{
- int ret = 0;
-
- while (word) {
- ret += (word & 1);
- word >>= 1;
- }
-
- return ret;
-}
-
static void
glxFillAlphaChannel (PixmapPtr pixmap, int x, int y, int width, int height)
{
diff --git a/GL/glx/glxutil.h b/GL/glx/glxutil.h
index 1937ef2cf..6cdb5c816 100644
--- a/GL/glx/glxutil.h
+++ b/GL/glx/glxutil.h
@@ -60,4 +60,6 @@ extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);
extern void *__glXglDDXScreenInfo(void);
extern void *__glXglDDXExtensionInfo(void);
+extern int glxCountBits(int);
+
#endif /* _glxcmds_h_ */
diff --git a/GL/glx/indirect_dispatch.h b/GL/glx/indirect_dispatch.h
index 9bf74ebd1..78e5e6938 100644
--- a/GL/glx/indirect_dispatch.h
+++ b/GL/glx/indirect_dispatch.h
@@ -85,8 +85,6 @@ extern HIDDEN void __glXDisp_EvalCoord2fv(GLbyte * pc);
extern HIDDEN void __glXDispSwap_EvalCoord2fv(GLbyte * pc);
extern HIDDEN int __glXDisp_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN int __glXDispSwap_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *);
-extern HIDDEN void __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc);
-extern HIDDEN void __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc);
extern HIDDEN int __glXDisp_GetMapiv(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN int __glXDispSwap_GetMapiv(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN int __glXDisp_SwapBuffers(struct __GLXclientStateRec *, GLbyte *);
@@ -123,6 +121,8 @@ extern HIDDEN int __glXDisp_VendorPrivate(struct __GLXclientStateRec *, GLbyte *
extern HIDDEN int __glXDispSwap_VendorPrivate(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN int __glXDisp_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib1fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc);
extern HIDDEN void __glXDisp_Vertex3iv(GLbyte * pc);
extern HIDDEN void __glXDispSwap_Vertex3iv(GLbyte * pc);
extern HIDDEN void __glXDisp_CopyConvolutionFilter1D(GLbyte * pc);
@@ -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);
@@ -279,6 +277,8 @@ extern HIDDEN void __glXDisp_ClearStencil(GLbyte * pc);
extern HIDDEN void __glXDispSwap_ClearStencil(GLbyte * pc);
extern HIDDEN void __glXDisp_VertexAttrib3dvARB(GLbyte * pc);
extern HIDDEN void __glXDispSwap_VertexAttrib3dvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc);
extern HIDDEN void __glXDisp_ConvolutionParameteriv(GLbyte * pc);
extern HIDDEN void __glXDispSwap_ConvolutionParameteriv(GLbyte * pc);
extern HIDDEN void __glXDisp_RasterPos2fv(GLbyte * pc);
@@ -327,6 +327,8 @@ extern HIDDEN int __glXDisp_GetVertexAttribdvNV(struct __GLXclientStateRec *, GL
extern HIDDEN int __glXDispSwap_GetVertexAttribdvNV(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN void __glXDisp_Normal3fv(GLbyte * pc);
extern HIDDEN void __glXDispSwap_Normal3fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc);
extern HIDDEN void __glXDisp_VertexAttrib4ivARB(GLbyte * pc);
extern HIDDEN void __glXDispSwap_VertexAttrib4ivARB(GLbyte * pc);
extern HIDDEN void __glXDisp_End(GLbyte * pc);
@@ -377,6 +379,8 @@ extern HIDDEN void __glXDisp_DepthMask(GLbyte * pc);
extern HIDDEN void __glXDispSwap_DepthMask(GLbyte * pc);
extern HIDDEN void __glXDisp_Rotated(GLbyte * pc);
extern HIDDEN void __glXDispSwap_Rotated(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color4iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color4iv(GLbyte * pc);
extern HIDDEN int __glXDisp_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN int __glXDispSwap_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN void __glXDisp_StencilOp(GLbyte * pc);
@@ -457,8 +461,6 @@ extern HIDDEN void __glXDisp_BindFramebufferEXT(GLbyte * pc);
extern HIDDEN void __glXDispSwap_BindFramebufferEXT(GLbyte * pc);
extern HIDDEN void __glXDisp_PushAttrib(GLbyte * pc);
extern HIDDEN void __glXDispSwap_PushAttrib(GLbyte * pc);
-extern HIDDEN void __glXDisp_VertexAttrib4usvARB(GLbyte * pc);
-extern HIDDEN void __glXDispSwap_VertexAttrib4usvARB(GLbyte * pc);
extern HIDDEN int __glXDisp_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN int __glXDispSwap_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN void __glXDisp_TexParameteriv(GLbyte * pc);
@@ -517,6 +519,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);
@@ -615,8 +619,8 @@ extern HIDDEN void __glXDisp_PrioritizeTextures(GLbyte * pc);
extern HIDDEN void __glXDispSwap_PrioritizeTextures(GLbyte * pc);
extern HIDDEN int __glXDisp_PixelStorei(struct __GLXclientStateRec *, GLbyte *);
extern HIDDEN int __glXDispSwap_PixelStorei(struct __GLXclientStateRec *, GLbyte *);
-extern HIDDEN void __glXDisp_Color4iv(GLbyte * pc);
-extern HIDDEN void __glXDispSwap_Color4iv(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4usvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4usvARB(GLbyte * pc);
extern HIDDEN void __glXDisp_EvalCoord2dv(GLbyte * pc);
extern HIDDEN void __glXDispSwap_EvalCoord2dv(GLbyte * pc);
extern HIDDEN void __glXDisp_VertexAttrib3svARB(GLbyte * pc);
@@ -783,8 +787,6 @@ extern HIDDEN void __glXDisp_VertexAttribs2fvNV(GLbyte * pc);
extern HIDDEN void __glXDispSwap_VertexAttribs2fvNV(GLbyte * pc);
extern HIDDEN void __glXDisp_Rectiv(GLbyte * pc);
extern HIDDEN void __glXDispSwap_Rectiv(GLbyte * pc);
-extern HIDDEN void __glXDisp_VertexAttrib1fvNV(GLbyte * pc);
-extern HIDDEN void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc);
extern HIDDEN void __glXDisp_SecondaryColor3dvEXT(GLbyte * pc);
extern HIDDEN void __glXDispSwap_SecondaryColor3dvEXT(GLbyte * pc);
extern HIDDEN void __glXDisp_Vertex2fv(GLbyte * pc);
@@ -847,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);
@@ -875,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 *);
@@ -919,8 +923,6 @@ extern HIDDEN void __glXDisp_DrawBuffersARB(GLbyte * pc);
extern HIDDEN void __glXDispSwap_DrawBuffersARB(GLbyte * pc);
extern HIDDEN void __glXDisp_LoadName(GLbyte * pc);
extern HIDDEN void __glXDispSwap_LoadName(GLbyte * pc);
-extern HIDDEN void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc);
-extern HIDDEN void __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc);
extern HIDDEN void __glXDisp_CopyTexSubImage1D(GLbyte * pc);
extern HIDDEN void __glXDispSwap_CopyTexSubImage1D(GLbyte * pc);
extern HIDDEN void __glXDisp_CullFace(GLbyte * pc);
diff --git a/GL/glx/indirect_dispatch_swap.c b/GL/glx/indirect_dispatch_swap.c
index 136f0d010..9c58ef1cd 100644
--- a/GL/glx/indirect_dispatch_swap.c
+++ b/GL/glx/indirect_dispatch_swap.c
@@ -28,7 +28,7 @@
#include <X11/Xmd.h>
#include <GL/gl.h>
#include <GL/glxproto.h>
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
+#ifdef __linux__
#include <byteswap.h>
#elif defined(__OpenBSD__)
#include <sys/endian.h>
diff --git a/GL/glx/indirect_table.c b/GL/glx/indirect_table.c
index a6fd3a39a..9d0383c83 100644
--- a/GL/glx/indirect_table.c
+++ b/GL/glx/indirect_table.c
@@ -645,7 +645,7 @@ static const void *Render_function_table[400][2] = {
/* [ 302] = 4182 */ {__glXDisp_RequestResidentProgramsNV, __glXDispSwap_RequestResidentProgramsNV},
/* [ 303] = 4183 */ {__glXDisp_LoadProgramNV, __glXDispSwap_LoadProgramNV},
/* [ 304] = 4184 */ {__glXDisp_ProgramParameter4fvNV, __glXDispSwap_ProgramParameter4fvNV},
- /* [ 305] = 4185 */ {__glXDisp_ProgramParameter4dvNV, __glXDispSwap_ProgramParameter4dvNV},
+ /* [ 305] = 4185 */ {__glXDisp_ProgramEnvParameter4dvARB, __glXDispSwap_ProgramEnvParameter4dvARB},
/* [ 306] = 4186 */ {__glXDisp_ProgramParameters4fvNV, __glXDispSwap_ProgramParameters4fvNV},
/* [ 307] = 4187 */ {__glXDisp_ProgramParameters4dvNV, __glXDispSwap_ProgramParameters4dvNV},
/* [ 308] = 4188 */ {__glXDisp_TrackMatrixNV, __glXDispSwap_TrackMatrixNV},
@@ -886,10 +886,10 @@ static const int_fast16_t Render_size_table[400][2] = {
/* [140] = 140 */ { 0, ~0},
/* [141] = 141 */ { 4, ~0},
/* [142] = 142 */ { 8, ~0},
- /* [143] = 143 */ { 40, 20},
- /* [144] = 144 */ { 28, 21},
- /* [145] = 145 */ { 64, 22},
- /* [146] = 146 */ { 44, 23},
+ /* [143] = 143 */ { 28, 20},
+ /* [144] = 144 */ { 20, 21},
+ /* [145] = 145 */ { 48, 22},
+ /* [146] = 146 */ { 32, 23},
/* [147] = 147 */ { 24, ~0},
/* [148] = 148 */ { 16, ~0},
/* [149] = 149 */ { 44, ~0},
@@ -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 = {