freedreno: Move fd4_size2indextype() helper to freedreno_util.h
authorKristian H. Kristensen <hoegsberg@google.com>
Mon, 3 Jun 2019 21:01:14 +0000 (14:01 -0700)
committerRob Clark <robdclark@chromium.org>
Fri, 7 Jun 2019 14:32:34 +0000 (07:32 -0700)
In preparation for refactoring fd6_draw.c a bit.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/freedreno/a4xx/fd4_draw.h
src/gallium/drivers/freedreno/freedreno_util.h

index 82f6c538ddb55d92b064b6d5310bfd032c34c5e2..64ccd5cc9dea7bb3913f60de5b405583c7a59369 100644 (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,
index 51eefc41f523680ace151996141b1d7cfc2ac44d..2d1a473912e8692eaec3f8cf0152bc3cddae972d 100644 (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_ */