radeonsi: use u_default_transfer_inline_write
[mesa.git] / src / gallium / drivers / noop / noop_state.c
index ad324774c0347de38f50260accf28e2f0786dd13..9d8dbfc4e2589e15cad9cb28b530a51eb38d7e69 100644 (file)
  */
 #include <stdio.h>
 #include <errno.h>
-#include <pipe/p_defines.h>
-#include <pipe/p_state.h>
-#include <pipe/p_context.h>
-#include <pipe/p_screen.h>
-#include <util/u_memory.h>
-#include <util/u_inlines.h>
+#include "pipe/p_defines.h"
+#include "pipe/p_state.h"
+#include "pipe/p_context.h"
+#include "pipe/p_screen.h"
+#include "util/u_memory.h"
+#include "util/u_inlines.h"
+#include "util/u_transfer.h"
 
 static void noop_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
 {
@@ -123,6 +124,7 @@ static struct pipe_surface *noop_create_surface(struct pipe_context *ctx,
 
        return surface;
 }
+
 static void noop_set_vs_sampler_view(struct pipe_context *ctx, unsigned count,
                                        struct pipe_sampler_view **views)
 {
@@ -243,6 +245,37 @@ static void *noop_create_shader_state(struct pipe_context *ctx,
        return nstate;
 }
 
+static struct pipe_stream_output_target *noop_create_stream_output_target(
+      struct pipe_context *ctx,
+      struct pipe_resource *res,
+      unsigned buffer_offset,
+      unsigned buffer_size)
+{
+   struct pipe_stream_output_target *t = CALLOC_STRUCT(pipe_stream_output_target);
+   if (!t)
+      return NULL;
+
+   pipe_reference_init(&t->reference, 1);
+   pipe_resource_reference(&t->buffer, res);
+   t->buffer_offset = buffer_offset;
+   t->buffer_size = buffer_size;
+   return t;
+}
+
+static void noop_stream_output_target_destroy(struct pipe_context *ctx,
+                                      struct pipe_stream_output_target *t)
+{
+   pipe_resource_reference(&t->buffer, NULL);
+   FREE(t);
+}
+
+static void noop_set_stream_output_targets(struct pipe_context *ctx,
+                           unsigned num_targets,
+                           struct pipe_stream_output_target **targets,
+                           unsigned append_bitmask)
+{
+}
+
 void noop_init_state_functions(struct pipe_context *ctx);
 
 void noop_init_state_functions(struct pipe_context *ctx)
@@ -287,4 +320,8 @@ void noop_init_state_functions(struct pipe_context *ctx)
        ctx->sampler_view_destroy = noop_sampler_view_destroy;
        ctx->surface_destroy = noop_surface_destroy;
        ctx->draw_vbo = noop_draw_vbo;
+       ctx->redefine_user_buffer = u_default_redefine_user_buffer;
+       ctx->create_stream_output_target = noop_create_stream_output_target;
+       ctx->stream_output_target_destroy = noop_stream_output_target_destroy;
+       ctx->set_stream_output_targets = noop_set_stream_output_targets;
 }