st/mesa: unify TCS, TES, GS st_*_program structures
authorMarek Olšák <marek.olsak@amd.com>
Sun, 30 Apr 2017 14:05:42 +0000 (16:05 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 8 May 2017 16:32:00 +0000 (18:32 +0200)
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/state_tracker/st_atom.c
src/mesa/state_tracker/st_atom_constbuf.c
src/mesa/state_tracker/st_atom_shader.c
src/mesa/state_tracker/st_cb_program.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
src/mesa/state_tracker/st_program.c
src/mesa/state_tracker/st_program.h
src/mesa/state_tracker/st_shader_cache.c

index b40ce1e3399fea5cf37fec5a418383132ccc44ef..cbac7629e9c52fe1af165cb7697e21a2a048fa1b 100644 (file)
@@ -65,9 +65,9 @@ static void check_program_state( struct st_context *st )
 {
    struct gl_context *ctx = st->ctx;
    struct st_vertex_program *old_vp = st->vp;
-   struct st_tessctrl_program *old_tcp = st->tcp;
-   struct st_tesseval_program *old_tep = st->tep;
-   struct st_geometry_program *old_gp = st->gp;
+   struct st_common_program *old_tcp = st->tcp;
+   struct st_common_program *old_tep = st->tep;
+   struct st_common_program *old_gp = st->gp;
    struct st_fragment_program *old_fp = st->fp;
 
    struct gl_program *new_vp = ctx->VertexProgram._Current;
@@ -91,21 +91,21 @@ static void check_program_state( struct st_context *st )
       if (old_tcp)
          dirty |= old_tcp->affected_states;
       if (new_tcp)
-         dirty |= st_tessctrl_program(new_tcp)->affected_states;
+         dirty |= st_common_program(new_tcp)->affected_states;
    }
 
    if (unlikely(new_tep != &old_tep->Base)) {
       if (old_tep)
          dirty |= old_tep->affected_states;
       if (new_tep)
-         dirty |= st_tesseval_program(new_tep)->affected_states;
+         dirty |= st_common_program(new_tep)->affected_states;
    }
 
    if (unlikely(new_gp != &old_gp->Base)) {
       if (old_gp)
          dirty |= old_gp->affected_states;
       if (new_gp)
-         dirty |= st_geometry_program(new_gp)->affected_states;
+         dirty |= st_common_program(new_gp)->affected_states;
    }
 
    if (unlikely(new_fp != &old_fp->Base)) {
index 9c04580f08406b8f8b320460b74eb575ebdc99c1..6cbfba7e9c0094889141503d010df8c25cf9a824 100644 (file)
@@ -163,7 +163,7 @@ void st_update_fs_constants(struct st_context *st )
  */
 void st_update_gs_constants(struct st_context *st )
 {
-   struct st_geometry_program *gp = st->gp;
+   struct st_common_program *gp = st->gp;
    struct gl_program_parameter_list *params;
 
    if (gp) {
@@ -176,7 +176,7 @@ void st_update_gs_constants(struct st_context *st )
  */
 void st_update_tcs_constants(struct st_context *st )
 {
-   struct st_tessctrl_program *tcp = st->tcp;
+   struct st_common_program *tcp = st->tcp;
    struct gl_program_parameter_list *params;
 
    if (tcp) {
@@ -189,7 +189,7 @@ void st_update_tcs_constants(struct st_context *st )
  */
 void st_update_tes_constants(struct st_context *st )
 {
-   struct st_tesseval_program *tep = st->tep;
+   struct st_common_program *tep = st->tep;
    struct gl_program_parameter_list *params;
 
    if (tep) {
index 091cbe01a0a8d02d53a1a19b033cad4a63129462..875279da636e2bdd9e97ae9c1ea20beacd22bfb5 100644 (file)
@@ -185,21 +185,21 @@ st_update_vp( struct st_context *st )
 void
 st_update_gp( struct st_context *st )
 {
-   struct st_geometry_program *stgp;
+   struct st_common_program *stgp;
 
    if (!st->ctx->GeometryProgram._Current) {
       cso_set_geometry_shader_handle(st->cso_context, NULL);
-      st_reference_geomprog(st, &st->gp, NULL);
+      st_reference_prog(st, &st->gp, NULL);
       return;
    }
 
-   stgp = st_geometry_program(st->ctx->GeometryProgram._Current);
+   stgp = st_common_program(st->ctx->GeometryProgram._Current);
    assert(stgp->Base.Target == GL_GEOMETRY_PROGRAM_NV);
 
    st->gp_variant = st_get_basic_variant(st, PIPE_SHADER_GEOMETRY,
                                          &stgp->tgsi, &stgp->variants);
 
-   st_reference_geomprog(st, &st->gp, stgp);
+   st_reference_prog(st, &st->gp, stgp);
 
    cso_set_geometry_shader_handle(st->cso_context,
                                   st->gp_variant->driver_shader);
@@ -209,21 +209,21 @@ st_update_gp( struct st_context *st )
 void
 st_update_tcp( struct st_context *st )
 {
-   struct st_tessctrl_program *sttcp;
+   struct st_common_program *sttcp;
 
    if (!st->ctx->TessCtrlProgram._Current) {
       cso_set_tessctrl_shader_handle(st->cso_context, NULL);
-      st_reference_tesscprog(st, &st->tcp, NULL);
+      st_reference_prog(st, &st->tcp, NULL);
       return;
    }
 
-   sttcp = st_tessctrl_program(st->ctx->TessCtrlProgram._Current);
+   sttcp = st_common_program(st->ctx->TessCtrlProgram._Current);
    assert(sttcp->Base.Target == GL_TESS_CONTROL_PROGRAM_NV);
 
    st->tcp_variant = st_get_basic_variant(st, PIPE_SHADER_TESS_CTRL,
                                           &sttcp->tgsi, &sttcp->variants);
 
-   st_reference_tesscprog(st, &st->tcp, sttcp);
+   st_reference_prog(st, &st->tcp, sttcp);
 
    cso_set_tessctrl_shader_handle(st->cso_context,
                                   st->tcp_variant->driver_shader);
@@ -233,21 +233,21 @@ st_update_tcp( struct st_context *st )
 void
 st_update_tep( struct st_context *st )
 {
-   struct st_tesseval_program *sttep;
+   struct st_common_program *sttep;
 
    if (!st->ctx->TessEvalProgram._Current) {
       cso_set_tesseval_shader_handle(st->cso_context, NULL);
-      st_reference_tesseprog(st, &st->tep, NULL);
+      st_reference_prog(st, &st->tep, NULL);
       return;
    }
 
-   sttep = st_tesseval_program(st->ctx->TessEvalProgram._Current);
+   sttep = st_common_program(st->ctx->TessEvalProgram._Current);
    assert(sttep->Base.Target == GL_TESS_EVALUATION_PROGRAM_NV);
 
    st->tep_variant = st_get_basic_variant(st, PIPE_SHADER_TESS_EVAL,
                                           &sttep->tgsi, &sttep->variants);
 
-   st_reference_tesseprog(st, &st->tep, sttep);
+   st_reference_prog(st, &st->tep, sttep);
 
    cso_set_tesseval_shader_handle(st->cso_context,
                                   st->tep_variant->driver_shader);
index b104649b0364cf7a3d2ab1ddba725d2e4443d93b..531d20d20ff7737a94e6782a43709dc529507a74 100644 (file)
@@ -69,18 +69,18 @@ st_new_program(struct gl_context *ctx, GLenum target, GLuint id,
       return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm);
    }
    case GL_GEOMETRY_PROGRAM_NV: {
-      struct st_geometry_program *prog = rzalloc(NULL,
-                                                 struct st_geometry_program);
+      struct st_common_program *prog = rzalloc(NULL,
+                                                 struct st_common_program);
       return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm);
    }
    case GL_TESS_CONTROL_PROGRAM_NV: {
-      struct st_tessctrl_program *prog = rzalloc(NULL,
-                                                 struct st_tessctrl_program);
+      struct st_common_program *prog = rzalloc(NULL,
+                                                 struct st_common_program);
       return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm);
    }
    case GL_TESS_EVALUATION_PROGRAM_NV: {
-      struct st_tesseval_program *prog = rzalloc(NULL,
-                                                 struct st_tesseval_program);
+      struct st_common_program *prog = rzalloc(NULL,
+                                                 struct st_common_program);
       return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm);
    }
    case GL_COMPUTE_PROGRAM_NV: {
@@ -115,8 +115,8 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog)
       break;
    case GL_GEOMETRY_PROGRAM_NV:
       {
-         struct st_geometry_program *stgp =
-            (struct st_geometry_program *) prog;
+         struct st_common_program *stgp =
+            (struct st_common_program *) prog;
 
          st_release_basic_variants(st, stgp->Base.Target, &stgp->variants,
                                    &stgp->tgsi);
@@ -138,8 +138,8 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog)
       break;
    case GL_TESS_CONTROL_PROGRAM_NV:
       {
-         struct st_tessctrl_program *sttcp =
-            (struct st_tessctrl_program *) prog;
+         struct st_common_program *sttcp =
+            (struct st_common_program *) prog;
 
          st_release_basic_variants(st, sttcp->Base.Target, &sttcp->variants,
                                    &sttcp->tgsi);
@@ -150,8 +150,8 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog)
       break;
    case GL_TESS_EVALUATION_PROGRAM_NV:
       {
-         struct st_tesseval_program *sttep =
-            (struct st_tesseval_program *) prog;
+         struct st_common_program *sttep =
+            (struct st_common_program *) prog;
 
          st_release_basic_variants(st, sttep->Base.Target,
                                    &sttep->variants, &sttep->tgsi);
@@ -204,7 +204,7 @@ st_program_string_notify( struct gl_context *ctx,
         st->dirty |= stfp->affected_states;
    }
    else if (target == GL_GEOMETRY_PROGRAM_NV) {
-      struct st_geometry_program *stgp = (struct st_geometry_program *) prog;
+      struct st_common_program *stgp = (struct st_common_program *) prog;
 
       st_release_basic_variants(st, stgp->Base.Target, &stgp->variants,
                                 &stgp->tgsi);
@@ -225,8 +225,8 @@ st_program_string_notify( struct gl_context *ctx,
         st->dirty |= ST_NEW_VERTEX_PROGRAM(st, stvp);
    }
    else if (target == GL_TESS_CONTROL_PROGRAM_NV) {
-      struct st_tessctrl_program *sttcp =
-         (struct st_tessctrl_program *) prog;
+      struct st_common_program *sttcp =
+         (struct st_common_program *) prog;
 
       st_release_basic_variants(st, sttcp->Base.Target, &sttcp->variants,
                                 &sttcp->tgsi);
@@ -237,8 +237,8 @@ st_program_string_notify( struct gl_context *ctx,
          st->dirty |= sttcp->affected_states;
    }
    else if (target == GL_TESS_EVALUATION_PROGRAM_NV) {
-      struct st_tesseval_program *sttep =
-         (struct st_tesseval_program *) prog;
+      struct st_common_program *sttep =
+         (struct st_common_program *) prog;
 
       st_release_basic_variants(st, sttep->Base.Target, &sttep->variants,
                                 &sttep->tgsi);
index 801322622f0c2015d457fcccb26b206fdd630473..d99791100a711ce4850afbebc365f0e082310bfe 100644 (file)
@@ -131,12 +131,12 @@ st_get_active_states(struct gl_context *ctx)
 {
    struct st_vertex_program *vp =
       st_vertex_program(ctx->VertexProgram._Current);
-   struct st_tessctrl_program *tcp =
-      st_tessctrl_program(ctx->TessCtrlProgram._Current);
-   struct st_tesseval_program *tep =
-      st_tesseval_program(ctx->TessEvalProgram._Current);
-   struct st_geometry_program *gp =
-      st_geometry_program(ctx->GeometryProgram._Current);
+   struct st_common_program *tcp =
+      st_common_program(ctx->TessCtrlProgram._Current);
+   struct st_common_program *tep =
+      st_common_program(ctx->TessEvalProgram._Current);
+   struct st_common_program *gp =
+      st_common_program(ctx->GeometryProgram._Current);
    struct st_fragment_program *fp =
       st_fragment_program(ctx->FragmentProgram._Current);
    struct st_compute_program *cp =
@@ -583,10 +583,10 @@ void st_destroy_context( struct st_context *st )
    _mesa_HashWalk(ctx->Shared->TexObjects, destroy_tex_sampler_cb, st);
 
    st_reference_fragprog(st, &st->fp, NULL);
-   st_reference_geomprog(st, &st->gp, NULL);
+   st_reference_prog(st, &st->gp, NULL);
    st_reference_vertprog(st, &st->vp, NULL);
-   st_reference_tesscprog(st, &st->tcp, NULL);
-   st_reference_tesseprog(st, &st->tep, NULL);
+   st_reference_prog(st, &st->tcp, NULL);
+   st_reference_prog(st, &st->tep, NULL);
    st_reference_compprog(st, &st->cp, NULL);
 
    /* release framebuffer surfaces */
index f1b38fc36e9c3df5b67d15ccda95360f2cbf8c91..eb1a1630fd56e784f861ac71492ac70ac25c48de 100644 (file)
@@ -172,9 +172,9 @@ struct st_context
 
    struct st_vertex_program *vp;    /**< Currently bound vertex program */
    struct st_fragment_program *fp;  /**< Currently bound fragment program */
-   struct st_geometry_program *gp;  /**< Currently bound geometry program */
-   struct st_tessctrl_program *tcp; /**< Currently bound tess control program */
-   struct st_tesseval_program *tep; /**< Currently bound tess eval program */
+   struct st_common_program *gp;  /**< Currently bound geometry program */
+   struct st_common_program *tcp; /**< Currently bound tess control program */
+   struct st_common_program *tep; /**< Currently bound tess eval program */
    struct st_compute_program *cp;   /**< Currently bound compute program */
 
    struct st_vp_variant *vp_variant;
index f04719b66b67d6be8e660bc19055128b5987ed30..0a8782ec364f0c7b230102269b5b69ff98646351 100644 (file)
@@ -6830,9 +6830,9 @@ get_mesa_program_tgsi(struct gl_context *ctx,
 
    struct st_vertex_program *stvp;
    struct st_fragment_program *stfp;
-   struct st_geometry_program *stgp;
-   struct st_tessctrl_program *sttcp;
-   struct st_tesseval_program *sttep;
+   struct st_common_program *stgp;
+   struct st_common_program *sttcp;
+   struct st_common_program *sttep;
    struct st_compute_program *stcp;
 
    switch (shader->Stage) {
@@ -6845,15 +6845,15 @@ get_mesa_program_tgsi(struct gl_context *ctx,
       stfp->glsl_to_tgsi = v;
       break;
    case MESA_SHADER_GEOMETRY:
-      stgp = (struct st_geometry_program *)prog;
+      stgp = (struct st_common_program *)prog;
       stgp->glsl_to_tgsi = v;
       break;
    case MESA_SHADER_TESS_CTRL:
-      sttcp = (struct st_tessctrl_program *)prog;
+      sttcp = (struct st_common_program *)prog;
       sttcp->glsl_to_tgsi = v;
       break;
    case MESA_SHADER_TESS_EVAL:
-      sttep = (struct st_tesseval_program *)prog;
+      sttep = (struct st_common_program *)prog;
       sttep->glsl_to_tgsi = v;
       break;
    case MESA_SHADER_COMPUTE:
index d9b1d12434ea59cfc89c8023e1b360c9373b344b..09e6696782f9045e6f6315710b63ad47fd252404 100644 (file)
@@ -120,7 +120,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog)
       break;
 
    case MESA_SHADER_TESS_CTRL:
-      states = &((struct st_tessctrl_program*)prog)->affected_states;
+      states = &((struct st_common_program*)prog)->affected_states;
 
       *states = ST_NEW_TCS_STATE;
 
@@ -135,7 +135,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog)
       break;
 
    case MESA_SHADER_TESS_EVAL:
-      states = &((struct st_tesseval_program*)prog)->affected_states;
+      states = &((struct st_common_program*)prog)->affected_states;
 
       *states = ST_NEW_TES_STATE |
                 ST_NEW_RASTERIZER;
@@ -151,7 +151,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog)
       break;
 
    case MESA_SHADER_GEOMETRY:
-      states = &((struct st_geometry_program*)prog)->affected_states;
+      states = &((struct st_common_program*)prog)->affected_states;
 
       *states = ST_NEW_GS_STATE |
                 ST_NEW_RASTERIZER;
@@ -1630,7 +1630,7 @@ st_translate_program_common(struct st_context *st,
  */
 bool
 st_translate_geometry_program(struct st_context *st,
-                              struct st_geometry_program *stgp)
+                              struct st_common_program *stgp)
 {
    struct ureg_program *ureg;
 
@@ -1717,7 +1717,7 @@ st_get_basic_variant(struct st_context *st,
  */
 bool
 st_translate_tessctrl_program(struct st_context *st,
-                              struct st_tessctrl_program *sttcp)
+                              struct st_common_program *sttcp)
 {
    struct ureg_program *ureg;
 
@@ -1742,7 +1742,7 @@ st_translate_tessctrl_program(struct st_context *st,
  */
 bool
 st_translate_tesseval_program(struct st_context *st,
-                              struct st_tesseval_program *sttep)
+                              struct st_common_program *sttep)
 {
    struct ureg_program *ureg;
 
@@ -1918,9 +1918,9 @@ destroy_program_variants(struct st_context *st, struct gl_program *target)
    case GL_TESS_EVALUATION_PROGRAM_NV:
    case GL_COMPUTE_PROGRAM_NV:
       {
-         struct st_geometry_program *gp = (struct st_geometry_program*)target;
-         struct st_tessctrl_program *tcp = (struct st_tessctrl_program*)target;
-         struct st_tesseval_program *tep = (struct st_tesseval_program*)target;
+         struct st_common_program *gp = (struct st_common_program*)target;
+         struct st_common_program *tcp = (struct st_common_program*)target;
+         struct st_common_program *tep = (struct st_common_program*)target;
          struct st_compute_program *cp = (struct st_compute_program*)target;
          struct st_basic_variant **variants =
             target->Target == GL_GEOMETRY_PROGRAM_NV ? &gp->variants :
@@ -2066,19 +2066,19 @@ st_precompile_shader_variant(struct st_context *st,
    }
 
    case GL_TESS_CONTROL_PROGRAM_NV: {
-      struct st_tessctrl_program *p = (struct st_tessctrl_program *)prog;
+      struct st_common_program *p = (struct st_common_program *)prog;
       st_get_basic_variant(st, PIPE_SHADER_TESS_CTRL, &p->tgsi, &p->variants);
       break;
    }
 
    case GL_TESS_EVALUATION_PROGRAM_NV: {
-      struct st_tesseval_program *p = (struct st_tesseval_program *)prog;
+      struct st_common_program *p = (struct st_common_program *)prog;
       st_get_basic_variant(st, PIPE_SHADER_TESS_EVAL, &p->tgsi, &p->variants);
       break;
    }
 
    case GL_GEOMETRY_PROGRAM_NV: {
-      struct st_geometry_program *p = (struct st_geometry_program *)prog;
+      struct st_common_program *p = (struct st_common_program *)prog;
       st_get_basic_variant(st, PIPE_SHADER_GEOMETRY, &p->tgsi, &p->variants);
       break;
    }
index e2607a870bc186aa59d5dd8b04e942e101bb0c51..57673e9fb0138b7b596e76244174f7f84d5b21df 100644 (file)
@@ -254,43 +254,9 @@ struct st_basic_variant
 /**
  * Derived from Mesa gl_program:
  */
-struct st_geometry_program
+struct st_common_program
 {
-   struct gl_program Base;  /**< The Mesa geometry program */
-   struct pipe_shader_state tgsi;
-   struct glsl_to_tgsi_visitor* glsl_to_tgsi;
-   uint64_t affected_states; /**< ST_NEW_* flags to mark dirty when binding */
-
-   struct st_basic_variant *variants;
-
-   /** SHA1 hash of linked tgsi shader program, used for on-disk cache */
-   unsigned char sha1[20];
-};
-
-
-/**
- * Derived from Mesa gl_program:
- */
-struct st_tessctrl_program
-{
-   struct gl_program Base;  /**< The Mesa tess ctrl program */
-   struct pipe_shader_state tgsi;
-   struct glsl_to_tgsi_visitor* glsl_to_tgsi;
-   uint64_t affected_states; /**< ST_NEW_* flags to mark dirty when binding */
-
-   struct st_basic_variant *variants;
-
-   /** SHA1 hash of linked tgsi shader program, used for on-disk cache */
-   unsigned char sha1[20];
-};
-
-
-/**
- * Derived from Mesa gl_program:
- */
-struct st_tesseval_program
-{
-   struct gl_program Base;  /**< The Mesa tess eval program */
+   struct gl_program Base;
    struct pipe_shader_state tgsi;
    struct glsl_to_tgsi_visitor* glsl_to_tgsi;
    uint64_t affected_states; /**< ST_NEW_* flags to mark dirty when binding */
@@ -335,22 +301,10 @@ st_vertex_program( struct gl_program *vp )
    return (struct st_vertex_program *)vp;
 }
 
-static inline struct st_geometry_program *
-st_geometry_program( struct gl_program *gp )
+static inline struct st_common_program *
+st_common_program( struct gl_program *gp )
 {
-   return (struct st_geometry_program *)gp;
-}
-
-static inline struct st_tessctrl_program *
-st_tessctrl_program( struct gl_program *tcp )
-{
-   return (struct st_tessctrl_program *)tcp;
-}
-
-static inline struct st_tesseval_program *
-st_tesseval_program( struct gl_program *tep )
-{
-   return (struct st_tesseval_program *)tep;
+   return (struct st_common_program *)gp;
 }
 
 static inline struct st_compute_program *
@@ -369,16 +323,6 @@ st_reference_vertprog(struct st_context *st,
                            (struct gl_program *) prog);
 }
 
-static inline void
-st_reference_geomprog(struct st_context *st,
-                      struct st_geometry_program **ptr,
-                      struct st_geometry_program *prog)
-{
-   _mesa_reference_program(st->ctx,
-                           (struct gl_program **) ptr,
-                           (struct gl_program *) prog);
-}
-
 static inline void
 st_reference_fragprog(struct st_context *st,
                       struct st_fragment_program **ptr,
@@ -390,19 +334,9 @@ st_reference_fragprog(struct st_context *st,
 }
 
 static inline void
-st_reference_tesscprog(struct st_context *st,
-                       struct st_tessctrl_program **ptr,
-                       struct st_tessctrl_program *prog)
-{
-   _mesa_reference_program(st->ctx,
-                           (struct gl_program **) ptr,
-                           (struct gl_program *) prog);
-}
-
-static inline void
-st_reference_tesseprog(struct st_context *st,
-                       struct st_tesseval_program **ptr,
-                       struct st_tesseval_program *prog)
+st_reference_prog(struct st_context *st,
+                  struct st_common_program **ptr,
+                  struct st_common_program *prog)
 {
    _mesa_reference_program(st->ctx,
                            (struct gl_program **) ptr,
@@ -499,15 +433,15 @@ st_translate_fragment_program(struct st_context *st,
 
 extern bool
 st_translate_geometry_program(struct st_context *st,
-                              struct st_geometry_program *stgp);
+                              struct st_common_program *stgp);
 
 extern bool
 st_translate_tessctrl_program(struct st_context *st,
-                              struct st_tessctrl_program *sttcp);
+                              struct st_common_program *sttcp);
 
 extern bool
 st_translate_tesseval_program(struct st_context *st,
-                              struct st_tesseval_program *sttep);
+                              struct st_common_program *sttep);
 
 extern bool
 st_translate_compute_program(struct st_context *st,
index 1a11f1135d7873cc63fce9b8d5016aa9537841d5..0771ca660cfd29be4cde6d857328984cb0327873 100644 (file)
@@ -87,7 +87,7 @@ st_store_tgsi_in_disk_cache(struct st_context *st, struct gl_program *prog,
       break;
    }
    case MESA_SHADER_TESS_CTRL: {
-      struct st_tessctrl_program *stcp = (struct st_tessctrl_program *) prog;
+      struct st_common_program *stcp = (struct st_common_program *) prog;
       sha1 = stcp->sha1;
 
       write_stream_out_to_cache(blob, out_state);
@@ -95,7 +95,7 @@ st_store_tgsi_in_disk_cache(struct st_context *st, struct gl_program *prog,
       break;
    }
    case MESA_SHADER_TESS_EVAL: {
-      struct st_tesseval_program *step = (struct st_tesseval_program *) prog;
+      struct st_common_program *step = (struct st_common_program *) prog;
       sha1 = step->sha1;
 
       write_stream_out_to_cache(blob, out_state);
@@ -103,7 +103,7 @@ st_store_tgsi_in_disk_cache(struct st_context *st, struct gl_program *prog,
       break;
    }
    case MESA_SHADER_GEOMETRY: {
-      struct st_geometry_program *stgp = (struct st_geometry_program *) prog;
+      struct st_common_program *stgp = (struct st_common_program *) prog;
       sha1 = stgp->sha1;
 
       write_stream_out_to_cache(blob, out_state);
@@ -188,24 +188,24 @@ st_load_tgsi_from_disk_cache(struct gl_context *ctx,
          break;
       }
       case MESA_SHADER_TESS_CTRL: {
-         struct st_tessctrl_program *stcp =
-            (struct st_tessctrl_program *) glprog;
+         struct st_common_program *stcp =
+            (struct st_common_program *) glprog;
          stage_sha1[i] = stcp->sha1;
          ralloc_strcat(&buf, " tcs");
          disk_cache_compute_key(ctx->Cache, buf, strlen(buf), stage_sha1[i]);
          break;
       }
       case MESA_SHADER_TESS_EVAL: {
-         struct st_tesseval_program *step =
-            (struct st_tesseval_program *) glprog;
+         struct st_common_program *step =
+            (struct st_common_program *) glprog;
          stage_sha1[i] = step->sha1;
          ralloc_strcat(&buf, " tes");
          disk_cache_compute_key(ctx->Cache, buf, strlen(buf), stage_sha1[i]);
          break;
       }
       case MESA_SHADER_GEOMETRY: {
-         struct st_geometry_program *stgp =
-            (struct st_geometry_program *) glprog;
+         struct st_common_program *stgp =
+            (struct st_common_program *) glprog;
          stage_sha1[i] = stgp->sha1;
          ralloc_strcat(&buf, " gs");
          disk_cache_compute_key(ctx->Cache, buf, strlen(buf), stage_sha1[i]);
@@ -278,8 +278,8 @@ st_load_tgsi_from_disk_cache(struct gl_context *ctx,
             break;
          }
          case MESA_SHADER_TESS_CTRL: {
-            struct st_tessctrl_program *sttcp =
-               (struct st_tessctrl_program *) glprog;
+            struct st_common_program *sttcp =
+               (struct st_common_program *) glprog;
 
             st_release_basic_variants(st, sttcp->Base.Target,
                                       &sttcp->variants, &sttcp->tgsi);
@@ -293,8 +293,8 @@ st_load_tgsi_from_disk_cache(struct gl_context *ctx,
             break;
          }
          case MESA_SHADER_TESS_EVAL: {
-            struct st_tesseval_program *sttep =
-               (struct st_tesseval_program *) glprog;
+            struct st_common_program *sttep =
+               (struct st_common_program *) glprog;
 
             st_release_basic_variants(st, sttep->Base.Target,
                                       &sttep->variants, &sttep->tgsi);
@@ -308,8 +308,8 @@ st_load_tgsi_from_disk_cache(struct gl_context *ctx,
             break;
          }
          case MESA_SHADER_GEOMETRY: {
-            struct st_geometry_program *stgp =
-               (struct st_geometry_program *) glprog;
+            struct st_common_program *stgp =
+               (struct st_common_program *) glprog;
 
             st_release_basic_variants(st, stgp->Base.Target, &stgp->variants,
                                       &stgp->tgsi);