From 7be12df5e621e6d339b1dca3fb0a84e9b8550337 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 30 Jun 2020 13:01:09 -0400 Subject: [PATCH] zink: rename zink_gfx_program::stages to 'modules' we've been confusing 'stages' and 'shaders' over and over for a long time, so maybe having a totally different name will help here Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/zink/zink_pipeline.c | 4 ++-- src/gallium/drivers/zink/zink_program.c | 16 ++++++++-------- src/gallium/drivers/zink/zink_program.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c index 637e880eb3c..976c3afc857 100644 --- a/src/gallium/drivers/zink/zink_pipeline.c +++ b/src/gallium/drivers/zink/zink_pipeline.c @@ -143,13 +143,13 @@ zink_create_gfx_pipeline(struct zink_screen *screen, VkPipelineShaderStageCreateInfo shader_stages[ZINK_SHADER_COUNT]; uint32_t num_stages = 0; for (int i = 0; i < ZINK_SHADER_COUNT; ++i) { - if (!prog->stages[i]) + if (!prog->modules[i]) continue; VkPipelineShaderStageCreateInfo stage = {}; stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; stage.stage = zink_shader_stage(i); - stage.module = prog->stages[i]->shader; + stage.module = prog->modules[i]->shader; stage.pName = "main"; shader_stages[num_stages++] = stage; } diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 550c0506f42..f8462e04107 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -149,12 +149,12 @@ update_shader_modules(struct zink_context *ctx, struct zink_shader *stages[ZINK_ for (int i = 0; i < ZINK_SHADER_COUNT; ++i) { enum pipe_shader_type type = pipe_shader_type_from_mesa(i); if (dirty[i]) { - prog->stages[type] = CALLOC_STRUCT(zink_shader_module); - assert(prog->stages[type]); - pipe_reference_init(&prog->stages[type]->reference, 1); - prog->stages[type]->shader = zink_shader_compile(zink_screen(ctx->base.screen), dirty[i]); + prog->modules[type] = CALLOC_STRUCT(zink_shader_module); + assert(prog->modules[type]); + pipe_reference_init(&prog->modules[type]->reference, 1); + prog->modules[type]->shader = zink_shader_compile(zink_screen(ctx->base.screen), dirty[i]); } else if (stages[type]) /* reuse existing shader module */ - zink_shader_module_reference(zink_screen(ctx->base.screen), &prog->stages[type], ctx->curr_program->stages[type]); + zink_shader_module_reference(zink_screen(ctx->base.screen), &prog->modules[type], ctx->curr_program->modules[type]); prog->shaders[type] = stages[type]; } ctx->dirty_shader_stages = 0; @@ -194,7 +194,7 @@ zink_create_gfx_program(struct zink_context *ctx, } for (int i = 0; i < ZINK_SHADER_COUNT; ++i) { - if (prog->stages[i]) { + if (prog->modules[i]) { _mesa_set_add(stages[i]->programs, prog); zink_gfx_program_reference(screen, NULL, prog); } @@ -245,8 +245,8 @@ zink_destroy_gfx_program(struct zink_screen *screen, for (int i = 0; i < ZINK_SHADER_COUNT; ++i) { if (prog->shaders[i]) gfx_program_remove_shader(prog, prog->shaders[i]); - if (prog->stages[i]) - zink_shader_module_reference(screen, &prog->stages[i], NULL); + if (prog->modules[i]) + zink_shader_module_reference(screen, &prog->modules[i], NULL); } /* unref all used render-passes */ diff --git a/src/gallium/drivers/zink/zink_program.h b/src/gallium/drivers/zink/zink_program.h index c82d409d673..9e7582e52c2 100644 --- a/src/gallium/drivers/zink/zink_program.h +++ b/src/gallium/drivers/zink/zink_program.h @@ -46,7 +46,7 @@ struct zink_shader_module { struct zink_gfx_program { struct pipe_reference reference; - struct zink_shader_module *stages[ZINK_SHADER_COUNT]; // compute stage doesn't belong here + struct zink_shader_module *modules[ZINK_SHADER_COUNT]; // compute stage doesn't belong here struct zink_shader *shaders[ZINK_SHADER_COUNT]; VkDescriptorSetLayout dsl; VkPipelineLayout layout; -- 2.30.2