diff options
author | Marek Olšák <[email protected]> | 2017-02-20 19:34:02 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-02-22 20:36:40 +0100 |
commit | 7ce8adad43eb556f4951b63ee4773864ff1a5f17 (patch) | |
tree | f0346ecb2136a42372ff48c031ac44dfd8021aee | |
parent | 3b04566bba9d86523df8a5afa332610ed114478a (diff) |
gallium: reorder fields in pipe_draw_info
sizeof(struct pipe_draw_info) = 104 -> 88
Also, vertices_per_patch is switched to ubyte, because it can't be more
than 32.
Seemed-reasonable-to: Roland Scheidegger
-rw-r--r-- | src/gallium/include/pipe/p_state.h | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index cb723108d5e..ce19b9292c5 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -636,8 +636,10 @@ struct pipe_index_buffer struct pipe_draw_info { boolean indexed; /**< use index buffer */ - enum pipe_prim_type mode; /**< the mode of the primitive */ + boolean primitive_restart; + ubyte vertices_per_patch; /**< the number of vertices per patch */ + unsigned start; /**< the index of the first vertex */ unsigned count; /**< number of vertices */ @@ -646,8 +648,6 @@ struct pipe_draw_info unsigned drawid; /**< id of this draw in a multidraw */ - unsigned vertices_per_patch; /**< the number of vertices per patch */ - /** * For indexed drawing, these fields apply after index lookup. */ @@ -658,24 +658,15 @@ struct pipe_draw_info /** * Primitive restart enable/index (only applies to indexed drawing) */ - boolean primitive_restart; unsigned restart_index; - /** - * Stream output target. If not NULL, it's used to provide the 'count' - * parameter based on the number vertices captured by the stream output - * stage. (or generally, based on the number of bytes captured) - * - * Only 'mode', 'start_instance', and 'instance_count' are taken into - * account, all the other variables from pipe_draw_info are ignored. - * - * 'start' is implicitly 0 and 'count' is set as discussed above. - * The draw command is non-indexed. - * - * Note that this only provides the count. The vertex buffers must - * be set via set_vertex_buffers manually. - */ - struct pipe_stream_output_target *count_from_stream_output; + unsigned indirect_offset; /**< must be 4 byte aligned */ + unsigned indirect_stride; /**< must be 4 byte aligned */ + unsigned indirect_count; /**< number of indirect draws */ + + unsigned indirect_params_offset; /**< must be 4 byte aligned */ + + /* Pointers must be at the end for an optimal structure layout on 64-bit. */ /* Indirect draw parameters resource: If not NULL, most values are taken * from this buffer instead, which is laid out as follows: @@ -697,16 +688,28 @@ struct pipe_draw_info * }; */ struct pipe_resource *indirect; - unsigned indirect_offset; /**< must be 4 byte aligned */ - unsigned indirect_stride; /**< must be 4 byte aligned */ - unsigned indirect_count; /**< number of indirect draws */ /* Indirect draw count resource: If not NULL, contains a 32-bit value which * is to be used as the real indirect_count. In that case indirect_count * becomes the maximum possible value. */ struct pipe_resource *indirect_params; - unsigned indirect_params_offset; /**< must be 4 byte aligned */ + + /** + * Stream output target. If not NULL, it's used to provide the 'count' + * parameter based on the number vertices captured by the stream output + * stage. (or generally, based on the number of bytes captured) + * + * Only 'mode', 'start_instance', and 'instance_count' are taken into + * account, all the other variables from pipe_draw_info are ignored. + * + * 'start' is implicitly 0 and 'count' is set as discussed above. + * The draw command is non-indexed. + * + * Note that this only provides the count. The vertex buffers must + * be set via set_vertex_buffers manually. + */ + struct pipe_stream_output_target *count_from_stream_output; }; |