From b0413cfd8b84634db4a5bf57d550b21d0d2fa8f7 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 16 Jan 2018 17:55:00 +0100 Subject: [PATCH] draw: remove VSPLIT_CREATE_IDX macro Just inline the little bit of code. Reviewed-by: Jose Fonseca Reviewed-by: Brian Paul --- src/gallium/auxiliary/draw/draw_pt_vsplit.c | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pt_vsplit.c b/src/gallium/auxiliary/draw/draw_pt_vsplit.c index 3ff077b7602..653deab28cd 100644 --- a/src/gallium/auxiliary/draw/draw_pt_vsplit.c +++ b/src/gallium/auxiliary/draw/draw_pt_vsplit.c @@ -116,21 +116,15 @@ vsplit_get_base_idx(unsigned start, unsigned fetch) return draw_overflow_uadd(start, fetch, MAX_ELT_IDX); } -/* - * The final element index is just element index plus element bias. - */ -#define VSPLIT_CREATE_IDX(elts, start, fetch, elt_bias) \ - unsigned elt_idx; \ - elt_idx = vsplit_get_base_idx(start, fetch); \ - elt_idx = (unsigned)((int)(DRAW_GET_IDX(elts, elt_idx)) + (int)elt_bias); - static inline void vsplit_add_cache_ubyte(struct vsplit_frontend *vsplit, const ubyte *elts, unsigned start, unsigned fetch, int elt_bias) { struct draw_context *draw = vsplit->draw; - VSPLIT_CREATE_IDX(elts, start, fetch, elt_bias); + unsigned elt_idx; + elt_idx = vsplit_get_base_idx(start, fetch); + elt_idx = (unsigned)((int)(DRAW_GET_IDX(elts, elt_idx)) + elt_bias); /* unlike the uint case this can only happen with elt_bias */ if (elt_bias && elt_idx == DRAW_MAX_FETCH_IDX && !vsplit->cache.has_max_fetch) { unsigned hash = elt_idx % MAP_SIZE; @@ -145,7 +139,9 @@ vsplit_add_cache_ushort(struct vsplit_frontend *vsplit, const ushort *elts, unsigned start, unsigned fetch, int elt_bias) { struct draw_context *draw = vsplit->draw; - VSPLIT_CREATE_IDX(elts, start, fetch, elt_bias); + unsigned elt_idx; + elt_idx = vsplit_get_base_idx(start, fetch); + elt_idx = (unsigned)((int)(DRAW_GET_IDX(elts, elt_idx)) + elt_bias); /* unlike the uint case this can only happen with elt_bias */ if (elt_bias && elt_idx == DRAW_MAX_FETCH_IDX && !vsplit->cache.has_max_fetch) { unsigned hash = elt_idx % MAP_SIZE; @@ -165,7 +161,12 @@ vsplit_add_cache_uint(struct vsplit_frontend *vsplit, const uint *elts, unsigned start, unsigned fetch, int elt_bias) { struct draw_context *draw = vsplit->draw; - VSPLIT_CREATE_IDX(elts, start, fetch, elt_bias); + unsigned elt_idx; + /* + * The final element index is just element index plus element bias. + */ + elt_idx = vsplit_get_base_idx(start, fetch); + elt_idx = (unsigned)((int)(DRAW_GET_IDX(elts, elt_idx)) + elt_bias); /* Take care for DRAW_MAX_FETCH_IDX (since cache is initialized to -1). */ if (elt_idx == DRAW_MAX_FETCH_IDX && !vsplit->cache.has_max_fetch) { unsigned hash = elt_idx % MAP_SIZE; -- 2.30.2