freedreno: update generated headers
[mesa.git] / src / gallium / drivers / softpipe / sp_quad_blend.c
index 00a9be62f6ee966c5a2572edcceea3535d21f7c6..5b458450cd843b855f06020311d00c962d3947e3 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  * 
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2007 VMware, Inc.
  * All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -18,7 +18,7 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -63,7 +63,7 @@ struct blend_quad_stage
 
 
 /** cast wrapper */
-static INLINE struct blend_quad_stage *
+static inline struct blend_quad_stage *
 blend_quad_stage(struct quad_stage *stage)
 {
    return (struct blend_quad_stage *) stage;
@@ -923,9 +923,8 @@ blend_fallback(struct quad_stage *qs,
    struct softpipe_context *softpipe = qs->softpipe;
    const struct pipe_blend_state *blend = softpipe->blend;
    unsigned cbuf;
-   boolean write_all;
-
-   write_all = softpipe->fs_variant->info.color0_writes_all_cbufs;
+   boolean write_all =
+      softpipe->fs_variant->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS];
 
    for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) {
       if (softpipe->framebuffer.cbufs[cbuf]) {
@@ -935,7 +934,7 @@ blend_fallback(struct quad_stage *qs,
          struct softpipe_cached_tile *tile
             = sp_get_cached_tile(softpipe->cbuf_cache[cbuf],
                                  quads[0]->input.x0, 
-                                 quads[0]->input.y0);
+                                 quads[0]->input.y0, quads[0]->input.layer);
          const boolean clamp = bqs->clamp[cbuf];
          const float *blend_color;
          const boolean dual_source_blend = util_blend_state_is_dual(blend, cbuf);
@@ -1038,7 +1037,7 @@ blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs,
    struct softpipe_cached_tile *tile
       = sp_get_cached_tile(qs->softpipe->cbuf_cache[0],
                            quads[0]->input.x0, 
-                           quads[0]->input.y0);
+                           quads[0]->input.y0, quads[0]->input.layer);
 
    for (q = 0; q < nr; q++) {
       struct quad_header *quad = quads[q];
@@ -1112,7 +1111,7 @@ blend_single_add_one_one(struct quad_stage *qs,
    struct softpipe_cached_tile *tile
       = sp_get_cached_tile(qs->softpipe->cbuf_cache[0],
                            quads[0]->input.x0, 
-                           quads[0]->input.y0);
+                           quads[0]->input.y0, quads[0]->input.layer);
 
    for (q = 0; q < nr; q++) {
       struct quad_header *quad = quads[q];
@@ -1180,7 +1179,7 @@ single_output_color(struct quad_stage *qs,
    struct softpipe_cached_tile *tile
       = sp_get_cached_tile(qs->softpipe->cbuf_cache[0],
                            quads[0]->input.x0, 
-                           quads[0]->input.y0);
+                           quads[0]->input.y0, quads[0]->input.layer);
 
    for (q = 0; q < nr; q++) {
       struct quad_header *quad = quads[q];
@@ -1232,7 +1231,10 @@ choose_blend_quad(struct quad_stage *qs,
             softpipe->blend->rt[0].colormask == 0xf &&
             softpipe->framebuffer.nr_cbufs == 1)
    {
-      if (!blend->rt[0].blend_enable) {
+      if (softpipe->framebuffer.cbufs[0] == NULL) {
+         qs->run = blend_noop;
+      }
+      else if (!blend->rt[0].blend_enable) {
          qs->run = single_output_color;
       }
       else if (blend->rt[0].rgb_src_factor == blend->rt[0].alpha_src_factor &&