diff options
author | Marek Olšák <[email protected]> | 2017-04-02 15:24:19 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-05-10 19:00:16 +0200 |
commit | 22f6624ed318e8131681ec1f2e7b3a59449df412 (patch) | |
tree | ba8d1d3e12d2a75fdf82eea5ac409974e76153ad /src/gallium/include | |
parent | c24c3b94ed29ecd99b1101c74c6c4606f9b5580e (diff) |
gallium: separate indirect stuff from pipe_draw_info - 80 -> 56 bytes
For faster initialization of non-indirect draws.
Diffstat (limited to 'src/gallium/include')
-rw-r--r-- | src/gallium/include/pipe/p_state.h | 67 |
1 files changed, 35 insertions, 32 deletions
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 0c9b4b45915..3cfdd349feb 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -641,6 +641,40 @@ struct pipe_index_buffer }; +struct pipe_draw_indirect_info +{ + unsigned offset; /**< must be 4 byte aligned */ + unsigned stride; /**< must be 4 byte aligned */ + unsigned draw_count; /**< number of indirect draws */ + unsigned indirect_draw_count_offset; /**< must be 4 byte aligned */ + + /* Indirect draw parameters resource is laid out as follows: + * + * if indexed is TRUE: + * struct { + * uint32_t count; + * uint32_t instance_count; + * uint32_t start; + * int32_t index_bias; + * uint32_t start_instance; + * }; + * otherwise: + * struct { + * uint32_t count; + * uint32_t instance_count; + * uint32_t start; + * uint32_t start_instance; + * }; + */ + struct pipe_resource *buffer; + + /* Indirect draw count resource: If not NULL, contains a 32-bit value which + * is to be used as the real draw_count. + */ + struct pipe_resource *indirect_draw_count; +}; + + /** * Information to describe a draw_vbo call. */ @@ -671,40 +705,9 @@ struct pipe_draw_info */ unsigned restart_index; - 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: - * - * if indexed is TRUE: - * struct { - * uint32_t count; - * uint32_t instance_count; - * uint32_t start; - * int32_t index_bias; - * uint32_t start_instance; - * }; - * otherwise: - * struct { - * uint32_t count; - * uint32_t instance_count; - * uint32_t start; - * uint32_t start_instance; - * }; - */ - struct pipe_resource *indirect; - - /* 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; + struct pipe_draw_indirect_info *indirect; /**< Indirect draw. */ /** * Stream output target. If not NULL, it's used to provide the 'count' |