summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2005-03-10 22:45:30 +0000
committerDavid Reveman <davidr@novell.com>2005-03-10 22:45:30 +0000
commit1c0dc7af78b321a0800d0319dba2659c1178b2ee (patch)
tree16f1af4e9ada467647a3da3cd4d12d495db69359 /src
parent696e95e129f3a556e14c97489b6d657289205fe1 (diff)
Fix pixel offset issue and add temporary workaround for problem with NPOT textures
Diffstat (limited to 'src')
-rw-r--r--src/glitz_pixel.c5
-rw-r--r--src/glx/glitz_glx_context.c17
2 files changed, 20 insertions, 2 deletions
diff --git a/src/glitz_pixel.c b/src/glitz_pixel.c
index adae8b6..e211e1c 100644
--- a/src/glitz_pixel.c
+++ b/src/glitz_pixel.c
@@ -836,8 +836,9 @@ glitz_set_pixels (glitz_surface_t *dst,
}
pixels = ptr +
- ((format->skip_lines + box.y1 - y_dst) * bytes_per_line) +
- ((format->xoffset + box.x1 - x_dst) * bytes_per_pixel);
+ (format->skip_lines + y_dst + height - box.y2) *
+ bytes_per_line +
+ (format->xoffset + box.x1 - x_dst) * bytes_per_pixel;
}
gl->tex_sub_image_2d (texture->target, 0,
diff --git a/src/glx/glitz_glx_context.c b/src/glx/glitz_glx_context.c
index b28f149..99a13e2 100644
--- a/src/glx/glitz_glx_context.c
+++ b/src/glx/glitz_glx_context.c
@@ -192,6 +192,8 @@ static void
_glitz_glx_context_initialize (glitz_glx_screen_info_t *screen_info,
glitz_glx_context_t *context)
{
+ const char *version;
+
glitz_backend_init (&context->backend,
glitz_glx_get_proc_address,
(void *) screen_info);
@@ -200,6 +202,21 @@ _glitz_glx_context_initialize (glitz_glx_screen_info_t *screen_info,
context->max_viewport_dims);
glitz_initiate_state (&_glitz_glx_gl_proc_address);
+
+ version = context->backend.gl.get_string (GLITZ_GL_VERSION);
+ if (version)
+ {
+ /* Having trouble with TexSubImage2D to NPOT GL_TEXTURE_2D textures when
+ using nvidia's binary driver. Seems like a driver issue, but I'm not
+ sure yet. Turning of NPOT GL_TEXTURE_2D textures until this have been
+ solved. */
+ if (strstr (version, "NVIDIA 61.11") ||
+ strstr (version, "NVIDIA 66.29"))
+ {
+ context->backend.feature_mask &=
+ ~GLITZ_FEATURE_TEXTURE_NON_POWER_OF_TWO_MASK;
+ }
+ }
context->initialized = 1;
}