From: Marek Olšák Date: Sat, 15 Aug 2020 05:01:08 +0000 (-0400) Subject: radeonsi: remove si_shader_selector::type X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6925401a3872304e0f50a1ee1eb72e7e655079f6;p=mesa.git radeonsi: remove si_shader_selector::type Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 24e43410164..4292b9d5737 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -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; diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index a40e58c6a2f..5d1d8ac8459 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -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); diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 9da7363d99e..838fc9f823e 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -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; diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index b754b03ca95..93f8af114ba 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -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,