[Mesa-dev] [PATCH 06/12] sso: rename Shader to the pointer _Shader

Gregory Hainaut gregory.hainaut at gmail.com
Fri May 3 10:44:10 PDT 2013


Basically a sed but shaderapi.c and get.c.
get.c => GL_CURRENT_PROGAM always refer to the "old" UseProgram behavior
shaderapi.c => the old api stil update the Shader object directly

V2: formatting improvement
---
 src/mesa/drivers/common/meta.c                   |   10 ++--
 src/mesa/drivers/dri/i965/brw_gs.c               |    2 +-
 src/mesa/drivers/dri/i965/brw_shader.cpp         |    4 +-
 src/mesa/drivers/dri/i965/brw_vs.c               |    4 +-
 src/mesa/drivers/dri/i965/brw_vs_surface_state.c |    2 +-
 src/mesa/drivers/dri/i965/brw_wm.c               |    2 +-
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |    2 +-
 src/mesa/drivers/dri/i965/gen6_sol.c             |    6 +-
 src/mesa/drivers/dri/i965/gen6_vs_state.c        |    2 +-
 src/mesa/drivers/dri/i965/gen6_wm_state.c        |    2 +-
 src/mesa/drivers/dri/i965/gen7_sol_state.c       |    4 +-
 src/mesa/drivers/dri/i965/gen7_vs_state.c        |    2 +-
 src/mesa/drivers/dri/i965/gen7_wm_state.c        |    2 +-
 src/mesa/main/api_validate.c                     |    2 +-
 src/mesa/main/context.c                          |   32 +++++------
 src/mesa/main/ff_fragment_shader.cpp             |    8 +--
 src/mesa/main/get.c                              |   10 ++++
 src/mesa/main/shaderapi.c                        |   26 ++++-----
 src/mesa/main/state.c                            |   14 ++---
 src/mesa/main/texstate.c                         |   12 ++--
 src/mesa/main/transformfeedback.c                |    4 +-
 src/mesa/main/uniform_query.cpp                  |    4 +-
 src/mesa/main/uniforms.c                         |   66 +++++++++++-----------
 src/mesa/program/ir_to_mesa.cpp                  |   12 ++--
 src/mesa/state_tracker/st_atom_clip.c            |    2 +-
 src/mesa/state_tracker/st_atom_constbuf.c        |    4 +-
 src/mesa/state_tracker/st_cb_drawpixels.c        |    2 +-
 src/mesa/state_tracker/st_draw.c                 |    6 +-
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp       |    2 +-
 src/mesa/state_tracker/st_program.c              |    6 +-
 src/mesa/swrast/s_fragprog.c                     |    2 +-
 31 files changed, 134 insertions(+), 124 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index e3ab82b..927573d 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -617,13 +617,13 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
 
       if (ctx->Extensions.ARB_shader_objects) {
 	 _mesa_reference_shader_program(ctx, &save->VertexShader,
-					ctx->Shader.CurrentVertexProgram);
+					ctx->_Shader->CurrentVertexProgram);
 	 _mesa_reference_shader_program(ctx, &save->GeometryShader,
-					ctx->Shader.CurrentGeometryProgram);
+					ctx->_Shader->CurrentGeometryProgram);
 	 _mesa_reference_shader_program(ctx, &save->FragmentShader,
-					ctx->Shader.CurrentFragmentProgram);
+					ctx->_Shader->CurrentFragmentProgram);
 	 _mesa_reference_shader_program(ctx, &save->ActiveShader,
-					ctx->Shader.ActiveProgram);
+					ctx->_Shader->ActiveProgram);
 
          _mesa_UseProgram(0);
       }
@@ -965,7 +965,7 @@ _mesa_meta_end(struct gl_context *ctx)
 	 _mesa_use_shader_program(ctx, GL_FRAGMENT_SHADER,
 				  save->FragmentShader);
 
