freedreno/a6xx: disable LRZ when color channels are masked
[mesa.git] / src / gallium / drivers / llvmpipe / lp_draw_arrays.c
index 9a9c2f7ce76d8497545ec7bf0635433d7a02ce97..d9700cfd6d78a580e381cd3c65f38412d0306fc3 100644 (file)
@@ -87,38 +87,43 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
    }
 
    /* Map index buffer, if present */
-   if (info->indexed) {
+   if (info->index_size) {
       unsigned available_space = ~0;
-      mapped_indices = lp->index_buffer.user_buffer;
+      mapped_indices = info->has_user_indices ? info->index.user : NULL;
       if (!mapped_indices) {
-         mapped_indices = llvmpipe_resource_data(lp->index_buffer.buffer);
-         if (lp->index_buffer.buffer->width0 > lp->index_buffer.offset)
-            available_space =
-               (lp->index_buffer.buffer->width0 - lp->index_buffer.offset);
-         else
-            available_space = 0;
+         mapped_indices = llvmpipe_resource_data(info->index.resource);
+         available_space = info->index.resource->width0;
       }
       draw_set_indexes(draw,
-                       (ubyte *) mapped_indices + lp->index_buffer.offset,
-                       lp->index_buffer.index_size, available_space);
+                       (ubyte *) mapped_indices,
+                       info->index_size, available_space);
    }
 
-   for (i = 0; i < lp->num_so_targets; i++) {
-      void *buf = 0;
-      if (lp->so_targets[i]) {
-         buf = llvmpipe_resource(lp->so_targets[i]->target.buffer)->data;
-         lp->so_targets[i]->mapping = buf;
-      }
-   }
-   draw_set_mapped_so_targets(draw, lp->num_so_targets,
-                              lp->so_targets);
-
    llvmpipe_prepare_vertex_sampling(lp,
                                     lp->num_sampler_views[PIPE_SHADER_VERTEX],
                                     lp->sampler_views[PIPE_SHADER_VERTEX]);
    llvmpipe_prepare_geometry_sampling(lp,
                                       lp->num_sampler_views[PIPE_SHADER_GEOMETRY],
                                       lp->sampler_views[PIPE_SHADER_GEOMETRY]);
+   llvmpipe_prepare_tess_ctrl_sampling(lp,
+                                       lp->num_sampler_views[PIPE_SHADER_TESS_CTRL],
+                                       lp->sampler_views[PIPE_SHADER_TESS_CTRL]);
+   llvmpipe_prepare_tess_eval_sampling(lp,
+                                       lp->num_sampler_views[PIPE_SHADER_TESS_EVAL],
+                                       lp->sampler_views[PIPE_SHADER_TESS_EVAL]);
+
+   llvmpipe_prepare_vertex_images(lp,
+                                  lp->num_images[PIPE_SHADER_VERTEX],
+                                  lp->images[PIPE_SHADER_VERTEX]);
+   llvmpipe_prepare_geometry_images(lp,
+                                    lp->num_images[PIPE_SHADER_GEOMETRY],
+                                    lp->images[PIPE_SHADER_GEOMETRY]);
+   llvmpipe_prepare_tess_ctrl_images(lp,
+                                     lp->num_images[PIPE_SHADER_TESS_CTRL],
+                                     lp->images[PIPE_SHADER_TESS_CTRL]);
+   llvmpipe_prepare_tess_eval_images(lp,
+                                     lp->num_images[PIPE_SHADER_TESS_EVAL],
+                                     lp->images[PIPE_SHADER_TESS_EVAL]);
    if (lp->gs && lp->gs->no_tokens) {
       /* we have an empty geometry shader with stream output, so
          attach the stream output info to the current vertex shader */
@@ -129,6 +134,10 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
    draw_collect_pipeline_statistics(draw,
                                     lp->active_statistics_queries > 0);
 
+   draw_collect_primitives_generated(draw,
+                                     lp->active_primgen_queries &&
+                                     !lp->queries_disabled);
+
    /* draw! */
    draw_vbo(draw, info);
 
@@ -141,7 +150,6 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
    if (mapped_indices) {
       draw_set_indexes(draw, NULL, 0, 0);
    }
-   draw_set_mapped_so_targets(draw, 0, NULL);
 
    if (lp->gs && lp->gs->no_tokens) {
       /* we have attached stream output to the vs for rendering,