changeset 28073:fa17a5971df6

More possible fixes for mesa-buffer mode.
author reimar
date Sat, 06 Dec 2008 06:44:54 +0000
parents aea4c94e42a5
children 24871084fad6
files libvo/vo_gl.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl.c	Sat Dec 06 06:41:36 2008 +0000
+++ b/libvo/vo_gl.c	Sat Dec 06 06:44:54 2008 +0000
@@ -178,6 +178,7 @@
       *texh *= 2;
   }
   if (ati_hack) *texw = (*texw + 511) & ~511;
+  if (mesa_buffer) *texw = (*texw + 63) & ~63;
 }
 
 //! maximum size of custom fragment program
@@ -702,7 +703,7 @@
     mpi->width = texture_width;
     mpi->height = texture_height;
   }
-  if (mesa_buffer) mpi->width = (mpi->width + 63) & ~63;
+  if (mesa_buffer) mpi->width = texture_width;
   mpi->stride[0] = mpi->width * mpi->bpp / 8;
   needed_size = mpi->stride[0] * mpi->height;
   if (mesa_buffer) {
@@ -794,8 +795,10 @@
   planes[0] = mpi->planes[0]; planes[1] = mpi->planes[1]; planes[2] = mpi->planes[2];
   mpi_flipped = stride[0] < 0;
   if (mpi->flags & MP_IMGFLAG_DIRECT) {
-    if (mesa_buffer) glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
-    else {
+    if (mesa_buffer) {
+      glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
+      w = texture_width;
+    } else {
       intptr_t base = (intptr_t)planes[0];
       if (ati_hack) { w = texture_width; h = texture_height; }
       if (mpi_flipped)