panfrost: Specialize vertex state for Valhall

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
This commit is contained in:
Alyssa Rosenzweig 2022-04-07 10:26:49 -04:00 committed by Marge Bot
parent 0795f3d7e4
commit c408f7551c
2 changed files with 21 additions and 13 deletions

View File

@ -95,6 +95,26 @@ struct panfrost_sampler_view {
struct panfrost_pool *pool;
};
struct panfrost_vertex_state {
unsigned num_elements;
struct pipe_vertex_element pipe[PIPE_MAX_ATTRIBS];
#if PAN_ARCH >= 9
/* Packed attribute descriptor. All fields are set at CSO create time
* except for stride, which must be ORed in at draw time
*/
struct mali_attribute_packed attributes[PIPE_MAX_ATTRIBS];
#else
/* buffers corresponds to attribute buffer, element_buffers corresponds
* to an index in buffers for each vertex element */
struct pan_vertex_buffer buffers[PIPE_MAX_ATTRIBS];
unsigned element_buffer[PIPE_MAX_ATTRIBS];
unsigned nr_bufs;
unsigned formats[PIPE_MAX_ATTRIBS];
#endif
};
/* Statically assert that PIPE_* enums match the hardware enums.
* (As long as they match, we don't need to translate them.)
*/

View File

@ -305,19 +305,6 @@ struct pan_vertex_buffer {
unsigned divisor;
};
struct panfrost_vertex_state {
unsigned num_elements;
/* buffers corresponds to attribute buffer, element_buffers corresponds
* to an index in buffers for each vertex element */
struct pan_vertex_buffer buffers[PIPE_MAX_ATTRIBS];
unsigned element_buffer[PIPE_MAX_ATTRIBS];
unsigned nr_bufs;
struct pipe_vertex_element pipe[PIPE_MAX_ATTRIBS];
unsigned formats[PIPE_MAX_ATTRIBS];
};
unsigned
pan_assign_vertex_buffer(struct pan_vertex_buffer *buffers,
unsigned *nr_bufs,
@ -327,6 +314,7 @@ pan_assign_vertex_buffer(struct pan_vertex_buffer *buffers,
struct panfrost_zsa_state;
struct panfrost_sampler_state;
struct panfrost_sampler_view;
struct panfrost_vertex_state;
static inline struct panfrost_context *
pan_context(struct pipe_context *pcontext)