summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2012-07-13 09:20:02 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2012-07-13 09:48:21 +0800
commite51e16e64b1b87a6eb96c5993183475ad8a88cfd (patch)
tree9ed23cc9ebd961865c709e51a1f46fb38fb86c3a
parent5247854b57c3d931b5ad593a8c12b6978e6865d0 (diff)
gles2: Fixed the compilation problem and some bugs.
Previous patch doesn't set the offset to zero for GLESv2 path. Now fix it. This patch also fix a minor problem in pixmap uploading preparation. If the revert is not REVERT_NORMAL, then we don't need to prepare a fbo for it. As current mesa i965 gles2 driver doesn't support to set a A8 texture as a fbo target, we must fix this problem. As some A1/A8 picture need to be uploaded, this is the only place a A8 texture may be attached to a fbo. This patch also enable the shader gradient for GLESv2. The reason we disable it before is that some glsl linker doesn't support link different objects which have cross reference. Now we don't have that problem. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--src/glamor_glext.h3
-rw-r--r--src/glamor_pixmap.c2
-rw-r--r--src/glamor_priv.h2
-rw-r--r--src/glamor_render.c4
4 files changed, 7 insertions, 4 deletions
diff --git a/src/glamor_glext.h b/src/glamor_glext.h
index d60c696..1f7206b 100644
--- a/src/glamor_glext.h
+++ b/src/glamor_glext.h
@@ -57,5 +57,8 @@
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
#define GL_PACK_INVERT_MESA 0x8758
+#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
+#define GL_MAP_READ_BIT 0x0001
+#define GL_MAP_WRITE_BIT 0x0002
#endif
diff --git a/src/glamor_pixmap.c b/src/glamor_pixmap.c
index 10066a6..f3a2a87 100644
--- a/src/glamor_pixmap.c
+++ b/src/glamor_pixmap.c
@@ -612,7 +612,7 @@ glamor_pixmap_upload_prepare(PixmapPtr pixmap, GLenum format, int no_alpha, int
return 0;
if (!(no_alpha
- || (revert != REVERT_NONE)
+ || (revert == REVERT_NORMAL)
|| (swap_rb != SWAP_NONE_UPLOADING)
|| !glamor_priv->yInverted)) {
/* We don't need a fbo, a simple texture uploading should work. */
diff --git a/src/glamor_priv.h b/src/glamor_priv.h
index 0703c07..3b64c31 100644
--- a/src/glamor_priv.h
+++ b/src/glamor_priv.h
@@ -1014,10 +1014,8 @@ glamor_composite_rectangles(CARD8 op,
* this will increase performance obviously. */
#define GLAMOR_PIXMAP_DYNAMIC_UPLOAD
-#ifndef GLAMOR_GLES2
#define GLAMOR_GRADIENT_SHADER
//#define GLAMOR_TRAPEZOID_SHADER
-#endif
#define GLAMOR_TEXTURED_LARGE_PIXMAP 1
#define WALKAROUND_LARGE_TEXTURE_MAP
#if 0
diff --git a/src/glamor_render.c b/src/glamor_render.c
index b504686..6dacd44 100644
--- a/src/glamor_render.c
+++ b/src/glamor_render.c
@@ -753,7 +753,9 @@ glamor_setup_composite_vbo(ScreenPtr screen, int n_verts)
GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
assert(glamor_priv->vb != NULL);
glamor_priv->vb -= glamor_priv->vbo_offset;
- }
+ } else
+ glamor_priv->vbo_offset = 0;
+
dispatch->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, glamor_priv->ebo);
dispatch->glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,