From: Stanislav Vorobiov Date: Mon, 13 Jan 2014 09:37:10 +0000 (+0400) Subject: YaGL/VIGS: Use GL_UNSIGNED_INT_8_8_8_8_REV instead of GL_UNSIGNED_BYTE X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~517 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F14878%2F1;p=sdk%2Femulator%2Fqemu.git YaGL/VIGS: Use GL_UNSIGNED_INT_8_8_8_8_REV instead of GL_UNSIGNED_BYTE On Mac OS X glReadPixels with GL_UNSIGNED_BYTE may introduce stalls even when it's used with PBO, so use GL_UNSIGNED_INT_8_8_8_8_REV - it's the same thing and it doesn't stall glReadPixels Change-Id: I40ae1981579b3596f42f9a22604fd3d7fad8e335 --- diff --git a/hw/vigs/vigs_gl_backend.c b/hw/vigs/vigs_gl_backend.c index 1b15747e7f..7529b4b3fd 100644 --- a/hw/vigs/vigs_gl_backend.c +++ b/hw/vigs/vigs_gl_backend.c @@ -774,7 +774,7 @@ static struct vigs_surface *vigs_gl_backend_create_surface(struct vigs_backend * case vigsp_surface_bgra8888: tex_internalformat = GL_RGBA8; tex_format = GL_BGRA; - tex_type = GL_UNSIGNED_BYTE; + tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; break; default: assert(false); diff --git a/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.c b/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.c index 1dfb18fe3f..6fd3426ede 100644 --- a/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.c +++ b/hw/yagl/yagl_apis/gles/yagl_host_gles_calls.c @@ -2013,7 +2013,7 @@ void yagl_host_glUpdateOffscreenImageYAGL(GLuint texture, height, 0, format, - GL_UNSIGNED_BYTE, + GL_UNSIGNED_INT_8_8_8_8_REV, pixels); gles_api_ts->driver->PixelStorei(GL_UNPACK_ALIGNMENT, diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.c b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.c index 3b517a1acf..fbfaf47caa 100644 --- a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.c +++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_context.c @@ -192,7 +192,7 @@ bool yagl_egl_offscreen_context_read_pixels(struct yagl_egl_offscreen_context *c gles_driver->PixelStorei(GL_PACK_ALIGNMENT, 1); gles_driver->ReadPixels(0, 0, - width, height, format, GL_UNSIGNED_BYTE, + width, height, format, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); mapped_pixels = gles_driver->MapBuffer(GL_PIXEL_PACK_BUFFER_ARB,