u_draw: Add some indices to the util_draw_elements() helpers.
authorEric Anholt <eric@anholt.net>
Wed, 11 Jul 2018 21:58:40 +0000 (14:58 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 12 Jul 2018 18:49:20 +0000 (11:49 -0700)
These helpers have been unused, and were definitely not useful since
330d0607ed60 ("gallium: remove pipe_index_buffer and set_index_buffer")
made it so that they never had an index buffer passed in.

For an upcoming u_blitter change to use these helpers, I have just 6 bytes
of index data, so pass it as user data until a more interesting caller
comes along.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_draw.h

index e8af14051b17958a9b9496700c1d881ad89ac22c..d0955fa3f978d041803bd4ec76741743c1b35432 100644 (file)
@@ -67,7 +67,9 @@ util_draw_arrays(struct pipe_context *pipe,
 }
 
 static inline void
-util_draw_elements(struct pipe_context *pipe, unsigned index_size,
+util_draw_elements(struct pipe_context *pipe,
+                   void *indices,
+                   unsigned index_size,
                    int index_bias, enum pipe_prim_type mode,
                    uint start,
                    uint count)
@@ -75,6 +77,8 @@ util_draw_elements(struct pipe_context *pipe, unsigned index_size,
    struct pipe_draw_info info;
 
    util_draw_init_info(&info);
+   info.index.user = indices;
+   info.has_user_indices = true;
    info.index_size = index_size;
    info.mode = mode;
    info.start = start;
@@ -108,6 +112,7 @@ util_draw_arrays_instanced(struct pipe_context *pipe,
 
 static inline void
 util_draw_elements_instanced(struct pipe_context *pipe,
+                             void *indices,
                              unsigned index_size,
                              int index_bias,
                              enum pipe_prim_type mode,
@@ -119,6 +124,8 @@ util_draw_elements_instanced(struct pipe_context *pipe,
    struct pipe_draw_info info;
 
    util_draw_init_info(&info);
+   info.index.user = indices;
+   info.has_user_indices = true;
    info.index_size = index_size;
    info.mode = mode;
    info.start = start;