-      _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram,
+      _mesa_reference_shader_program(ctx, &ctx->_Shader->ActiveProgram,
 				     save->ActiveShader);
 
       _mesa_reference_shader_program(ctx, &save->VertexShader, NULL);
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index caa3b3e..31b01df 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -189,7 +189,7 @@ static void populate_key( struct brw_context *brw,
       /* _NEW_TRANSFORM_FEEDBACK */
       if (_mesa_is_xfb_active_and_unpaused(ctx)) {
          const struct gl_shader_program *shaderprog =
-            ctx->Shader.CurrentVertexProgram;
+            ctx->_Shader->CurrentVertexProgram;
          const struct gl_transform_feedback_info *linked_xfb_info =
             &shaderprog->LinkedTransformFeedback;
          int i;
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index b3bd1b9..7259fde 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -257,7 +257,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
 
       _mesa_reference_program(ctx, &prog, NULL);
 
-      if (ctx->Shader.Flags & GLSL_DUMP) {
+      if (ctx->_Shader->Flags & GLSL_DUMP) {
          printf("\n");
          printf("GLSL IR for linked %s program %d:\n", target_strings[stage],
                 shProg->Name);
@@ -266,7 +266,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
       }
    }
 
-   if (ctx->Shader.Flags & GLSL_DUMP) {
+   if (ctx->_Shader->Flags & GLSL_DUMP) {
       for (unsigned i = 0; i < shProg->NumShaders; i++) {
          const struct gl_shader *sh = shProg->Shaders[i];
          if (!sh)
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 998edb0..0478ad7 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -178,7 +178,7 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vue_map *vue_map,
  */
 gl_clip_plane *brw_select_clip_planes(struct gl_context *ctx)
 {
-   if (ctx->Shader.CurrentVertexProgram) {
+   if (ctx->_Shader->CurrentVertexProgram) {
       /* There is currently a GLSL vertex shader, so clip according to GLSL
        * rules, which means compare gl_ClipVertex (or gl_Position, if
        * gl_ClipVertex wasn't assigned) against the eye-coordinate clip planes
@@ -519,7 +519,7 @@ static void brw_upload_vs_prog(struct brw_context *brw)
    if (!brw_search_cache(&brw->cache, BRW_VS_PROG,
 			 &key, sizeof(key),
 			 &brw->vs.prog_offset, &brw->vs.prog_data)) {
-      bool success = do_vs_prog(brw, ctx->Shader.CurrentVertexProgram,
+      bool success = do_vs_prog(brw, ctx->_Shader->CurrentVertexProgram,
 				vp, &key);
 
       assert(success);
diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
index 968cc03..f68ba40 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
@@ -111,7 +111,7 @@ brw_upload_vs_ubo_surfaces(struct brw_context *brw)
 {
    struct gl_context *ctx = &brw->intel.ctx;
    /* _NEW_PROGRAM */
-   struct gl_shader_program *prog = ctx->Shader.CurrentVertexProgram;
+   struct gl_shader_program *prog = ctx->_Shader->CurrentVertexProgram;
 
    if (!prog)
       return;
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 9b30ba1..0ed248e 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -487,7 +487,7 @@ brw_upload_wm_prog(struct brw_context *brw)
    if (!brw_search_cache(&brw->cache, BRW_WM_PROG,
 			 &key, sizeof(key),
 			 &brw->wm.prog_offset, &brw->wm.prog_data)) {
-      bool success = do_wm_prog(brw, ctx->Shader._CurrentFragmentProgram, fp,
+      bool success = do_wm_prog(brw, ctx->_Shader->_CurrentFragmentProgram, fp,
 				&key);
       (void) success;
       assert(success);
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index a74b2c7..572a78d 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1458,7 +1458,7 @@ brw_upload_wm_ubo_surfaces(struct brw_context *brw)
 {
    struct gl_context *ctx = &brw->intel.ctx;
    /* _NEW_PROGRAM */
-   struct gl_shader_program *prog = ctx->Shader._CurrentFragmentProgram;
+   struct gl_shader_program *prog = ctx->_Shader->_CurrentFragmentProgram;
 
    if (!prog)
       return;
diff --git a/src/mesa/drivers/dri/i965/gen6_sol.c b/src/mesa/drivers/dri/i965/gen6_sol.c
index cf7a60d..0a85d73 100644
--- a/src/mesa/drivers/dri/i965/gen6_sol.c
+++ b/src/mesa/drivers/dri/i965/gen6_sol.c
@@ -42,7 +42,7 @@ gen6_update_sol_surfaces(struct brw_context *brw)
       ctx->TransformFeedback.CurrentObject;
    /* BRW_NEW_VERTEX_PROGRAM */
    const struct gl_shader_program *shaderprog =
-      ctx->Shader.CurrentVertexProgram;
+      ctx->_Shader->CurrentVertexProgram;
    const struct gl_transform_feedback_info *linked_xfb_info =
       &shaderprog->LinkedTransformFeedback;
    int i;
@@ -87,7 +87,7 @@ brw_gs_upload_binding_table(struct brw_context *brw)
    struct gl_context *ctx = &brw->intel.ctx;
    /* BRW_NEW_VERTEX_PROGRAM */
    const struct gl_shader_program *shaderprog =
-      ctx->Shader.CurrentVertexProgram;
+      ctx->_Shader->CurrentVertexProgram;
    bool has_surfaces = false;
    uint32_t *bind;
 
@@ -161,7 +161,7 @@ brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
    struct brw_context *brw = brw_context(ctx);
    struct intel_context *intel = &brw->intel;
    const struct gl_shader_program *vs_prog =
-      ctx->Shader.CurrentVertexProgram;
+      ctx->_Shader->CurrentVertexProgram;
    const struct gl_transform_feedback_info *linked_xfb_info =
       &vs_prog->LinkedTransformFeedback;
    struct gl_transform_feedback_object *xfb_obj =
diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c
index ae1a841..4c53a0f 100644
--- a/src/mesa/drivers/dri/i965/gen6_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c
@@ -139,7 +139,7 @@ upload_vs_state(struct brw_context *brw)
    /* Use ALT floating point mode for ARB vertex programs, because they
     * require 0^0 == 1.
     */
-   if (intel->ctx.Shader.CurrentVertexProgram == NULL)
+   if (intel->ctx._Shader->CurrentVertexProgram == NULL)
       floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT;
 
    BEGIN_BATCH(6);
diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c
index 5cc0a61..5a2f6dc 100644
--- a/src/mesa/drivers/dri/i965/gen6_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c
@@ -138,7 +138,7 @@ upload_wm_state(struct brw_context *brw)
     * rendering, CurrentFragmentProgram is used for this check to
     * differentiate between the GLSL and non-GLSL cases.
     */
-   if (ctx->Shader.CurrentFragmentProgram == NULL)
+   if (ctx->_Shader->CurrentFragmentProgram == NULL)
       dw2 |= GEN6_WM_FLOATING_POINT_MODE_ALT;
 
    /* CACHE_NEW_SAMPLER */
diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c b/src/mesa/drivers/dri/i965/gen7_sol_state.c
index 03709ea..5ec89e2 100644
--- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
@@ -42,7 +42,7 @@ upload_3dstate_so_buffers(struct brw_context *brw)
    struct gl_context *ctx = &intel->ctx;
    /* BRW_NEW_VERTEX_PROGRAM */
    const struct gl_shader_program *vs_prog =
-      ctx->Shader.CurrentVertexProgram;
+      ctx->_Shader->CurrentVertexProgram;
    const struct gl_transform_feedback_info *linked_xfb_info =
       &vs_prog->LinkedTransformFeedback;
    /* _NEW_TRANSFORM_FEEDBACK */
@@ -115,7 +115,7 @@ upload_3dstate_so_decl_list(struct brw_context *brw,
    struct gl_context *ctx = &intel->ctx;
    /* BRW_NEW_VERTEX_PROGRAM */
    const struct gl_shader_program *vs_prog =
-      ctx->Shader.CurrentVertexProgram;
+      ctx->_Shader->CurrentVertexProgram;
    /* _NEW_TRANSFORM_FEEDBACK */
    const struct gl_transform_feedback_info *linked_xfb_info =
       &vs_prog->LinkedTransformFeedback;
diff --git a/src/mesa/drivers/dri/i965/gen7_vs_state.c b/src/mesa/drivers/dri/i965/gen7_vs_state.c
index 1b97e8c..61df6c1 100644
--- a/src/mesa/drivers/dri/i965/gen7_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_vs_state.c
@@ -80,7 +80,7 @@ upload_vs_state(struct brw_context *brw)
    /* Use ALT floating point mode for ARB vertex programs, because they
     * require 0^0 == 1.
     */
-   if (intel->ctx.Shader.CurrentVertexProgram == NULL)
+   if (intel->ctx._Shader->CurrentVertexProgram == NULL)
       floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT;
 
    BEGIN_BATCH(6);
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c
index b025551..a7839bc 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c
@@ -169,7 +169,7 @@ upload_ps_state(struct brw_context *brw)
     * rendering, CurrentFragmentProgram is used for this check to
     * differentiate between the GLSL and non-GLSL cases.
     */
-   if (intel->ctx.Shader.CurrentFragmentProgram == NULL)
+   if (intel->ctx._Shader->CurrentFragmentProgram == NULL)
       dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT;
 
    if (intel->is_haswell)
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 53b0021..05c9b12 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -129,7 +129,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
    case API_OPENGL_CORE:
       {
          const struct gl_shader_program *vsProg =
-            ctx->Shader.CurrentVertexProgram;
+            ctx->_Shader->CurrentVertexProgram;
          GLboolean haveVertexShader = (vsProg && vsProg->LinkStatus);
          GLboolean haveVertexProgram = ctx->VertexProgram._Enabled;
          if (haveVertexShader || haveVertexProgram) {
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index d089827..6a0619a 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1781,10 +1781,10 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
    if (ctx->NewState)
       _mesa_update_state(ctx);
 
-   if (ctx->Shader.CurrentVertexProgram) {
+   if (ctx->_Shader->CurrentVertexProgram) {
       vert_from_glsl_shader = true;
 
-      if (!ctx->Shader.CurrentVertexProgram->LinkStatus) {
+      if (!ctx->_Shader->CurrentVertexProgram->LinkStatus) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "%s(shader not linked)", where);
          return GL_FALSE;
@@ -1793,19 +1793,19 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
       {
          char errMsg[100];
          if (!_mesa_validate_shader_program(ctx,
-					    ctx->Shader.CurrentVertexProgram,
+					    ctx->_Shader->CurrentVertexProgram,
                                             errMsg)) {
             _mesa_warning(ctx, "Shader program %u is invalid: %s",
-                          ctx->Shader.CurrentVertexProgram->Name, errMsg);
+                          ctx->_Shader->CurrentVertexProgram->Name, errMsg);
          }
       }
 #endif
    }
 
-   if (ctx->Shader.CurrentGeometryProgram) {
+   if (ctx->_Shader->CurrentGeometryProgram) {
       geom_from_glsl_shader = true;
 
-      if (!ctx->Shader.CurrentGeometryProgram->LinkStatus) {
+      if (!ctx->_Shader->CurrentGeometryProgram->LinkStatus) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "%s(shader not linked)", where);
          return GL_FALSE;
@@ -1814,19 +1814,19 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
       {
          char errMsg[100];
          if (!_mesa_validate_shader_program(ctx,
-					    ctx->Shader.CurrentGeometryProgram,
+					    ctx->_Shader->CurrentGeometryProgram,
                                             errMsg)) {
             _mesa_warning(ctx, "Shader program %u is invalid: %s",
-                          ctx->Shader.CurrentGeometryProgram->Name, errMsg);
+                          ctx->_Shader->CurrentGeometryProgram->Name, errMsg);
          }
       }
 #endif
    }
 
-   if (ctx->Shader.CurrentFragmentProgram) {
+   if (ctx->_Shader->CurrentFragmentProgram) {
       frag_from_glsl_shader = true;
 
-      if (!ctx->Shader.CurrentFragmentProgram->LinkStatus) {
+      if (!ctx->_Shader->CurrentFragmentProgram->LinkStatus) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "%s(shader not linked)", where);
          return GL_FALSE;
@@ -1835,10 +1835,10 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
       {
          char errMsg[100];
          if (!_mesa_validate_shader_program(ctx,
-					    ctx->Shader.CurrentFragmentProgram,
+					    ctx->_Shader->CurrentFragmentProgram,
                                             errMsg)) {
             _mesa_warning(ctx, "Shader program %u is invalid: %s",
-                          ctx->Shader.CurrentFragmentProgram->Name, errMsg);
+                          ctx->_Shader->CurrentFragmentProgram->Name, errMsg);
          }
       }
 #endif
@@ -1887,13 +1887,13 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
    }
 
 #ifdef DEBUG
-   if (ctx->Shader.Flags & GLSL_LOG) {
+   if (ctx->_Shader->Flags & GLSL_LOG) {
       struct gl_shader_program *shProg[MESA_SHADER_TYPES];
       gl_shader_type i;
 
-      shProg[MESA_SHADER_VERTEX] = ctx->Shader.CurrentVertexProgram;
-      shProg[MESA_SHADER_GEOMETRY] = ctx->Shader.CurrentGeometryProgram;
-      shProg[MESA_SHADER_FRAGMENT] = ctx->Shader.CurrentFragmentProgram;
+      shProg[MESA_SHADER_VERTEX] = ctx->_Shader->CurrentVertexProgram;
+      shProg[MESA_SHADER_GEOMETRY] = ctx->_Shader->CurrentGeometryProgram;
+      shProg[MESA_SHADER_FRAGMENT] = ctx->_Shader->CurrentFragmentProgram;
 
       for (i = 0; i < MESA_SHADER_TYPES; i++) {
 	 if (shProg[i] == NULL || shProg[i]->_Used
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index 01a4542..6c25864 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -318,9 +318,9 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx )
 {
    /* _NEW_PROGRAM */
    const GLboolean vertexShader =
-      (ctx->Shader.CurrentVertexProgram &&
-       ctx->Shader.CurrentVertexProgram->LinkStatus &&
-       ctx->Shader.CurrentVertexProgram->_LinkedShaders[MESA_SHADER_VERTEX]);
+      (ctx->_Shader->CurrentVertexProgram &&
+       ctx->_Shader->CurrentVertexProgram->LinkStatus &&
+       ctx->_Shader->CurrentVertexProgram->_LinkedShaders[MESA_SHADER_VERTEX]);
    const GLboolean vertexProgram = ctx->VertexProgram._Enabled;
    GLbitfield fp_inputs = 0x0;
 
@@ -384,7 +384,7 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx )
        * validation (see additional comments in state.c).
        */
       if (vertexShader)
-         vprog = ctx->Shader.CurrentVertexProgram->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
+         vprog = ctx->_Shader->CurrentVertexProgram->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
       else
          vprog = &ctx->VertexProgram.Current->Base;
 
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 6a897cb..54159c0 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -778,6 +778,16 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
       v->value_int = ctx->TransformFeedback.CurrentObject->Name;
       break;
    case GL_CURRENT_PROGRAM:
+      /* Changelog of the ARB_separate_shader_objects spec */
+      /*
+       * Rev 24    pbrown    Remove the language erroneously deleting
+       * CURRENT_PROGRAM.  In the EXT extension, this token was aliased to
+       * ACTIVE_PROGRAM_EXT, and was used to indicate the last program set by
+       * either ActiveProgramEXT or UseProgram.  In the ARB extension, the SSO
+       * active programs are now program pipeline object state and
+       * CURRENT_PROGRAM should still be used to query the last program set by
+       * UseProgram (bug 7822).
+       */
       v->value_int =
 	 ctx->Shader.ActiveProgram ? ctx->Shader.ActiveProgram->Name : 0;
       break;
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index c25f49f..c82eba8 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -452,8 +452,8 @@ static GLuint
 get_handle(struct gl_context *ctx, GLenum pname)
 {
    if (pname == GL_PROGRAM_OBJECT_ARB) {
-      if (ctx->Shader.ActiveProgram)
-         return ctx->Shader.ActiveProgram->Name;
+      if (ctx->_Shader->ActiveProgram)
+         return ctx->_Shader->ActiveProgram->Name;
       else
          return 0;
    }
@@ -765,7 +765,7 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
    _mesa_glsl_compile_shader(ctx, sh);
 
    if (sh->CompileStatus == GL_FALSE && 
-       (ctx->Shader.Flags & GLSL_REPORT_ERRORS)) {
+       (ctx->_Shader->Flags & GLSL_REPORT_ERRORS)) {
       _mesa_debug(ctx, "Error compiling shader %u:\n%s\n",
                   sh->Name, sh->InfoLog);
    }
@@ -787,9 +787,9 @@ link_program(struct gl_context *ctx, GLuint program)
       return;
 
    if (obj->Active
-       && (shProg == ctx->Shader.CurrentVertexProgram
-	   || shProg == ctx->Shader.CurrentGeometryProgram
-	   || shProg == ctx->Shader.CurrentFragmentProgram)) {
+       && (shProg == ctx->_Shader->CurrentVertexProgram
+	   || shProg == ctx->_Shader->CurrentGeometryProgram
+	   || shProg == ctx->_Shader->CurrentFragmentProgram)) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glLinkProgram(transform feedback active)");
       return;
@@ -800,7 +800,7 @@ link_program(struct gl_context *ctx, GLuint program)
    _mesa_glsl_link_shader(ctx, shProg);
 
    if (shProg->LinkStatus == GL_FALSE && 
-       (ctx->Shader.Flags & GLSL_REPORT_ERRORS)) {
+       (ctx->_Shader->Flags & GLSL_REPORT_ERRORS)) {
       _mesa_debug(ctx, "Error linking program %u:\n%s\n",
                   shProg->Name, shProg->InfoLog);
    }
@@ -890,21 +890,21 @@ use_shader_program(struct gl_context *ctx, GLenum type,
 
    switch (type) {
    case GL_VERTEX_SHADER:
-      target = &ctx->Shader.CurrentVertexProgram;
+      target = &ctx->_Shader->CurrentVertexProgram;
       if ((shProg == NULL)
 	  || (shProg->_LinkedShaders[MESA_SHADER_VERTEX] == NULL)) {
 	 shProg = NULL;
       }
       break;
    case GL_GEOMETRY_SHADER_ARB:
-      target = &ctx->Shader.CurrentGeometryProgram;
+      target = &ctx->_Shader->CurrentGeometryProgram;
       if ((shProg == NULL)
 	  || (shProg->_LinkedShaders[MESA_SHADER_GEOMETRY] == NULL)) {
 	 shProg = NULL;
       }
       break;
    case GL_FRAGMENT_SHADER:
-      target = &ctx->Shader.CurrentFragmentProgram;
+      target = &ctx->_Shader->CurrentFragmentProgram;
       if ((shProg == NULL)
 	  || (shProg->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL)) {
 	 shProg = NULL;
@@ -929,9 +929,9 @@ use_shader_program(struct gl_context *ctx, GLenum type,
 	 /* Empty for now. */
 	 break;
       case GL_FRAGMENT_SHADER:
-	 if (*target == ctx->Shader._CurrentFragmentProgram) {
+	 if (*target == ctx->_Shader->_CurrentFragmentProgram) {
 	    _mesa_reference_shader_program(ctx,
-					   &ctx->Shader._CurrentFragmentProgram,
+					   &ctx->_Shader->_CurrentFragmentProgram,
 					   NULL);
 	 }
 	 break;
@@ -1450,7 +1450,7 @@ _mesa_UseProgram(GLhandleARB program)
       }
 
       /* debug code */
-      if (ctx->Shader.Flags & GLSL_USE_PROG) {
+      if (ctx->_Shader->Flags & GLSL_USE_PROG) {
          print_shader_info(shProg);
       }
    }
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 251c1ae..eb4dd95 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -104,9 +104,9 @@ update_program_enables(struct gl_context *ctx)
 static GLbitfield
 update_program(struct gl_context *ctx)
 {
-   const struct gl_shader_program *vsProg = ctx->Shader.CurrentVertexProgram;
-   const struct gl_shader_program *gsProg = ctx->Shader.CurrentGeometryProgram;
-   struct gl_shader_program *fsProg = ctx->Shader.CurrentFragmentProgram;
+   const struct gl_shader_program *vsProg = ctx->_Shader->CurrentVertexProgram;
+   const struct gl_shader_program *gsProg = ctx->_Shader->CurrentGeometryProgram;
+   struct gl_shader_program *fsProg = ctx->_Shader->CurrentFragmentProgram;
    const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current;
    const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current;
    const struct gl_geometry_program *prevGP = ctx->GeometryProgram._Current;
@@ -132,7 +132,7 @@ update_program(struct gl_context *ctx)
        && fsProg->_LinkedShaders[MESA_SHADER_FRAGMENT]) {
       /* Use GLSL fragment shader */
       _mesa_reference_shader_program(ctx,
-				     &ctx->Shader._CurrentFragmentProgram,
+				     &ctx->_Shader->_CurrentFragmentProgram,
 				     fsProg);
       _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
                                gl_fragment_program(fsProg->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program));
@@ -142,7 +142,7 @@ update_program(struct gl_context *ctx)
    else if (ctx->FragmentProgram._Enabled) {
       /* Use user-defined fragment program */
       _mesa_reference_shader_program(ctx,
-				     &ctx->Shader._CurrentFragmentProgram,
+				     &ctx->_Shader->_CurrentFragmentProgram,
 				     NULL);
       _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
                                ctx->FragmentProgram.Current);
@@ -154,7 +154,7 @@ update_program(struct gl_context *ctx)
       struct gl_shader_program *f = _mesa_get_fixed_func_fragment_program(ctx);
 
       _mesa_reference_shader_program(ctx,
-				     &ctx->Shader._CurrentFragmentProgram,
+				     &ctx->_Shader->_CurrentFragmentProgram,
 				     f);
       _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
 			       gl_fragment_program(f->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program));
@@ -314,7 +314,7 @@ update_multisample(struct gl_context *ctx)
 static void
 update_twoside(struct gl_context *ctx)
 {
-   if (ctx->Shader.CurrentVertexProgram ||
+   if (ctx->_Shader->CurrentVertexProgram ||
        ctx->VertexProgram._Enabled) {
       ctx->VertexProgram._TwoSideEnabled = ctx->VertexProgram.TwoSideEnabled;
    } else {
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index d44cd7c..b4cfbf1 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -531,14 +531,14 @@ update_texture_state( struct gl_context *ctx )
    struct gl_program *vprog = NULL;
    GLbitfield enabledFragUnits = 0x0;
 
-   if (ctx->Shader.CurrentVertexProgram &&
-       ctx->Shader.CurrentVertexProgram->LinkStatus) {
-      vprog = ctx->Shader.CurrentVertexProgram->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
+   if (ctx->_Shader->CurrentVertexProgram &&
+       ctx->_Shader->CurrentVertexProgram->LinkStatus) {
+      vprog = ctx->_Shader->CurrentVertexProgram->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
    }
 
-   if (ctx->Shader.CurrentFragmentProgram &&
-       ctx->Shader.CurrentFragmentProgram->LinkStatus) {
-      fprog = ctx->Shader.CurrentFragmentProgram->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program;
+   if (ctx->_Shader->CurrentFragmentProgram &&
+       ctx->_Shader->CurrentFragmentProgram->LinkStatus) {
+      fprog = ctx->_Shader->CurrentFragmentProgram->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program;
    }
    else if (ctx->FragmentProgram._Enabled) {
       fprog = &ctx->FragmentProgram.Current->Base;
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index fd4718d..c90c4fa 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -341,13 +341,13 @@ _mesa_BeginTransformFeedback(GLenum mode)
 
    obj = ctx->TransformFeedback.CurrentObject;
 
-   if (ctx->Shader.CurrentVertexProgram == NULL) {
+   if (ctx->_Shader->CurrentVertexProgram == NULL) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glBeginTransformFeedback(no program active)");
       return;
    }
 
-   info = &ctx->Shader.CurrentVertexProgram->LinkedTransformFeedback;
+   info = &ctx->_Shader->CurrentVertexProgram->LinkedTransformFeedback;
 
    if (info->NumOutputs == 0) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index b8335fe..59f3ad1 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -690,7 +690,7 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
       return;
    }
 
-   if (ctx->Shader.Flags & GLSL_UNIFORMS) {
+   if (ctx->_Shader->Flags & GLSL_UNIFORMS) {
       log_uniform(values, basicType, components, 1, count,
 		  false, shProg, location, uni);
    }
@@ -877,7 +877,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
       }
    }
 
-   if (ctx->Shader.Flags & GLSL_UNIFORMS) {
+   if (ctx->_Shader->Flags & GLSL_UNIFORMS) {
       log_uniform(values, GLSL_TYPE_FLOAT, components, vectors, count,
 		  bool(transpose), shProg, location, uni);
    }
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 9529593..e26fb0a 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -131,7 +131,7 @@ void GLAPIENTRY
 _mesa_Uniform1f(GLint location, GLfloat v0)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_FLOAT);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GL_FLOAT);
 }
 
 void GLAPIENTRY
@@ -141,7 +141,7 @@ _mesa_Uniform2f(GLint location, GLfloat v0, GLfloat v1)
    GLfloat v[2];
    v[0] = v0;
    v[1] = v1;
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC2);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_FLOAT_VEC2);
 }
 
 void GLAPIENTRY
@@ -152,7 +152,7 @@ _mesa_Uniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
    v[0] = v0;
    v[1] = v1;
    v[2] = v2;
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC3);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_FLOAT_VEC3);
 }
 
 void GLAPIENTRY
@@ -165,14 +165,14 @@ _mesa_Uniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
    v[1] = v1;
    v[2] = v2;
    v[3] = v3;
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC4);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_FLOAT_VEC4);
 }
 
 void GLAPIENTRY
 _mesa_Uniform1i(GLint location, GLint v0)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_INT);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GL_INT);
 }
 
 void GLAPIENTRY
@@ -182,7 +182,7 @@ _mesa_Uniform2i(GLint location, GLint v0, GLint v1)
    GLint v[2];
    v[0] = v0;
    v[1] = v1;
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC2);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_INT_VEC2);
 }
 
 void GLAPIENTRY
@@ -193,7 +193,7 @@ _mesa_Uniform3i(GLint location, GLint v0, GLint v1, GLint v2)
    v[0] = v0;
    v[1] = v1;
    v[2] = v2;
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC3);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_INT_VEC3);
 }
 
 void GLAPIENTRY
@@ -205,63 +205,63 @@ _mesa_Uniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
    v[1] = v1;
    v[2] = v2;
    v[3] = v3;
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC4);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_INT_VEC4);
 }
 
 void GLAPIENTRY
 _mesa_Uniform1fv(GLint location, GLsizei count, const GLfloat * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT);
 }
 
 void GLAPIENTRY
 _mesa_Uniform2fv(GLint location, GLsizei count, const GLfloat * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC2);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT_VEC2);
 }
 
 void GLAPIENTRY
 _mesa_Uniform3fv(GLint location, GLsizei count, const GLfloat * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC3);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT_VEC3);
 }
 
 void GLAPIENTRY
 _mesa_Uniform4fv(GLint location, GLsizei count, const GLfloat * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC4);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_FLOAT_VEC4);
 }
 
 void GLAPIENTRY
 _mesa_Uniform1iv(GLint location, GLsizei count, const GLint * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT);
 }
 
 void GLAPIENTRY
 _mesa_Uniform2iv(GLint location, GLsizei count, const GLint * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC2);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT_VEC2);
 }
 
 void GLAPIENTRY
 _mesa_Uniform3iv(GLint location, GLsizei count, const GLint * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC3);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT_VEC3);
 }
 
 void GLAPIENTRY
 _mesa_Uniform4iv(GLint location, GLsizei count, const GLint * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC4);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_INT_VEC4);
 }
 
 /** Same as above with direct state access **/
