[Mesa-dev] [PATCH 2/3] meta: Don't use GL_TEXTURE_RECTANGLE as texture target in GLES

Anuj Phogat anuj.phogat at gmail.com
Thu Nov 29 15:39:10 PST 2012


Makes framebuffer_blit_coverage_mismatched_buffer_formats.test
in gles3 conformance pass.

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 src/mesa/drivers/common/meta.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 978eeb5..02e64ff 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1134,7 +1134,7 @@ static void
 init_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
 {
    /* prefer texture rectangle */
-   if (ctx->Extensions.NV_texture_rectangle) {
+   if (_mesa_is_desktop_gl(ctx) && ctx->Extensions.NV_texture_rectangle) {
       tex->Target = GL_TEXTURE_RECTANGLE;
       tex->MaxSize = ctx->Const.MaxTextureRectSize;
       tex->NPOT = GL_TRUE;
@@ -1637,7 +1637,11 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
       _mesa_BufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts);
    }
 
-   _mesa_set_enable(ctx, tex->Target, GL_TRUE);
+   /* glEnable() in gles2 and gles3 doesn't allow GL_TEXTURE_{1D, 2D, etc.}
+    * tokens.
+    */
+   if (ctx->API == API_OPENGL && ctx->API == API_OPENGLES)
+      _mesa_set_enable(ctx, tex->Target, GL_TRUE);
 
    if (mask & GL_COLOR_BUFFER_BIT) {
       setup_copypix_texture(tex, newTex, srcX, srcY, srcW, srcH,
@@ -1679,7 +1683,8 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
       /* XXX can't easily do stencil */
    }
 
-   _mesa_set_enable(ctx, tex->Target, GL_FALSE);
+   if (ctx->API == API_OPENGL && ctx->API == API_OPENGLES)
+      _mesa_set_enable(ctx, tex->Target, GL_FALSE);
 
    _mesa_meta_end(ctx);
 
-- 
1.7.7.6



More information about the mesa-dev mailing list