draw: asst. clean-up in draw_pt_vsplit.c
Signed-off-by: Brian Paul <brianp@vmware.com> Acked-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17064>
This commit is contained in:
@@ -73,6 +73,7 @@ vsplit_clear_cache(struct vsplit_frontend *vsplit)
|
||||
vsplit->cache.num_draw_elts = 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vsplit_flush_cache(struct vsplit_frontend *vsplit, unsigned flags)
|
||||
{
|
||||
@@ -81,6 +82,7 @@ vsplit_flush_cache(struct vsplit_frontend *vsplit, unsigned flags)
|
||||
vsplit->draw_elts, vsplit->cache.num_draw_elts, flags);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a fetch element and add it to the draw elements.
|
||||
*/
|
||||
@@ -106,6 +108,7 @@ vsplit_add_cache(struct vsplit_frontend *vsplit, unsigned fetch)
|
||||
vsplit->draw_elts[vsplit->cache.num_draw_elts++] = vsplit->cache.draws[hash];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the base index to the elements array.
|
||||
* The value is checked for integer overflow (not sure it can happen?).
|
||||
@@ -134,6 +137,7 @@ vsplit_add_cache_ubyte(struct vsplit_frontend *vsplit, const ubyte *elts,
|
||||
vsplit_add_cache(vsplit, elt_idx);
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
vsplit_add_cache_ushort(struct vsplit_frontend *vsplit, const ushort *elts,
|
||||
unsigned start, unsigned fetch, int elt_bias)
|
||||
@@ -197,10 +201,11 @@ vsplit_add_cache_uint(struct vsplit_frontend *vsplit, const uint *elts,
|
||||
#include "draw_pt_vsplit_tmp.h"
|
||||
|
||||
|
||||
static void vsplit_prepare(struct draw_pt_front_end *frontend,
|
||||
enum pipe_prim_type in_prim,
|
||||
struct draw_pt_middle_end *middle,
|
||||
unsigned opt)
|
||||
static void
|
||||
vsplit_prepare(struct draw_pt_front_end *frontend,
|
||||
enum pipe_prim_type in_prim,
|
||||
struct draw_pt_middle_end *middle,
|
||||
unsigned opt)
|
||||
{
|
||||
struct vsplit_frontend *vsplit = (struct vsplit_frontend *) frontend;
|
||||
|
||||
@@ -232,7 +237,8 @@ static void vsplit_prepare(struct draw_pt_front_end *frontend,
|
||||
}
|
||||
|
||||
|
||||
static void vsplit_flush(struct draw_pt_front_end *frontend, unsigned flags)
|
||||
static void
|
||||
vsplit_flush(struct draw_pt_front_end *frontend, unsigned flags)
|
||||
{
|
||||
struct vsplit_frontend *vsplit = (struct vsplit_frontend *) frontend;
|
||||
|
||||
@@ -243,16 +249,17 @@ static void vsplit_flush(struct draw_pt_front_end *frontend, unsigned flags)
|
||||
}
|
||||
|
||||
|
||||
static void vsplit_destroy(struct draw_pt_front_end *frontend)
|
||||
static void
|
||||
vsplit_destroy(struct draw_pt_front_end *frontend)
|
||||
{
|
||||
FREE(frontend);
|
||||
}
|
||||
|
||||
|
||||
struct draw_pt_front_end *draw_pt_vsplit(struct draw_context *draw)
|
||||
struct draw_pt_front_end *
|
||||
draw_pt_vsplit(struct draw_context *draw)
|
||||
{
|
||||
struct vsplit_frontend *vsplit = CALLOC_STRUCT(vsplit_frontend);
|
||||
ushort i;
|
||||
|
||||
if (!vsplit)
|
||||
return NULL;
|
||||
@@ -263,7 +270,7 @@ struct draw_pt_front_end *draw_pt_vsplit(struct draw_context *draw)
|
||||
vsplit->base.destroy = vsplit_destroy;
|
||||
vsplit->draw = draw;
|
||||
|
||||
for (i = 0; i < SEGMENT_SIZE; i++)
|
||||
for (unsigned i = 0; i < SEGMENT_SIZE; i++)
|
||||
vsplit->identity_draw_elts[i] = i;
|
||||
|
||||
return &vsplit->base;
|
||||
|
Reference in New Issue
Block a user