@@ -467,7 +467,7 @@ void GLAPIENTRY
 _mesa_Uniform1ui(GLint location, GLuint v0)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_UNSIGNED_INT);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, &v0, GL_UNSIGNED_INT);
 }
 
 void GLAPIENTRY
@@ -477,7 +477,7 @@ _mesa_Uniform2ui(GLint location, GLuint v0, GLuint v1)
    GLuint v[2];
    v[0] = v0;
    v[1] = v1;
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC2);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC2);
 }
 
 void GLAPIENTRY
@@ -488,7 +488,7 @@ _mesa_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
    v[0] = v0;
    v[1] = v1;
    v[2] = v2;
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC3);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC3);
 }
 
 void GLAPIENTRY
@@ -500,35 +500,35 @@ _mesa_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
    v[1] = v1;
    v[2] = v2;
    v[3] = v3;
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC4);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC4);
 }
 
 void GLAPIENTRY
 _mesa_Uniform1uiv(GLint location, GLsizei count, const GLuint *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT);
 }
 
 void GLAPIENTRY
 _mesa_Uniform2uiv(GLint location, GLsizei count, const GLuint *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC2);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC2);
 }
 
 void GLAPIENTRY
 _mesa_Uniform3uiv(GLint location, GLsizei count, const GLuint *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC3);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC3);
 }
 
 void GLAPIENTRY
 _mesa_Uniform4uiv(GLint location, GLsizei count, const GLuint *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC4);
