zink: rename zink_gfx_program::stages to 'modules'
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 30 Jun 2020 17:01:09 +0000 (13:01 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 7 Aug 2020 12:36:59 +0000 (12:36 +0000)
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 <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5970>

src/gallium/drivers/zink/zink_pipeline.c
src/gallium/drivers/zink/zink_program.c
src/gallium/drivers/zink/zink_program.h

index 637e880eb3ce6b5afa0821ee8f0826373ca50821..976c3afc85775eee9e3a0921f7658002d7ca1cdf 100644 (file)
@@ -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;
    }
index 550c0506f423407606060fb67e5193755429f707..f8462e041071e8cc19c19bff203f5d6434f3fc1c 100644 (file)
@@ -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 */
index c82d409d6735968420704dbe7d972626db7ad770..9e7582e52c2fafee4ac9dc2368e19d79392b96bc 100644 (file)
@@ -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;