Fix promotion of floats to doubles
[mesa.git] / src / gallium / drivers / softpipe / sp_state_so.c
index 3682c6c6742175fa2606d871047a693d289ba5a2..b0cb55a2625e55f295d2f4686fce7bdd9379cc79 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.
@@ -29,7 +29,7 @@
 #include "sp_state.h"
 #include "sp_texture.h"
 
-#include "util/u_format.h"
+#include "util/format/u_format.h"
 #include "util/u_memory.h"
 #include "draw/draw_context.h"
 #include "pipebuffer/pb_buffer.h"
@@ -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);
    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;
 }
-