+   _mesa_uniform(ctx, ctx->_Shader->ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC4);
 }
 
 
@@ -538,7 +538,7 @@ _mesa_UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
                           const GLfloat * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+   _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
 			2, 2, location, count, transpose, value);
 }
 
@@ -547,7 +547,7 @@ _mesa_UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose,
                           const GLfloat * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+   _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
 			3, 3, location, count, transpose, value);
 }
 
@@ -556,7 +556,7 @@ _mesa_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
                           const GLfloat * value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+   _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
 			4, 4, location, count, transpose, value);
 }
 
@@ -704,7 +704,7 @@ _mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
                          const GLfloat *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+   _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
 			2, 3, location, count, transpose, value);
 }
 
@@ -713,7 +713,7 @@ _mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
                          const GLfloat *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+   _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
 			3, 2, location, count, transpose, value);
 }
 
@@ -722,7 +722,7 @@ _mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
                          const GLfloat *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+   _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
 			2, 4, location, count, transpose, value);
 }
 
@@ -731,7 +731,7 @@ _mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
                          const GLfloat *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+   _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
 			4, 2, location, count, transpose, value);
 }
 
@@ -740,7 +740,7 @@ _mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
                          const GLfloat *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+   _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
 			3, 4, location, count, transpose, value);
 }
 
