changeset 27169:78d837adc71e

100l: finally understood ATI PBO problem: width must be a power of two.
author reimar
date Fri, 04 Jul 2008 21:19:27 +0000
parents 166bd251be60
children 4c07765b1191
files libvo/vo_gl.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl.c	Fri Jul 04 21:16:14 2008 +0000
+++ b/libvo/vo_gl.c	Fri Jul 04 21:19:27 2008 +0000
@@ -691,8 +691,11 @@
   if (!gl_buffer)
     GenBuffers(1, &gl_buffer);
   BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer);
-  if (ati_hack)
-    mpi->width = (mpi->width + 255) & ~255;
+  if (ati_hack) {
+    int s = 1;
+    while (s < mpi->width) s *= 2;
+    mpi->width = s;
+  }
   mpi->stride[0] = mpi->width * mpi->bpp / 8;
   if (mpi->stride[0] * mpi->height > gl_buffersize) {
     BufferData(GL_PIXEL_UNPACK_BUFFER, mpi->stride[0] * mpi->height,