[Mesa-dev] [PATCH 19/70] mesa/compiler: add stage to shader_info

Timothy Arceri timothy.arceri at collabora.com
Fri Nov 11 00:46:01 UTC 2016


This will allow us to simplify the current program logic for SSO.

Also since we aim to detach shader_info from nir_shader this will come
in handy avoiding passing nir_shader around just to keep track of
the stage we are dealing with.
---
 src/compiler/shader_info.h | 3 +++
 src/mesa/main/shaderapi.c  | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
index b449900..1a27bf3 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -30,6 +30,9 @@ extern "C" {
 #endif
 
 typedef struct shader_info {
+   /** The shader stage, such as MESA_SHADER_VERTEX. */
+   gl_shader_stage stage;
+
    const char *name;
 
    /* Descriptive name provided by the client; may be NULL */
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index df932ab..429d93d 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2166,6 +2166,7 @@ _mesa_copy_linked_program_data(const struct gl_shader_program *src,
    struct gl_program *dst = dst_sh->Program;
 
    dst->info.num_images = dst_sh->NumImages;
+   dst->info.stage = dst_sh->Stage;
 
    switch (dst_sh->Stage) {
    case MESA_SHADER_VERTEX:
-- 
2.7.4



More information about the mesa-dev mailing list