gallium: decrease the size of pipe_draw_info - 88 -> 80 bytes
authorMarek Olšák <marek.olsak@amd.com>
Sun, 2 Apr 2017 12:42:17 +0000 (14:42 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 4 Apr 2017 09:14:43 +0000 (11:14 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/indices/u_primconvert.c
src/gallium/include/pipe/p_state.h

index 2bdfade8a5434a6466cfbc12a39f334130313c9b..1ffca4b593c4b72ff7c41dabdb859ccd129eb594 100644 (file)
@@ -128,12 +128,15 @@ util_primconvert_draw_vbo(struct primconvert_context *pc,
    new_info.primitive_restart = info->primitive_restart;
    new_info.restart_index = info->restart_index;
    if (info->indexed) {
+      enum pipe_prim_type mode = 0;
+
       u_index_translator(pc->primtypes_mask,
                          info->mode, pc->saved_ib.index_size, info->count,
                          pc->api_pv, pc->api_pv,
                          info->primitive_restart ? PR_ENABLE : PR_DISABLE,
-                         &new_info.mode, &new_ib.index_size, &new_info.count,
+                         &mode, &new_ib.index_size, &new_info.count,
                          &trans_func);
+      new_info.mode = mode;
       src = ib->user_buffer;
       if (!src) {
          src = pipe_buffer_map(pc->pipe, ib->buffer,
@@ -142,11 +145,14 @@ util_primconvert_draw_vbo(struct primconvert_context *pc,
       src = (const uint8_t *)src + ib->offset;
    }
    else {
+      enum pipe_prim_type mode = 0;
+
       u_index_generator(pc->primtypes_mask,
                         info->mode, info->start, info->count,
                         pc->api_pv, pc->api_pv,
-                        &new_info.mode, &new_ib.index_size, &new_info.count,
+                        &mode, &new_ib.index_size, &new_info.count,
                         &gen_func);
+      new_info.mode = mode;
    }
 
    u_upload_alloc(pc->pipe->stream_uploader, 0, new_ib.index_size * new_info.count, 4,
index 45c213795c6931f90d255fc4a1d187e6ba5fb0fe..ce9ca34d295aa76a3c914a541f29ae687f18e4fc 100644 (file)
@@ -644,7 +644,7 @@ struct pipe_index_buffer
 struct pipe_draw_info
 {
    boolean indexed;  /**< use index buffer */
-   enum pipe_prim_type mode;  /**< the mode of the primitive */
+   enum pipe_prim_type mode:8;  /**< the mode of the primitive */
    boolean primitive_restart;
    ubyte vertices_per_patch; /**< the number of vertices per patch */