freedreno: Move fd4_size2indextype() helper to freedreno_util.h

In preparation for refactoring fd6_draw.c a bit.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Kristian H. Kristensen 2019-06-03 14:01:14 -07:00 committed by Rob Clark
parent 0905189a25
commit cae6b4d741
2 changed files with 13 additions and 13 deletions

View file

@ -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,

View file

@ -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_ */