@@ -749,7 +749,7 @@ _mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
                          const GLfloat *value)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+   _mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
 			4, 3, location, count, transpose, value);
 }
 
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 14cf5ba..fb04f33 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2922,7 +2922,7 @@ get_mesa_program(struct gl_context *ctx,
 
    set_branchtargets(&v, mesa_instructions, num_instructions);
 
-   if (ctx->Shader.Flags & GLSL_DUMP) {
+   if (ctx->_Shader->Flags & GLSL_DUMP) {
       printf("\n");
       printf("GLSL IR for linked %s program %d:\n", target_string,
 	     shader_program->Name);
@@ -2957,7 +2957,7 @@ get_mesa_program(struct gl_context *ctx,
 
    _mesa_reference_program(ctx, &shader->Program, prog);
 
-   if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) {
+   if ((ctx->_Shader->Flags & GLSL_NO_OPT) == 0) {
       _mesa_optimize_program(ctx, prog);
    }
 
@@ -3099,7 +3099,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
    state->error = glcpp_preprocess(state, &source, &state->info_log,
 			     &ctx->Extensions, ctx);
 
-   if (ctx->Shader.Flags & GLSL_DUMP) {
+   if (ctx->_Shader->Flags & GLSL_DUMP) {
       printf("GLSL source for %s shader %d:\n",
 	     _mesa_glsl_shader_target_name(state->target), shader->Name);
       printf("%s\n", shader->Source);
@@ -3137,11 +3137,11 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
 	  sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
    shader->num_builtins_to_link = state->num_builtins_to_link;
 
-   if (ctx->Shader.Flags & GLSL_LOG) {
+   if (ctx->_Shader->Flags & GLSL_LOG) {
       _mesa_write_shader_to_file(shader);
    }
 
-   if (ctx->Shader.Flags & GLSL_DUMP) {
+   if (ctx->_Shader->Flags & GLSL_DUMP) {
       if (shader->CompileStatus) {
 	 printf("GLSL IR for shader %d:\n", shader->Name);
 	 _mesa_print_ir(shader->ir, NULL);
@@ -3197,7 +3197,7 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
       }
    }
 
-   if (ctx->Shader.Flags & GLSL_DUMP) {
+   if (ctx->_Shader->Flags & GLSL_DUMP) {
       if (!prog->LinkStatus) {
 	 printf("GLSL shader program %d failed to link\n", prog->Name);
       }
diff --git a/src/mesa/state_tracker/st_atom_clip.c b/src/mesa/state_tracker/st_atom_clip.c
index 8558d76..64478c1 100644
--- a/src/mesa/state_tracker/st_atom_clip.c
+++ b/src/mesa/state_tracker/st_atom_clip.c
@@ -52,7 +52,7 @@ static void update_clip( struct st_context *st )
    /* if we have a vertex shader that writes clip vertex we need to pass
       the pre-projection transformed coordinates into the driver. */
    if (st->vp) {
-      if (ctx->Shader.CurrentVertexProgram)
+      if (ctx->_Shader->CurrentVertexProgram)
          use_eye = TRUE;
    }
 
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index ed69166..cd9570e 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -206,7 +206,7 @@ static void st_bind_ubos(struct st_context *st,
 
 static void bind_vs_ubos(struct st_context *st)
 {
-   struct gl_shader_program *prog = st->ctx->Shader.CurrentVertexProgram;
+   struct gl_shader_program *prog = st->ctx->_Shader->CurrentVertexProgram;
 
    if (!prog)
       return;
@@ -225,7 +225,7 @@ const struct st_tracked_state st_bind_vs_ubos = {
 
 static void bind_fs_ubos(struct st_context *st)
 {
-   struct gl_shader_program *prog = st->ctx->Shader.CurrentFragmentProgram;
+   struct gl_shader_program *prog = st->ctx->_Shader->CurrentFragmentProgram;
 
    if (!prog)
       return;
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index de7b91f..c0583c1 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -1352,7 +1352,7 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
        !ctx->Stencil.Enabled &&
        !ctx->FragmentProgram.Enabled &&
        !ctx->VertexProgram.Enabled &&
-       !ctx->Shader.CurrentFragmentProgram &&
+       !ctx->_Shader->CurrentFragmentProgram &&
        st_fb_orientation(ctx->ReadBuffer) == st_fb_orientation(ctx->DrawBuffer) &&
        ctx->DrawBuffer->_NumColorDrawBuffers == 1 &&
        !ctx->Query.CondRenderQuery) {
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 437d554..0ff2904 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -131,9 +131,9 @@ static void
 check_uniforms(struct gl_context *ctx)
 {
    struct gl_shader_program *shProg[3] = {
-      ctx->Shader.CurrentVertexProgram,
-      ctx->Shader.CurrentGeometryProgram,
-      ctx->Shader.CurrentFragmentProgram,
+      ctx->_Shader->CurrentVertexProgram,
+      ctx->_Shader->CurrentGeometryProgram,
+      ctx->_Shader->CurrentFragmentProgram,
    };
    unsigned j;
 
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 589c912..ae4177b 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5088,7 +5088,7 @@ get_mesa_program(struct gl_context *ctx,
    /* Write the END instruction. */
    v->emit(NULL, TGSI_OPCODE_END);
 
-   if (ctx->Shader.Flags & GLSL_DUMP) {
+   if (ctx->_Shader->Flags & GLSL_DUMP) {
       printf("\n");
       printf("GLSL IR for linked %s program %d:\n", target_string,
              shader_program->Name);
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 60cc37c..75b124b 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -1117,9 +1117,9 @@ void
 st_print_shaders(struct gl_context *ctx)
 {
    struct gl_shader_program *shProg[3] = {
-      ctx->Shader.CurrentVertexProgram,
-      ctx->Shader.CurrentGeometryProgram,
-      ctx->Shader.CurrentFragmentProgram,
+      ctx->_Shader->CurrentVertexProgram,
+      ctx->_Shader->CurrentGeometryProgram,
+      ctx->_Shader->CurrentFragmentProgram,
    };
    unsigned j;
 
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 1ce2ee4..8726af5 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -182,7 +182,7 @@ init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
    machine->Samplers = program->Base.SamplerUnits;
 
    /* if running a GLSL program (not ARB_fragment_program) */
-   if (ctx->Shader.CurrentFragmentProgram) {
+   if (ctx->_Shader->CurrentFragmentProgram) {
       /* Store front/back facing value */
       machine->Attribs[VARYING_SLOT_FACE][col][0] = 1.0F - span->facing;
    }
-- 
1.7.10.4



More information about the mesa-dev mailing list