radeonsi: move si_*_descriptors_idx functions into si_state.h
authorMarek Olšák <marek.olsak@amd.com>
Thu, 16 Aug 2018 01:39:52 +0000 (21:39 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 16 May 2019 17:06:53 +0000 (13:06 -0400)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_state.h

index 5b8121497541f51ce0b4c31ccebef69b08be944d..9daf36f6c407cb8dcd7f2d6ade2c8c10361f343b 100644 (file)
@@ -220,13 +220,6 @@ si_get_sampler_view_priority(struct si_resource *res)
        return RADEON_PRIO_SAMPLER_TEXTURE;
 }
 
-static unsigned
-si_sampler_and_image_descriptors_idx(unsigned shader)
-{
-       return SI_DESCS_FIRST_SHADER + shader * SI_NUM_SHADER_DESCS +
-              SI_SHADER_DESCS_SAMPLERS_AND_IMAGES;
-}
-
 static struct si_descriptors *
 si_sampler_and_image_descriptors(struct si_context *sctx, unsigned shader)
 {
@@ -1175,13 +1168,6 @@ bool si_upload_vertex_buffer_descriptors(struct si_context *sctx)
 
 /* CONSTANT BUFFERS */
 
-static unsigned
-si_const_and_shader_buffer_descriptors_idx(unsigned shader)
-{
-       return SI_DESCS_FIRST_SHADER + shader * SI_NUM_SHADER_DESCS +
-              SI_SHADER_DESCS_CONST_AND_SHADER_BUFFERS;
-}
-
 static struct si_descriptors *
 si_const_and_shader_buffer_descriptors(struct si_context *sctx, unsigned shader)
 {
index e4b1cf791326f3e99cf9e5335760cac29a18775f..116fce5b1465e61fe5a29b42dcb37efaa8f7cb4d 100644 (file)
@@ -394,6 +394,20 @@ enum {
                          PIPE_SHADER_##name * SI_NUM_SHADER_DESCS, \
                          SI_NUM_SHADER_DESCS)
 
+static inline unsigned
+si_const_and_shader_buffer_descriptors_idx(unsigned shader)
+{
+       return SI_DESCS_FIRST_SHADER + shader * SI_NUM_SHADER_DESCS +
+              SI_SHADER_DESCS_CONST_AND_SHADER_BUFFERS;
+}
+
+static inline unsigned
+si_sampler_and_image_descriptors_idx(unsigned shader)
+{
+       return SI_DESCS_FIRST_SHADER + shader * SI_NUM_SHADER_DESCS +
+              SI_SHADER_DESCS_SAMPLERS_AND_IMAGES;
+}
+
 /* This represents descriptors in memory, such as buffer resources,
  * image resources, and sampler states.
  */