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>
This commit is contained in:
Zhigang Gong 2012-07-13 09:20:02 +08:00 committed by Eric Anholt
parent 006fe0e66d
commit 4c27ca4700
4 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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. */

View File

@ -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

View File

@ -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,