From 2e39e8b9723cdc09a447eb0f1e9151f557c75cde Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 1 Nov 2019 22:34:31 -0400 Subject: [PATCH] st/mesa: trivially merge st_vertex_program into st_common_program a later commit will add back st_vertex_program as a subclass of st_common_program Acked-by: Pierre-Eric Pelloux-Prayer --- src/mesa/state_tracker/st_atom.c | 6 +-- src/mesa/state_tracker/st_atom.h | 8 +-- src/mesa/state_tracker/st_atom_array.c | 12 ++--- src/mesa/state_tracker/st_atom_shader.c | 12 ++--- src/mesa/state_tracker/st_cb_feedback.c | 2 +- src/mesa/state_tracker/st_cb_program.c | 12 ++--- src/mesa/state_tracker/st_context.c | 6 +-- src/mesa/state_tracker/st_context.h | 2 +- src/mesa/state_tracker/st_draw_feedback.c | 2 +- src/mesa/state_tracker/st_glsl_to_nir.cpp | 6 +-- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 4 +- src/mesa/state_tracker/st_program.c | 34 ++++++------ src/mesa/state_tracker/st_program.h | 62 +++++----------------- src/mesa/state_tracker/st_shader_cache.c | 4 +- 14 files changed, 69 insertions(+), 103 deletions(-) diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 586d5b670f1..a117015efd4 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -67,7 +67,7 @@ void st_destroy_atoms( struct st_context *st ) 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_common_program *old_vp = st->vp; struct st_common_program *old_tcp = st->tcp; struct st_common_program *old_tep = st->tep; struct st_common_program *old_gp = st->gp; @@ -88,7 +88,7 @@ static void check_program_state( struct st_context *st ) if (old_vp) dirty |= old_vp->affected_states; if (new_vp) - dirty |= ST_NEW_VERTEX_PROGRAM(st, st_vertex_program(new_vp)); + dirty |= ST_NEW_VERTEX_PROGRAM(st, st_common_program(new_vp)); } if (unlikely(new_tcp != &old_tcp->Base)) { @@ -153,7 +153,7 @@ static void check_attrib_edgeflag(struct st_context *st) if (vertdata_edgeflags != st->vertdata_edgeflags) { st->vertdata_edgeflags = vertdata_edgeflags; if (vp) - st->dirty |= ST_NEW_VERTEX_PROGRAM(st, st_vertex_program(vp)); + st->dirty |= ST_NEW_VERTEX_PROGRAM(st, st_common_program(vp)); } edgeflag_culls_prims = edgeflags_enabled && !vertdata_edgeflags && diff --git a/src/mesa/state_tracker/st_atom.h b/src/mesa/state_tracker/st_atom.h index ffc64bd83f1..b0dcdfa15e6 100644 --- a/src/mesa/state_tracker/st_atom.h +++ b/src/mesa/state_tracker/st_atom.h @@ -37,7 +37,7 @@ #include "main/glheader.h" struct st_context; -struct st_vertex_program; +struct st_common_program; struct st_vp_variant; struct pipe_vertex_buffer; struct pipe_vertex_element; @@ -60,21 +60,21 @@ GLuint st_compare_func_to_pipe(GLenum func); void st_setup_arrays(struct st_context *st, - const struct st_vertex_program *vp, + const struct st_common_program *vp, const struct st_vp_variant *vp_variant, struct pipe_vertex_element *velements, struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers); void st_setup_current(struct st_context *st, - const struct st_vertex_program *vp, + const struct st_common_program *vp, const struct st_vp_variant *vp_variant, struct pipe_vertex_element *velements, struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers); void st_setup_current_user(struct st_context *st, - const struct st_vertex_program *vp, + const struct st_common_program *vp, const struct st_vp_variant *vp_variant, struct pipe_vertex_element *velements, struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers); diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c index 1662050bf04..0297662e0b0 100644 --- a/src/mesa/state_tracker/st_atom_array.c +++ b/src/mesa/state_tracker/st_atom_array.c @@ -318,7 +318,7 @@ static void init_velement(struct pipe_vertex_element *velement, assert(velement->src_format); } -static void init_velement_lowered(const struct st_vertex_program *vp, +static void init_velement_lowered(const struct st_common_program *vp, struct pipe_vertex_element *velements, const struct gl_vertex_format *vformat, int src_offset, int instance_divisor, @@ -385,7 +385,7 @@ set_vertex_attribs(struct st_context *st, void st_setup_arrays(struct st_context *st, - const struct st_vertex_program *vp, + const struct st_common_program *vp, const struct st_vp_variant *vp_variant, struct pipe_vertex_element *velements, struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers) @@ -455,7 +455,7 @@ st_setup_arrays(struct st_context *st, void st_setup_current(struct st_context *st, - const struct st_vertex_program *vp, + const struct st_common_program *vp, const struct st_vp_variant *vp_variant, struct pipe_vertex_element *velements, struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers) @@ -467,7 +467,7 @@ st_setup_current(struct st_context *st, GLbitfield curmask = inputs_read & _mesa_draw_current_bits(ctx); if (curmask) { /* vertex program validation must be done before this */ - const struct st_vertex_program *vp = st->vp; + const struct st_common_program *vp = st->vp; const ubyte *input_to_index = vp->input_to_index; /* For each attribute, upload the maximum possible size. */ GLubyte data[VERT_ATTRIB_MAX * sizeof(GLdouble) * 4]; @@ -517,7 +517,7 @@ st_setup_current(struct st_context *st, void st_setup_current_user(struct st_context *st, - const struct st_vertex_program *vp, + const struct st_common_program *vp, const struct st_vp_variant *vp_variant, struct pipe_vertex_element *velements, struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers) @@ -550,7 +550,7 @@ st_update_array(struct st_context *st) { /* vertex program validation must be done before this */ /* _NEW_PROGRAM, ST_NEW_VS_STATE */ - const struct st_vertex_program *vp = st->vp; + const struct st_common_program *vp = st->vp; const struct st_vp_variant *vp_variant = st->vp_variant; struct pipe_vertex_buffer vbuffer[PIPE_MAX_ATTRIBS]; diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 3aa5de3ec1a..83d846946d2 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -176,19 +176,19 @@ st_update_fp( struct st_context *st ) void st_update_vp( struct st_context *st ) { - struct st_vertex_program *stvp; + struct st_common_program *stvp; /* find active shader and params -- Should be covered by * ST_NEW_VERTEX_PROGRAM */ assert(st->ctx->VertexProgram._Current); - stvp = st_vertex_program(st->ctx->VertexProgram._Current); + stvp = st_common_program(st->ctx->VertexProgram._Current); assert(stvp->Base.Target == GL_VERTEX_PROGRAM_ARB); if (st->shader_has_one_variant[MESA_SHADER_VERTEX] && - stvp->variants && - stvp->variants->key.passthrough_edgeflags == st->vertdata_edgeflags) { - st->vp_variant = stvp->variants; + stvp->vp_variants && + stvp->vp_variants->key.passthrough_edgeflags == st->vertdata_edgeflags) { + st->vp_variant = stvp->vp_variants; } else { struct st_common_variant_key key; @@ -233,7 +233,7 @@ st_update_vp( struct st_context *st ) st->vp_variant = st_get_vp_variant(st, stvp, &key); } - st_reference_vertprog(st, &st->vp, stvp); + st_reference_prog(st, &st->vp, stvp); cso_set_vertex_shader_handle(st->cso_context, st->vp_variant->driver_shader); diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index 54f101ed82c..01a2105ad76 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -303,7 +303,7 @@ st_RenderMode(struct gl_context *ctx, GLenum newMode ) ctx->Driver.Draw = st_feedback_draw_vbo; /* need to generate/use a vertex program that emits pos/color/tex */ if (vp) - st->dirty |= ST_NEW_VERTEX_PROGRAM(st, st_vertex_program(vp)); + st->dirty |= ST_NEW_VERTEX_PROGRAM(st, st_common_program(vp)); } } diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 62a67cf7fa8..9fa304a0cb2 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -60,8 +60,8 @@ st_new_program(struct gl_context *ctx, GLenum target, GLuint id, { switch (target) { case GL_VERTEX_PROGRAM_ARB: { - struct st_vertex_program *prog = rzalloc(NULL, - struct st_vertex_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: @@ -91,7 +91,7 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) switch( prog->Target ) { case GL_VERTEX_PROGRAM_ARB: { - struct st_vertex_program *stvp = (struct st_vertex_program *) prog; + struct st_common_program *stvp = (struct st_common_program *) prog; st_release_vp_variants( st, stvp ); if (stvp->glsl_to_tgsi) @@ -151,7 +151,7 @@ st_program_string_notify( struct gl_context *ctx, !st_translate_fragment_program(st, stfp)) return false; } else if (target == GL_VERTEX_PROGRAM_ARB) { - struct st_vertex_program *stvp = (struct st_vertex_program *) prog; + struct st_common_program *stvp = (struct st_common_program *) prog; st_release_vp_variants(st, stvp); if (!stvp->shader_program && /* not GLSL->NIR */ @@ -211,8 +211,8 @@ st_get_shader_program_completion_status(struct gl_context *ctx, switch (i) { case MESA_SHADER_VERTEX: - if (st_vertex_program(linked->Program)->variants) - sh = st_vertex_program(linked->Program)->variants->driver_shader; + if (st_common_program(linked->Program)->vp_variants) + sh = st_common_program(linked->Program)->vp_variants->driver_shader; break; case MESA_SHADER_FRAGMENT: if (st_common_program(linked->Program)->fp_variants) diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 817a75da780..4b0abfe9262 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -137,8 +137,8 @@ st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out) static uint64_t st_get_active_states(struct gl_context *ctx) { - struct st_vertex_program *vp = - st_vertex_program(ctx->VertexProgram._Current); + struct st_common_program *vp = + st_common_program(ctx->VertexProgram._Current); struct st_common_program *tcp = st_common_program(ctx->TessCtrlProgram._Current); struct st_common_program *tep = @@ -1055,7 +1055,7 @@ st_destroy_context(struct st_context *st) st_reference_prog(st, &st->fp, NULL); st_reference_prog(st, &st->gp, NULL); - st_reference_vertprog(st, &st->vp, NULL); + st_reference_prog(st, &st->vp, NULL); st_reference_prog(st, &st->tcp, NULL); st_reference_prog(st, &st->tep, NULL); st_reference_prog(st, &st->cp, NULL); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index cf2f636df6e..69f99323e34 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -246,7 +246,7 @@ struct st_context union { struct { - struct st_vertex_program *vp; /**< Currently bound vertex program */ + struct st_common_program *vp; /**< Currently bound vertex program */ struct st_common_program *tcp; /**< Currently bound tess control program */ struct st_common_program *tep; /**< Currently bound tess eval program */ struct st_common_program *gp; /**< Currently bound geometry program */ diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 118b7d0b2fb..2fa203e86f8 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -106,7 +106,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; struct draw_context *draw = st_get_draw_context(st); - const struct st_vertex_program *vp; + const struct st_common_program *vp; struct st_vp_variant *vp_variant; struct pipe_vertex_buffer vbuffers[PIPE_MAX_SHADER_INPUTS]; unsigned num_vbuffers = 0; diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 6cadf15d6df..5c984244c53 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -520,12 +520,12 @@ set_st_program(struct gl_program *prog, struct gl_shader_program *shader_program, nir_shader *nir) { - struct st_vertex_program *stvp; + struct st_common_program *stvp; struct st_common_program *stp; switch (prog->info.stage) { case MESA_SHADER_VERTEX: - stvp = (struct st_vertex_program *)prog; + stvp = (struct st_common_program *)prog; stvp->shader_program = shader_program; stvp->state.type = PIPE_SHADER_IR_NIR; stvp->state.ir.nir = nir; @@ -822,7 +822,7 @@ st_link_nir(struct gl_context *ctx, /* Initialize st_vertex_program members. */ if (i == MESA_SHADER_VERTEX) - st_prepare_vertex_program(st_vertex_program(prog)); + st_prepare_vertex_program(st_common_program(prog)); /* Get pipe_stream_output_info. */ if (i == MESA_SHADER_VERTEX || diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index e70762ba152..e4d643222d7 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -7308,12 +7308,12 @@ get_mesa_program_tgsi(struct gl_context *ctx, return NULL; } - struct st_vertex_program *stvp; + struct st_common_program *stvp; struct st_common_program *stp; switch (shader->Stage) { case MESA_SHADER_VERTEX: - stvp = (struct st_vertex_program *)prog; + stvp = (struct st_common_program *)prog; stvp->glsl_to_tgsi = v; break; case MESA_SHADER_FRAGMENT: diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 05b5353780d..83f4c737a5d 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -107,7 +107,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog) switch (prog->info.stage) { case MESA_SHADER_VERTEX: - states = &((struct st_vertex_program*)prog)->affected_states; + states = &((struct st_common_program*)prog)->affected_states; *states = ST_NEW_VS_STATE | ST_NEW_RASTERIZER | @@ -258,17 +258,17 @@ delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv) */ void st_release_vp_variants( struct st_context *st, - struct st_vertex_program *stvp ) + struct st_common_program *stvp ) { struct st_vp_variant *vpv; - for (vpv = stvp->variants; vpv; ) { + for (vpv = stvp->vp_variants; vpv; ) { struct st_vp_variant *next = vpv->next; delete_vp_variant(st, vpv); vpv = next; } - stvp->variants = NULL; + stvp->vp_variants = NULL; delete_ir(&stvp->state); } @@ -440,7 +440,7 @@ st_translate_prog_to_nir(struct st_context *st, struct gl_program *prog, } void -st_prepare_vertex_program(struct st_vertex_program *stvp) +st_prepare_vertex_program(struct st_common_program *stvp) { stvp->num_inputs = 0; memset(stvp->input_to_index, ~0, sizeof(stvp->input_to_index)); @@ -496,7 +496,7 @@ st_translate_stream_output_info(struct gl_program *prog) /* Translate stream output info. */ struct pipe_stream_output_info *so_info = NULL; if (prog->info.stage == MESA_SHADER_VERTEX) - so_info = &((struct st_vertex_program*)prog)->state.stream_output; + so_info = &((struct st_common_program*)prog)->state.stream_output; else so_info = &((struct st_common_program*)prog)->state.stream_output; @@ -521,7 +521,7 @@ st_translate_stream_output_info(struct gl_program *prog) */ bool st_translate_vertex_program(struct st_context *st, - struct st_vertex_program *stvp) + struct st_common_program *stvp) { struct ureg_program *ureg; enum pipe_error error; @@ -668,7 +668,7 @@ static const gl_state_index16 depth_range_state[STATE_LENGTH] = static struct st_vp_variant * st_create_vp_variant(struct st_context *st, - struct st_vertex_program *stvp, + struct st_common_program *stvp, const struct st_common_variant_key *key) { struct st_vp_variant *vpv = CALLOC_STRUCT(st_vp_variant); @@ -810,13 +810,13 @@ st_create_vp_variant(struct st_context *st, */ struct st_vp_variant * st_get_vp_variant(struct st_context *st, - struct st_vertex_program *stvp, + struct st_common_program *stvp, const struct st_common_variant_key *key) { struct st_vp_variant *vpv; /* Search for existing variant */ - for (vpv = stvp->variants; vpv; vpv = vpv->next) { + for (vpv = stvp->vp_variants; vpv; vpv = vpv->next) { if (memcmp(&vpv->key, key, sizeof(*key)) == 0) { break; } @@ -834,8 +834,8 @@ st_get_vp_variant(struct st_context *st, } /* insert into list */ - vpv->next = stvp->variants; - stvp->variants = vpv; + vpv->next = stvp->vp_variants; + stvp->vp_variants = vpv; } } @@ -1862,10 +1862,10 @@ destroy_program_variants(struct st_context *st, struct gl_program *target) switch (target->Target) { case GL_VERTEX_PROGRAM_ARB: { - struct st_vertex_program *stvp = (struct st_vertex_program *) target; - struct st_vp_variant *vpv, **prevPtr = &stvp->variants; + struct st_common_program *stvp = (struct st_common_program *) target; + struct st_vp_variant *vpv, **prevPtr = &stvp->vp_variants; - for (vpv = stvp->variants; vpv; ) { + for (vpv = stvp->vp_variants; vpv; ) { struct st_vp_variant *next = vpv->next; if (vpv->key.st == st) { /* unlink from list */ @@ -2012,7 +2012,7 @@ st_precompile_shader_variant(struct st_context *st, { switch (prog->Target) { case GL_VERTEX_PROGRAM_ARB: { - struct st_vertex_program *p = (struct st_vertex_program *)prog; + struct st_common_program *p = (struct st_common_program *)prog; struct st_common_variant_key key; memset(&key, 0, sizeof(key)); @@ -2057,7 +2057,7 @@ st_finalize_program(struct st_context *st, struct gl_program *prog) { if (st->current_program[prog->info.stage] == prog) { if (prog->info.stage == MESA_SHADER_VERTEX) - st->dirty |= ST_NEW_VERTEX_PROGRAM(st, (struct st_vertex_program *)prog); + st->dirty |= ST_NEW_VERTEX_PROGRAM(st, (struct st_common_program *)prog); else st->dirty |= ((struct st_common_program *)prog)->affected_states; } diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index c2df2463273..3ec455d2744 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -218,34 +218,6 @@ struct st_vp_variant }; -/** - * Derived from Mesa gl_program: - */ -struct st_vertex_program -{ - struct gl_program Base; /**< The Mesa vertex program */ - struct pipe_shader_state state; - struct glsl_to_tgsi_visitor* glsl_to_tgsi; - uint64_t affected_states; /**< ST_NEW_* flags to mark dirty when binding */ - - /* used when bypassing glsl_to_tgsi: */ - struct gl_shader_program *shader_program; - - /** maps a TGSI input index back to a Mesa VERT_ATTRIB_x */ - ubyte index_to_input[PIPE_MAX_ATTRIBS]; - ubyte num_inputs; - /** Reverse mapping of the above */ - ubyte input_to_index[VERT_ATTRIB_MAX]; - - /** Maps VARYING_SLOT_x to slot */ - ubyte result_to_output[VARYING_SLOT_MAX]; - - /** List of translated variants of this vertex program. - */ - struct st_vp_variant *variants; -}; - - /** * Geometry program variant. */ @@ -276,16 +248,20 @@ struct st_common_program union { struct st_common_variant *variants; + struct st_vp_variant *vp_variants; struct st_fp_variant *fp_variants; }; -}; + /** maps a TGSI input index back to a Mesa VERT_ATTRIB_x */ + ubyte index_to_input[PIPE_MAX_ATTRIBS]; + ubyte num_inputs; + /** Reverse mapping of the above */ + ubyte input_to_index[VERT_ATTRIB_MAX]; + + /** Maps VARYING_SLOT_x to slot */ + ubyte result_to_output[VARYING_SLOT_MAX]; +}; -static inline struct st_vertex_program * -st_vertex_program( struct gl_program *vp ) -{ - return (struct st_vertex_program *)vp; -} static inline struct st_common_program * st_common_program( struct gl_program *cp ) @@ -293,16 +269,6 @@ st_common_program( struct gl_program *cp ) return (struct st_common_program *)cp; } -static inline void -st_reference_vertprog(struct st_context *st, - struct st_vertex_program **ptr, - struct st_vertex_program *prog) -{ - _mesa_reference_program(st->ctx, - (struct gl_program **) ptr, - (struct gl_program *) prog); -} - static inline void st_reference_prog(struct st_context *st, struct st_common_program **ptr, @@ -328,7 +294,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog); extern struct st_vp_variant * st_get_vp_variant(struct st_context *st, - struct st_vertex_program *stvp, + struct st_common_program *stvp, const struct st_common_variant_key *key); @@ -344,7 +310,7 @@ st_get_common_variant(struct st_context *st, extern void st_release_vp_variants( struct st_context *st, - struct st_vertex_program *stvp ); + struct st_common_program *stvp ); extern void st_release_fp_variants( struct st_context *st, @@ -360,14 +326,14 @@ extern void st_finalize_nir_before_variants(struct nir_shader *nir); extern void -st_prepare_vertex_program(struct st_vertex_program *stvp); +st_prepare_vertex_program(struct st_common_program *stvp); extern void st_translate_stream_output_info(struct gl_program *prog); extern bool st_translate_vertex_program(struct st_context *st, - struct st_vertex_program *stvp); + struct st_common_program *stvp); extern bool st_translate_fragment_program(struct st_context *st, diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c index a5b755b04ec..bc464ec4a08 100644 --- a/src/mesa/state_tracker/st_shader_cache.c +++ b/src/mesa/state_tracker/st_shader_cache.c @@ -86,7 +86,7 @@ st_serialise_ir_program(struct gl_context *ctx, struct gl_program *prog, switch (prog->info.stage) { case MESA_SHADER_VERTEX: { - struct st_vertex_program *stvp = (struct st_vertex_program *) prog; + struct st_common_program *stvp = (struct st_common_program *) prog; blob_write_uint32(&blob, stvp->num_inputs); blob_write_bytes(&blob, stvp->index_to_input, @@ -192,7 +192,7 @@ st_deserialise_ir_program(struct gl_context *ctx, switch (prog->info.stage) { case MESA_SHADER_VERTEX: { - struct st_vertex_program *stvp = (struct st_vertex_program *) prog; + struct st_common_program *stvp = (struct st_common_program *) prog; st_release_vp_variants(st, stvp); -- 2.30.2