i965: Add support for EXT_draw_buffers2.
authorEric Anholt <eric@anholt.net>
Tue, 26 Jan 2010 22:43:23 +0000 (14:43 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 26 Jan 2010 22:43:23 +0000 (14:43 -0800)
docs/relnotes-7.8.html
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/intel/intel_extensions.c

index 4fcc491036e9765c6ebad4e682587b51391033ab..6511d613d6951b5b9004dd3d83d38807eadc35c3 100644 (file)
@@ -35,7 +35,7 @@ tbd
 <h2>New features</h2>
 <ul>
 <li>GL_NV_conditional_render extension (swrast driver only)
-<li>GL_EXT_draw_buffers2 extension (swrast driver only)
+<li>GL_EXT_draw_buffers2 extension (swrast and i965 driver only)
 <li>Much improved support for <a href="egl.html">EGL in Mesa</a>
 <li>New state trackers for <a href="opengles.html">OpenGL ES 1.1 and 2.0</a>
 </ul>
index 357c8c90de3d23e5b19f37968a92ff3087cba453..1db438ae7b5505e03cdf12492e8cfa8e8f78bca9 100644 (file)
@@ -577,7 +577,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
       key.draw_y = 0;
    }
    /* _NEW_COLOR */
-   memcpy(key.color_mask, ctx->Color.ColorMask[0],
+   memcpy(key.color_mask, ctx->Color.ColorMask[unit],
          sizeof(key.color_mask));
 
    /* As mentioned above, disable writes to the alpha component when the
@@ -587,7 +587,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
      key.color_mask[3] = GL_FALSE;
 
    key.color_blend = (!ctx->Color._LogicOpEnabled &&
-                     ctx->Color.BlendEnabled);
+                     (ctx->Color.BlendEnabled & (1 << unit)));
 
    dri_bo_unreference(brw->wm.surf_bo[unit]);
    brw->wm.surf_bo[unit] = brw_search_cache(&brw->surface_cache,
index 6fdd22b9e95be130ea2667c99c044b2ee8bea65d..84c8d013e30a67f754f7b8346b6be840a33a917d 100644 (file)
@@ -48,6 +48,7 @@
 #define need_GL_EXT_blend_func_separate
 #define need_GL_EXT_blend_minmax
 #define need_GL_EXT_cull_vertex
+#define need_GL_EXT_draw_buffers2
 #define need_GL_EXT_fog_coord
 #define need_GL_EXT_framebuffer_object
 #define need_GL_EXT_framebuffer_blit
@@ -161,6 +162,7 @@ static const struct dri_extension brw_extensions[] = {
    { "GL_ARB_shadow",                     NULL },
    { "GL_MESA_texture_signed_rgba",       NULL },
    { "GL_ARB_texture_non_power_of_two",   NULL },
+   { "GL_EXT_draw_buffers2",              GL_EXT_draw_buffers2_functions },
    { "GL_EXT_shadow_funcs",               NULL },
    { "GL_EXT_stencil_two_side",           GL_EXT_stencil_two_side_functions },
    { "GL_EXT_texture_sRGB",              NULL },