diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index f3a32256a63..feeb0f4d432 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -216,9 +216,10 @@ nir_shader_create(void *mem_ctx, } else { shader->info.stage = stage; - /* Assume there is no known next stage, this is the case for - * nir_builder_init_simple_shaders for example. + /* Assume there is no known prev/next stage, this is the case for + * nir_builder_init_simple_shader for example. */ + shader->info.prev_stage = MESA_SHADER_NONE; shader->info.next_stage = MESA_SHADER_NONE; } diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 90c6acfddf1..d55dded461b 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -2623,6 +2623,8 @@ print_shader_info(const struct shader_info *info, FILE *fp) info->workgroup_size_variable ? " (variable)" : ""); } + if (info->prev_stage != MESA_SHADER_NONE) + fprintf(fp, "prev_stage: %s\n", gl_shader_stage_name(info->prev_stage)); if (info->next_stage != MESA_SHADER_NONE) fprintf(fp, "next_stage: %s\n", gl_shader_stage_name(info->next_stage)); diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index a88be726d27..4dfbb90373d 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -52,9 +52,10 @@ typedef struct shader_info { /** The shader stage, such as MESA_SHADER_VERTEX. */ gl_shader_stage stage:8; - /** The shader stage in a non SSO linked program that follows this stage, - * such as MESA_SHADER_FRAGMENT. - */ + /* If the shader is linked, this is the previous shader, else MESA_SHADER_NONE. */ + gl_shader_stage prev_stage:8; + + /* If the shader is linked, this is the next shader, else MESA_SHADER_NONE. */ gl_shader_stage next_stage:8; /* Number of textures used by this shader */