mesa/st: enable carry/borrow lowering pass
[mesa.git] / src / mesa / main / blend.c
index 0c28352b236c91bac03a8e58fb6fc0f084121a4b..c37c0fea52b6a0d392f03e705a20a101cbd0461e 100644 (file)
@@ -5,7 +5,6 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.1
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
@@ -49,7 +48,6 @@ legal_src_factor(const struct gl_context *ctx, GLenum factor)
    switch (factor) {
    case GL_SRC_COLOR:
    case GL_ONE_MINUS_SRC_COLOR:
-      return ctx->Extensions.NV_blend_square;
    case GL_ZERO:
    case GL_ONE:
    case GL_DST_COLOR:
@@ -87,7 +85,6 @@ legal_dst_factor(const struct gl_context *ctx, GLenum factor)
    switch (factor) {
    case GL_DST_COLOR:
    case GL_ONE_MINUS_DST_COLOR:
-      return ctx->Extensions.NV_blend_square;
    case GL_ZERO:
    case GL_ONE:
    case GL_SRC_COLOR:
@@ -857,7 +854,7 @@ _mesa_update_clamp_vertex_color(struct gl_context *ctx)
 }
 
 /**
- * Returns an appropriate gl_format for color rendering based on the
+ * Returns an appropriate mesa_format for color rendering based on the
  * GL_FRAMEBUFFER_SRGB state.
  *
  * Some drivers implement GL_FRAMEBUFFER_SRGB using a flag on the blend state
@@ -865,8 +862,8 @@ _mesa_update_clamp_vertex_color(struct gl_context *ctx)
  * overriding the format of the surface.  This is a helper for doing the
  * surface format override variant.
  */
-gl_format
-_mesa_get_render_format(const struct gl_context *ctx, gl_format format)
+mesa_format
+_mesa_get_render_format(const struct gl_context *ctx, mesa_format format)
 {
    if (ctx->Color.sRGBEnabled)
       return format;
@@ -914,7 +911,9 @@ void _mesa_init_color( struct gl_context * ctx )
    ctx->Color.LogicOp = GL_COPY;
    ctx->Color.DitherFlag = GL_TRUE;
 
-   if (ctx->Visual.doubleBufferMode) {
+   /* GL_FRONT is not possible on GLES. Instead GL_BACK will render to either
+    * the front or the back buffer depending on the config */
+   if (ctx->Visual.doubleBufferMode || _mesa_is_gles(ctx)) {
       ctx->Color.DrawBuffer[0] = GL_BACK;
    }
    else {