diff options
author | Kristian H. Kristensen <[email protected]> | 2019-06-03 14:01:14 -0700 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-06-07 07:32:34 -0700 |
commit | cae6b4d741ee3cd7c6640574eea46481e05d13ba (patch) | |
tree | 926a314040c5adab0f9a5433577e5906e4950038 /src/gallium/drivers/freedreno/freedreno_util.h | |
parent | 0905189a25edabaea8de5482b9d5f531a92aa1cf (diff) |
freedreno: Move fd4_size2indextype() helper to freedreno_util.h
In preparation for refactoring fd6_draw.c a bit.
Reviewed-by: Rob Clark <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_util.h')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_util.h | 13 |
1 files changed, 13 insertions, 0 deletions
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_ */ |