radeonsi: remove si_shader_selector::type
authorMarek Olšák <marek.olsak@amd.com>
Sat, 15 Aug 2020 05:01:08 +0000 (01:01 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 3 Sep 2020 03:03:00 +0000 (23:03 -0400)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6340>

src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state_shaders.c

index 24e43410164b855817f71279d85006251e8c7160..4292b9d573736534045e6e7048a07b26f51a8e9d 100644 (file)
@@ -236,12 +236,11 @@ static void *si_create_compute_state(struct pipe_context *ctx, const struct pipe
 
    pipe_reference_init(&sel->base.reference, 1);
    sel->info.stage = MESA_SHADER_COMPUTE;
-   sel->type = PIPE_SHADER_COMPUTE;
    sel->screen = sscreen;
    sel->const_and_shader_buf_descriptors_index =
-      si_const_and_shader_buffer_descriptors_idx(sel->type);
+      si_const_and_shader_buffer_descriptors_idx(PIPE_SHADER_COMPUTE);
    sel->sampler_and_images_descriptors_index =
-      si_sampler_and_image_descriptors_idx(sel->type);
+      si_sampler_and_image_descriptors_idx(PIPE_SHADER_COMPUTE);
    program->shader.selector = &program->sel;
    program->ir_type = cso->ir_type;
    program->local_size = cso->req_local_mem;
index a40e58c6a2fd0b46ea4295e0d974adf17da1b9f4..5d1d8ac8459d8910b36bcd430af6af0de0ae0cbc 100644 (file)
@@ -1603,7 +1603,8 @@ static struct nir_shader *get_nir_shader(struct si_shader_selector *sel, bool *f
       return sel->nir;
    } else if (sel->nir_binary) {
       struct pipe_screen *screen = &sel->screen->b;
-      const void *options = screen->get_compiler_options(screen, PIPE_SHADER_IR_NIR, sel->type);
+      const void *options = screen->get_compiler_options(screen, PIPE_SHADER_IR_NIR,
+                                                         pipe_shader_type_from_mesa(sel->info.stage));
 
       struct blob_reader blob_reader;
       blob_reader_init(&blob_reader, sel->nir_binary, sel->nir_size);
index 9da7363d99e4f875756dcbc6384c333a12cdfaf7..838fc9f823ec1ecdd0671c2977df938980e10e2a 100644 (file)
@@ -431,8 +431,6 @@ struct si_shader_selector {
    struct pipe_stream_output_info so;
    struct si_shader_info info;
 
-   /* PIPE_SHADER_[VERTEX|FRAGMENT|...] */
-   enum pipe_shader_type type;
    ubyte const_and_shader_buf_descriptors_index;
    ubyte sampler_and_images_descriptors_index;
    bool vs_needs_prolog;
index b754b03ca95682e24833f9a2ab233408d49be1fd..93f8af114ba4df6d9c3bf1b7f0d1673bf3e26310 100644 (file)
@@ -2603,11 +2603,11 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
 
    si_nir_scan_shader(sel->nir, &sel->info);
 
-   sel->type = pipe_shader_type_from_mesa(sel->info.stage);
+   const enum pipe_shader_type type = pipe_shader_type_from_mesa(sel->info.stage);
    sel->const_and_shader_buf_descriptors_index =
-      si_const_and_shader_buffer_descriptors_idx(sel->type);
+      si_const_and_shader_buffer_descriptors_idx(type);
    sel->sampler_and_images_descriptors_index =
-      si_sampler_and_image_descriptors_idx(sel->type);
+      si_sampler_and_image_descriptors_idx(type);
 
    p_atomic_inc(&sscreen->num_shaders_created);
    si_get_active_slot_masks(&sel->info, &sel->active_const_and_shader_buffers,