st/nine: Implement nine_context_gen_mipmap
authorAxel Davy <axel.davy@ens.fr>
Sat, 3 Dec 2016 22:01:56 +0000 (23:01 +0100)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:47:08 +0000 (23:47 +0100)
To offload mipmap generation as well.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/nine_state.c
src/gallium/state_trackers/nine/nine_state.h

index 57a5c74664274ca2943f5cd3c1a9a3d7322db3b4..a3a6e1665386e4bb88e34ffbdedcdbea997ecd38 100644 (file)
@@ -44,6 +44,7 @@
 #include "util/u_math.h"
 #include "util/u_box.h"
 #include "util/u_simple_shaders.h"
+#include "util/u_gen_mipmap.h"
 
 /* CSMT headers */
 #include "nine_queue.h"
@@ -2692,6 +2693,20 @@ CSMT_ITEM_NO_WAIT(nine_context_clear_render_target,
     context->pipe->clear_render_target(context->pipe, surf, &rgba, x, y, width, height, false);
 }
 
+CSMT_ITEM_NO_WAIT(nine_context_gen_mipmap,
+                  ARG_BIND_RES(struct pipe_resource, res),
+                  ARG_VAL(UINT, base_level),
+                  ARG_VAL(UINT, last_level),
+                  ARG_VAL(UINT, first_layer),
+                  ARG_VAL(UINT, last_layer),
+                  ARG_VAL(UINT, filter))
+{
+    struct nine_context *context = &device->context;
+
+    util_gen_mipmap(context->pipe, res, res->format, base_level,
+                    last_level, first_layer, last_layer, filter);
+}
+
 CSMT_ITEM_NO_WAIT_WITH_COUNTER(nine_context_range_upload,
                                ARG_BIND_RES(struct pipe_resource, res),
                                ARG_VAL(unsigned, offset),
index c0afbe0c8bf204e39bd8b97df59b223588c49507..0fa19a2fddc90a48cc2c6165290444ef66dcde22 100644 (file)
@@ -539,6 +539,13 @@ nine_context_clear_render_target(struct NineDevice9 *device,
                                  UINT width,
                                  UINT height);
 
+void
+nine_context_gen_mipmap(struct NineDevice9 *device,
+                        struct pipe_resource *res,
+                        UINT base_level, UINT last_level,
+                        UINT first_layer, UINT last_layer,
+                        UINT filter);
+
 void
 nine_context_range_upload(struct NineDevice9 *device,
                           unsigned *counter,