svga: use upload buffer for upload texture.
[mesa.git] / src / gallium / drivers / svga / svga_pipe_streamout.c
index 1da63204428d90f2da9926a88acea9e8476e69b8..1318b5565ce3eb49875aa48fae4dee71e966d4f3 100644 (file)
@@ -75,7 +75,7 @@ svga_create_stream_output(struct svga_context *svga,
    /* Allocate the streamout data structure */
    streamout = CALLOC_STRUCT(svga_stream_output);
 
-   if (streamout == NULL)
+   if (!streamout)
       return NULL;
 
    streamout->info = *info;
@@ -311,6 +311,25 @@ svga_set_stream_output_targets(struct pipe_context *pipe,
    svga->num_so_targets = num_targets;
 }
 
+/**
+ * Rebind stream output target surfaces
+ */
+enum pipe_error
+svga_rebind_stream_output_targets(struct svga_context *svga)
+{
+   struct svga_winsys_context *swc = svga->swc;
+   enum pipe_error ret;
+   unsigned i;
+
+   for (i = 0; i < svga->num_so_targets; i++) {
+      ret = swc->resource_rebind(swc, svga->so_surfaces[i], NULL, SVGA_RELOC_WRITE);
+      if (ret != PIPE_OK)
+         return ret;
+   }
+
+   return PIPE_OK;
+}
+
 void
 svga_init_stream_output_functions(struct svga_context *svga)
 {