summaryrefslogtreecommitdiff
path: root/GL/glx/glxdri.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-08-01 18:13:18 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-08-01 18:13:18 +0200
commit17cb4f64e3c39725e83b1e311c09422d7e1c0e52 (patch)
treeb9d585423568e73ff9bc6f921ff73c610ddf1231 /GL/glx/glxdri.c
parenta4197db9504adae6af005b2218eee36b8af0d98b (diff)
GLX_EXT_texture_from_pixmap: Use client provided texture target when available.
This prevents situations where the server doesn't use the target the client thinks it does, usually resulting in the texture being sampled as all white.
Diffstat (limited to 'GL/glx/glxdri.c')
-rw-r--r--GL/glx/glxdri.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index db564c098..051784ca0 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -375,7 +375,7 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
RegionPtr pRegion = NULL;
PixmapPtr pixmap;
int w, h, bpp, override = 0;
- GLenum target, format, type;
+ GLenum format, type;
ScreenPtr pScreen = glxPixmap->pScreen;
__GLXDRIscreen * const screen =
(__GLXDRIscreen *) __glXgetActiveScreen(pScreen->myNum);
@@ -384,11 +384,6 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
w = pixmap->drawable.width;
h = pixmap->drawable.height;
- if (h & (h - 1) || w & (w - 1))
- target = GL_TEXTURE_RECTANGLE_ARB;
- else
- target = GL_TEXTURE_2D;
-
if (screen->texOffsetStart && screen->driScreen.setTexOffset) {
__GLXpixmap **texOffsetOverride = screen->texOffsetOverride;
int i, firstEmpty = 16, texname;
@@ -416,7 +411,7 @@ alreadyin:
glxPixmap->pDRICtx = &((__GLXDRIcontext*)baseContext)->driContext;
- CALL_GetIntegerv(GET_DISPATCH(), (target == GL_TEXTURE_2D ?
+ CALL_GetIntegerv(GET_DISPATCH(), (glxPixmap->target == GL_TEXTURE_2D ?
GL_TEXTURE_BINDING_2D :
GL_TEXTURE_BINDING_RECTANGLE_NV,
&texname));
@@ -481,7 +476,7 @@ nooverride:
pixmap->drawable.y) );
CALL_TexImage2D( GET_DISPATCH(),
- (target,
+ (glxPixmap->target,
0,
bpp == 4 ? 4 : 3,
pixmap->drawable.width,
@@ -511,7 +506,7 @@ nooverride:
pixmap->drawable.y + p[i].y1) );
CALL_TexSubImage2D( GET_DISPATCH(),
- (target,
+ (glxPixmap->target,
0,
p[i].x1, p[i].y1,
p[i].x2 - p[i].x1, p[i].y2 - p[i].y1,