radeonsi/gfx10: add pipe_screen::make_texture_descriptor
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 14 Nov 2017 15:03:48 +0000 (16:03 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Jul 2019 19:51:12 +0000 (15:51 -0400)
Texture descriptors in gfx10 are very different.

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state.h
src/gallium/drivers/radeonsi/si_texture.c

index 2a13ffd32f93ec21dc53ac5e035411c11ad55320..2b637208e1ac7b0e5df1da935657d52031a07264 100644 (file)
@@ -742,7 +742,7 @@ static void si_set_shader_image_desc(struct si_context *ctx,
                        hw_level = 0;
                }
 
-               si_make_texture_descriptor(screen, tex,
+               screen->make_texture_descriptor(screen, tex,
                                           false, res->b.b.target,
                                           view->format, swizzle,
                                           hw_level, hw_level,
index 8512c27b2cd54c946fb5cd0f8144dcfbfd7c9c69..57232432cc2fc69b0fc79b75ca2273475ce89d39 100644 (file)
@@ -457,6 +457,19 @@ struct si_screen {
        uint64_t                        debug_flags;
        char                            renderer_string[183];
 
+       void (*make_texture_descriptor)(
+                       struct si_screen *screen,
+                       struct si_texture *tex,
+                       bool sampler,
+                       enum pipe_texture_target target,
+                       enum pipe_format pipe_format,
+                       const unsigned char state_swizzle[4],
+                       unsigned first_level, unsigned last_level,
+                       unsigned first_layer, unsigned last_layer,
+                       unsigned width, unsigned height, unsigned depth,
+                       uint32_t *state,
+                       uint32_t *fmask_state);
+
        unsigned                        pa_sc_raster_config;
        unsigned                        pa_sc_raster_config_1;
        unsigned                        se_tile_repeat;
index 347d7b84b4c25a353ddabdcc37ce9550a161c9ee..dd2314aef6602648f899129ce7727d3f0903185e 100644 (file)
@@ -3736,7 +3736,7 @@ static unsigned gfx9_border_color_swizzle(const unsigned char swizzle[4])
 /**
  * Build the sampler view descriptor for a texture.
  */
-void
+static void
 si_make_texture_descriptor(struct si_screen *screen,
                           struct si_texture *tex,
                           bool sampler,
@@ -4224,7 +4224,7 @@ si_create_sampler_view_custom(struct pipe_context *ctx,
                                                state->u.tex.first_level,
                                                state->format);
 
-       si_make_texture_descriptor(sctx->screen, tex, true,
+       sctx->screen->make_texture_descriptor(sctx->screen, tex, true,
                                   state->target, pipe_format, state_swizzle,
                                   first_level, last_level,
                                   state->u.tex.first_layer, last_layer,
@@ -4970,6 +4970,8 @@ void si_init_state_functions(struct si_context *sctx)
 void si_init_screen_state_functions(struct si_screen *sscreen)
 {
        sscreen->b.is_format_supported = si_is_format_supported;
+
+       sscreen->make_texture_descriptor = si_make_texture_descriptor;
 }
 
 static void si_set_grbm_gfx_index(struct si_context *sctx,
index d1fc1c09c66cd11ad44090b6df0bc58c6ffaeb8f..b55c99fdd4c420449d75e75387e17f402a7288e6 100644 (file)
@@ -536,18 +536,6 @@ si_make_buffer_descriptor(struct si_screen *screen, struct si_resource *buf,
                          enum pipe_format format,
                          unsigned offset, unsigned size,
                          uint32_t *state);
-void
-si_make_texture_descriptor(struct si_screen *screen,
-                          struct si_texture *tex,
-                          bool sampler,
-                          enum pipe_texture_target target,
-                          enum pipe_format pipe_format,
-                          const unsigned char state_swizzle[4],
-                          unsigned first_level, unsigned last_level,
-                          unsigned first_layer, unsigned last_layer,
-                          unsigned width, unsigned height, unsigned depth,
-                          uint32_t *state,
-                          uint32_t *fmask_state);
 struct pipe_sampler_view *
 si_create_sampler_view_custom(struct pipe_context *ctx,
                              struct pipe_resource *texture,
index 324669b4d62d3de256b09eee695f21f11cea659b..37641c4a102f484419df5ccf1867073774c9670c 100644 (file)
@@ -683,7 +683,7 @@ static void si_set_tex_bo_metadata(struct si_screen *sscreen,
        bool is_array = util_texture_is_array(res->target);
        uint32_t desc[8];
 
-       si_make_texture_descriptor(sscreen, tex, true,
+       sscreen->make_texture_descriptor(sscreen, tex, true,
                                   res->target, res->format,
                                   swizzle, 0, res->last_level, 0,
                                   is_array ? res->array_size - 1 : 0,