util: remove LIST_IS_EMPTY macro
[mesa.git] / src / gallium / drivers / softpipe / sp_state_so.c
index 2b5893906c8ede4ece3f8a49250d2a15ca81f3f4..aa2f11880dd27d12f97e0d59dd5b9a865d539574 100644 (file)
@@ -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,13 +63,18 @@ static void
 softpipe_set_so_targets(struct pipe_context *pipe,
                         unsigned num_targets,
                         struct pipe_stream_output_target **targets,
-                        unsigned append_bitmask)
+                        const unsigned *offsets)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
-   int i;
+   unsigned i;
 
    for (i = 0; i < num_targets; i++) {
       pipe_so_target_reference((struct pipe_stream_output_target **)&softpipe->so_targets[i], targets[i]);
+
+      if (targets[i]) {
+         void *buf = softpipe_resource(targets[i]->buffer)->data;
+         softpipe->so_targets[i]->mapping = buf;
+      }
    }
 
    for (; i < softpipe->num_so_targets; i++) {
@@ -77,6 +82,9 @@ softpipe_set_so_targets(struct pipe_context *pipe,
    }
 
    softpipe->num_so_targets = num_targets;
+
+   draw_set_mapped_so_targets(softpipe->draw, softpipe->num_so_targets,
+                              softpipe->so_targets);
 }
 
 void
@@ -86,4 +94,3 @@ softpipe_init_streamout_funcs(struct pipe_context *pipe)
    pipe->stream_output_target_destroy = softpipe_so_target_destroy;
    pipe->set_stream_output_targets = softpipe_set_so_targets;
 }
-