From: Kristian H. Kristensen Date: Mon, 3 Jun 2019 21:01:14 +0000 (-0700) Subject: freedreno: Move fd4_size2indextype() helper to freedreno_util.h X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cae6b4d741ee3cd7c6640574eea46481e05d13ba;p=mesa.git freedreno: Move fd4_size2indextype() helper to freedreno_util.h In preparation for refactoring fd6_draw.c a bit. Reviewed-by: Rob Clark Reviewed-by: Eric Anholt --- diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_draw.h b/src/gallium/drivers/freedreno/a4xx/fd4_draw.h index 82f6c538ddb..64ccd5cc9de 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_draw.h +++ b/src/gallium/drivers/freedreno/a4xx/fd4_draw.h @@ -85,19 +85,6 @@ fd4_draw(struct fd_batch *batch, struct fd_ringbuffer *ring, fd_reset_wfi(batch); } -static inline enum a4xx_index_size -fd4_size2indextype(unsigned index_size) -{ - switch (index_size) { - case 1: return INDEX4_SIZE_8_BIT; - case 2: return INDEX4_SIZE_16_BIT; - case 4: return INDEX4_SIZE_32_BIT; - } - DBG("unsupported index size: %d", index_size); - assert(0); - return INDEX4_SIZE_32_BIT; -} - static inline void fd4_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring, enum pc_di_primtype primtype, diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index 51eefc41f52..2d1a473912e 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -488,4 +488,17 @@ fd4_stage2shadersb(gl_shader_stage type) } } +static inline enum a4xx_index_size +fd4_size2indextype(unsigned index_size) +{ + switch (index_size) { + case 1: return INDEX4_SIZE_8_BIT; + case 2: return INDEX4_SIZE_16_BIT; + case 4: return INDEX4_SIZE_32_BIT; + } + DBG("unsupported index size: %d", index_size); + assert(0); + return INDEX4_SIZE_32_BIT; +} + #endif /* FREEDRENO_UTIL_H_ */