summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-12-06 06:18:57 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-12-06 06:18:57 +0000
commit39f24a83c7720fb790c113d532e3c5f10fbb66a9 (patch)
tree3084f908b06fda73c055abd13107767341c78d46 /libvo
parentc6ef66231818b90c75f84b9407730647c93f040c (diff)
downloadmpv-39f24a83c7720fb790c113d532e3c5f10fbb66a9.tar.bz2
mpv-39f24a83c7720fb790c113d532e3c5f10fbb66a9.tar.xz
100l, forgot setting GL_UNPACK_CLIENT_STORAGE_APPLE for mesa-buffer mode.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28104 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_common.h3
-rw-r--r--libvo/vo_gl.c15
2 files changed, 13 insertions, 5 deletions
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index 31a21a5ff0..2dab89af95 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -225,6 +225,9 @@
#ifndef GL_FLOAT_RGB32_NV
#define GL_FLOAT_RGB32_NV 0x8889
#endif
+#ifndef GL_UNPACK_CLIENT_STORAGE_APPLE
+#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
+#endif
#ifndef GL_FRAGMENT_PROGRAM
#define GL_FRAGMENT_PROGRAM 0x8804
#endif
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index 21d310e170..f0d96d876d 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -702,6 +702,7 @@ static uint32_t get_image(mp_image_t *mpi) {
mpi->width = texture_width;
mpi->height = texture_height;
}
+ if (mesa_buffer) mpi->width = (mpi->width + 63) & ~63;
mpi->stride[0] = mpi->width * mpi->bpp / 8;
needed_size = mpi->stride[0] * mpi->height;
if (mesa_buffer) {
@@ -793,7 +794,9 @@ static uint32_t draw_image(mp_image_t *mpi) {
stride[0] = mpi->stride[0]; stride[1] = mpi->stride[1]; stride[2] = mpi->stride[2];
planes[0] = mpi->planes[0]; planes[1] = mpi->planes[1]; planes[2] = mpi->planes[2];
mpi_flipped = stride[0] < 0;
- if (!mesa_buffer && mpi->flags & MP_IMGFLAG_DIRECT) {
+ if (mpi->flags & MP_IMGFLAG_DIRECT) {
+ if (mesa_buffer) glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
+ else {
intptr_t base = (intptr_t)planes[0];
if (mpi_flipped)
base += (mpi->h - 1) * stride[0];
@@ -805,9 +808,9 @@ static uint32_t draw_image(mp_image_t *mpi) {
gl_bufferptr = NULL;
if (!(mpi->flags & MP_IMGFLAG_COMMON_PLANE))
planes[0] = planes[1] = planes[2] = NULL;
- }
- if (mpi->flags & MP_IMGFLAG_DIRECT)
+ }
slice = 0; // always "upload" full texture
+ }
glUploadTex(gl_target, gl_format, gl_type, planes[0], stride[0],
mpi->x, mpi->y, w, h, slice);
if (mpi->imgfmt == IMGFMT_YV12) {
@@ -829,8 +832,10 @@ static uint32_t draw_image(mp_image_t *mpi) {
mpi->x / 2, mpi->y / 2, w / 2, h / 2, slice);
ActiveTexture(GL_TEXTURE0);
}
- if (!mesa_buffer && mpi->flags & MP_IMGFLAG_DIRECT)
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+ if (mpi->flags & MP_IMGFLAG_DIRECT) {
+ if (mesa_buffer) glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 0);
+ else BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+ }
skip_upload:
if (vo_doublebuffering) do_render();
return VO_TRUE;