From 5fed208285e4cbe30a82d57689b9f07545c078d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 1 Nov 2019 22:38:06 -0400 Subject: [PATCH] st/mesa: rename st_common_program to st_program Acked-by: Pierre-Eric Pelloux-Prayer --- src/mesa/state_tracker/st_atifs_to_tgsi.c | 2 +- src/mesa/state_tracker/st_atom.c | 26 +++++----- src/mesa/state_tracker/st_atom.h | 8 +-- src/mesa/state_tracker/st_atom_array.c | 12 ++--- src/mesa/state_tracker/st_atom_constbuf.c | 8 +-- src/mesa/state_tracker/st_atom_shader.c | 14 +++--- src/mesa/state_tracker/st_cb_bitmap.h | 2 +- src/mesa/state_tracker/st_cb_feedback.c | 2 +- src/mesa/state_tracker/st_cb_program.c | 32 ++++++------ src/mesa/state_tracker/st_context.c | 24 ++++----- src/mesa/state_tracker/st_context.h | 14 +++--- src/mesa/state_tracker/st_draw_feedback.c | 2 +- src/mesa/state_tracker/st_glsl_to_nir.cpp | 10 ++-- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 +-- src/mesa/state_tracker/st_program.c | 58 +++++++++++----------- src/mesa/state_tracker/st_program.h | 32 ++++++------ src/mesa/state_tracker/st_shader_cache.c | 8 +-- 17 files changed, 131 insertions(+), 131 deletions(-) diff --git a/src/mesa/state_tracker/st_atifs_to_tgsi.c b/src/mesa/state_tracker/st_atifs_to_tgsi.c index 8c6b1fce4d3..2af2ad8d5f5 100644 --- a/src/mesa/state_tracker/st_atifs_to_tgsi.c +++ b/src/mesa/state_tracker/st_atifs_to_tgsi.c @@ -541,7 +541,7 @@ void st_init_atifs_prog(struct gl_context *ctx, struct gl_program *prog) { /* we know this is st_fragment_program, because of st_new_ati_fs() */ - struct st_common_program *stfp = (struct st_common_program *) prog; + struct st_program *stfp = (struct st_program *) prog; struct ati_fragment_shader *atifs = stfp->ati_fs; unsigned pass, i, r, optype, arg; diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index a117015efd4..11c8e91ce9f 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -67,11 +67,11 @@ 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_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; - struct st_common_program *old_fp = st->fp; + struct st_program *old_vp = st->vp; + struct st_program *old_tcp = st->tcp; + struct st_program *old_tep = st->tep; + struct st_program *old_gp = st->gp; + struct st_program *old_fp = st->fp; struct gl_program *new_vp = ctx->VertexProgram._Current; struct gl_program *new_tcp = ctx->TessCtrlProgram._Current; @@ -88,35 +88,35 @@ 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_common_program(new_vp)); + dirty |= ST_NEW_VERTEX_PROGRAM(st, st_program(new_vp)); } if (unlikely(new_tcp != &old_tcp->Base)) { if (old_tcp) dirty |= old_tcp->affected_states; if (new_tcp) - dirty |= st_common_program(new_tcp)->affected_states; + dirty |= st_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_common_program(new_tep)->affected_states; + dirty |= st_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_common_program(new_gp)->affected_states; + dirty |= st_program(new_gp)->affected_states; } if (unlikely(new_fp != &old_fp->Base)) { if (old_fp) dirty |= old_fp->affected_states; if (new_fp) - dirty |= st_common_program(new_fp)->affected_states; + dirty |= st_program(new_fp)->affected_states; } /* Find out the number of viewports. This determines how many scissors @@ -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_common_program(vp)); + st->dirty |= ST_NEW_VERTEX_PROGRAM(st, st_program(vp)); } edgeflag_culls_prims = edgeflags_enabled && !vertdata_edgeflags && @@ -219,14 +219,14 @@ void st_validate_state( struct st_context *st, enum st_pipeline pipeline ) break; case ST_PIPELINE_COMPUTE: { - struct st_common_program *old_cp = st->cp; + struct st_program *old_cp = st->cp; struct gl_program *new_cp = ctx->ComputeProgram._Current; if (new_cp != &old_cp->Base) { if (old_cp) st->dirty |= old_cp->affected_states; assert(new_cp); - st->dirty |= st_common_program(new_cp)->affected_states; + st->dirty |= st_program(new_cp)->affected_states; } st->compute_shader_may_be_dirty = false; diff --git a/src/mesa/state_tracker/st_atom.h b/src/mesa/state_tracker/st_atom.h index b0dcdfa15e6..b40f4e24933 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_common_program; +struct st_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_common_program *vp, + const struct st_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_common_program *vp, + const struct st_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_common_program *vp, + const struct st_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 0297662e0b0..4694cbf7e1f 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_common_program *vp, +static void init_velement_lowered(const struct st_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_common_program *vp, + const struct st_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_common_program *vp, + const struct st_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_common_program *vp = st->vp; + const struct st_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_common_program *vp, + const struct st_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_common_program *vp = st->vp; + const struct st_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_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index eabd854459a..ffe4b414477 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -155,7 +155,7 @@ st_update_fs_constants(struct st_context *st) void st_update_gs_constants(struct st_context *st) { - struct st_common_program *gp = st->gp; + struct st_program *gp = st->gp; if (gp) st_upload_constants(st, &gp->Base); @@ -166,7 +166,7 @@ st_update_gs_constants(struct st_context *st) void st_update_tcs_constants(struct st_context *st) { - struct st_common_program *tcp = st->tcp; + struct st_program *tcp = st->tcp; if (tcp) st_upload_constants(st, &tcp->Base); @@ -177,7 +177,7 @@ st_update_tcs_constants(struct st_context *st) void st_update_tes_constants(struct st_context *st) { - struct st_common_program *tep = st->tep; + struct st_program *tep = st->tep; if (tep) st_upload_constants(st, &tep->Base); @@ -188,7 +188,7 @@ st_update_tes_constants(struct st_context *st) void st_update_cs_constants(struct st_context *st) { - struct st_common_program *cp = st->cp; + struct st_program *cp = st->cp; if (cp) st_upload_constants(st, &cp->Base); diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 83d846946d2..b18b33e5000 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -98,10 +98,10 @@ get_texture_target(struct gl_context *ctx, const unsigned unit) void st_update_fp( struct st_context *st ) { - struct st_common_program *stfp; + struct st_program *stfp; assert(st->ctx->FragmentProgram._Current); - stfp = st_common_program(st->ctx->FragmentProgram._Current); + stfp = st_program(st->ctx->FragmentProgram._Current); assert(stfp->Base.Target == GL_FRAGMENT_PROGRAM_ARB); void *shader; @@ -176,13 +176,13 @@ st_update_fp( struct st_context *st ) void st_update_vp( struct st_context *st ) { - struct st_common_program *stvp; + struct st_program *stvp; /* find active shader and params -- Should be covered by * ST_NEW_VERTEX_PROGRAM */ assert(st->ctx->VertexProgram._Current); - stvp = st_common_program(st->ctx->VertexProgram._Current); + stvp = st_program(st->ctx->VertexProgram._Current); assert(stvp->Base.Target == GL_VERTEX_PROGRAM_ARB); if (st->shader_has_one_variant[MESA_SHADER_VERTEX] && @@ -242,16 +242,16 @@ st_update_vp( struct st_context *st ) static void * st_update_common_program(struct st_context *st, struct gl_program *prog, - unsigned pipe_shader, struct st_common_program **dst) + unsigned pipe_shader, struct st_program **dst) { - struct st_common_program *stp; + struct st_program *stp; if (!prog) { st_reference_prog(st, dst, NULL); return NULL; } - stp = st_common_program(prog); + stp = st_program(prog); st_reference_prog(st, dst, stp); if (st->shader_has_one_variant[prog->info.stage] && stp->variants) diff --git a/src/mesa/state_tracker/st_cb_bitmap.h b/src/mesa/state_tracker/st_cb_bitmap.h index 14e3d930e5b..d2b53c9bcaa 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.h +++ b/src/mesa/state_tracker/st_cb_bitmap.h @@ -35,7 +35,7 @@ struct dd_function_table; struct st_context; struct gl_program; -struct st_common_program; +struct st_program; extern void st_init_bitmap_functions(struct dd_function_table *functions); diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index 01a2105ad76..a282e9b0269 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_common_program(vp)); + st->dirty |= ST_NEW_VERTEX_PROGRAM(st, st_program(vp)); } } diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 9fa304a0cb2..e4aacb61e50 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_common_program *prog = rzalloc(NULL, - struct st_common_program); + struct st_program *prog = rzalloc(NULL, + struct st_program); return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm); } case GL_TESS_CONTROL_PROGRAM_NV: @@ -69,8 +69,8 @@ st_new_program(struct gl_context *ctx, GLenum target, GLuint id, case GL_GEOMETRY_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: case GL_COMPUTE_PROGRAM_NV: { - struct st_common_program *prog = rzalloc(NULL, - struct st_common_program); + struct st_program *prog = rzalloc(NULL, + struct st_program); return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm); } default: @@ -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_common_program *stvp = (struct st_common_program *) prog; + struct st_program *stvp = (struct st_program *) prog; st_release_vp_variants( st, stvp ); if (stvp->glsl_to_tgsi) @@ -104,7 +104,7 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) case GL_FRAGMENT_PROGRAM_ARB: case GL_COMPUTE_PROGRAM_NV: { - struct st_common_program *p = st_common_program(prog); + struct st_program *p = st_program(prog); if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) st_release_fp_variants(st, p); @@ -137,7 +137,7 @@ st_program_string_notify( struct gl_context *ctx, if (target == GL_FRAGMENT_PROGRAM_ARB || target == GL_FRAGMENT_SHADER_ATI) { - struct st_common_program *stfp = (struct st_common_program *) prog; + struct st_program *stfp = (struct st_program *) prog; if (target == GL_FRAGMENT_SHADER_ATI) { assert(stfp->ati_fs); @@ -151,14 +151,14 @@ 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_common_program *stvp = (struct st_common_program *) prog; + struct st_program *stvp = (struct st_program *) prog; st_release_vp_variants(st, stvp); if (!stvp->shader_program && /* not GLSL->NIR */ !st_translate_vertex_program(st, stvp)) return false; } else { - struct st_common_program *stcp = st_common_program(prog); + struct st_program *stcp = st_program(prog); st_release_common_variants(st, stcp); if (!stcp->shader_program && /* not GLSL->NIR */ @@ -179,7 +179,7 @@ st_new_ati_fs(struct gl_context *ctx, struct ati_fragment_shader *curProg) { struct gl_program *prog = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, curProg->Id, true); - struct st_common_program *stfp = (struct st_common_program *)prog; + struct st_program *stfp = (struct st_program *)prog; stfp->ati_fs = curProg; return prog; } @@ -211,19 +211,19 @@ st_get_shader_program_completion_status(struct gl_context *ctx, switch (i) { case MESA_SHADER_VERTEX: - if (st_common_program(linked->Program)->vp_variants) - sh = st_common_program(linked->Program)->vp_variants->driver_shader; + if (st_program(linked->Program)->vp_variants) + sh = st_program(linked->Program)->vp_variants->driver_shader; break; case MESA_SHADER_FRAGMENT: - if (st_common_program(linked->Program)->fp_variants) - sh = st_common_program(linked->Program)->fp_variants->driver_shader; + if (st_program(linked->Program)->fp_variants) + sh = st_program(linked->Program)->fp_variants->driver_shader; break; case MESA_SHADER_TESS_CTRL: case MESA_SHADER_TESS_EVAL: case MESA_SHADER_GEOMETRY: case MESA_SHADER_COMPUTE: - if (st_common_program(linked->Program)->variants) - sh = st_common_program(linked->Program)->variants->driver_shader; + if (st_program(linked->Program)->variants) + sh = st_program(linked->Program)->variants->driver_shader; break; } diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 4b0abfe9262..d6025d69f61 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -137,18 +137,18 @@ 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_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 = - st_common_program(ctx->TessEvalProgram._Current); - struct st_common_program *gp = - st_common_program(ctx->GeometryProgram._Current); - struct st_common_program *fp = - st_common_program(ctx->FragmentProgram._Current); - struct st_common_program *cp = - st_common_program(ctx->ComputeProgram._Current); + struct st_program *vp = + st_program(ctx->VertexProgram._Current); + struct st_program *tcp = + st_program(ctx->TessCtrlProgram._Current); + struct st_program *tep = + st_program(ctx->TessEvalProgram._Current); + struct st_program *gp = + st_program(ctx->GeometryProgram._Current); + struct st_program *fp = + st_program(ctx->FragmentProgram._Current); + struct st_program *cp = + st_program(ctx->ComputeProgram._Current); uint64_t active_shader_states = 0; if (vp) diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 69f99323e34..3778bbd4528 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -50,7 +50,7 @@ struct draw_context; struct draw_stage; struct gen_mipmap_state; struct st_context; -struct st_common_program; +struct st_program; struct st_perf_monitor_group; struct u_upload_mgr; @@ -246,12 +246,12 @@ struct st_context union { struct { - 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 */ - struct st_common_program *fp; /**< Currently bound fragment program */ - struct st_common_program *cp; /**< Currently bound compute program */ + struct st_program *vp; /**< Currently bound vertex program */ + struct st_program *tcp; /**< Currently bound tess control program */ + struct st_program *tep; /**< Currently bound tess eval program */ + struct st_program *gp; /**< Currently bound geometry program */ + struct st_program *fp; /**< Currently bound fragment program */ + struct st_program *cp; /**< Currently bound compute program */ }; struct gl_program *current_program[MESA_SHADER_STAGES]; }; diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 2fa203e86f8..ebd30eaeb97 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_common_program *vp; + const struct st_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 5c984244c53..0aad8a723e7 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_common_program *stvp; - struct st_common_program *stp; + struct st_program *stvp; + struct st_program *stp; switch (prog->info.stage) { case MESA_SHADER_VERTEX: - stvp = (struct st_common_program *)prog; + stvp = (struct st_program *)prog; stvp->shader_program = shader_program; stvp->state.type = PIPE_SHADER_IR_NIR; stvp->state.ir.nir = nir; @@ -535,7 +535,7 @@ set_st_program(struct gl_program *prog, case MESA_SHADER_TESS_EVAL: case MESA_SHADER_COMPUTE: case MESA_SHADER_FRAGMENT: - stp = (struct st_common_program *)prog; + stp = (struct st_program *)prog; stp->shader_program = shader_program; stp->state.type = PIPE_SHADER_IR_NIR; stp->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_common_program(prog)); + st_prepare_vertex_program(st_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 e4d643222d7..bc739ac228c 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_common_program *stvp; - struct st_common_program *stp; + struct st_program *stvp; + struct st_program *stp; switch (shader->Stage) { case MESA_SHADER_VERTEX: - stvp = (struct st_common_program *)prog; + stvp = (struct st_program *)prog; stvp->glsl_to_tgsi = v; break; case MESA_SHADER_FRAGMENT: @@ -7321,7 +7321,7 @@ get_mesa_program_tgsi(struct gl_context *ctx, case MESA_SHADER_TESS_EVAL: case MESA_SHADER_GEOMETRY: case MESA_SHADER_COMPUTE: - stp = st_common_program(prog); + stp = st_program(prog); stp->glsl_to_tgsi = v; break; default: diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 83f4c737a5d..2ee92d13156 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_common_program*)prog)->affected_states; + states = &((struct st_program*)prog)->affected_states; *states = ST_NEW_VS_STATE | ST_NEW_RASTERIZER | @@ -124,7 +124,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog) break; case MESA_SHADER_TESS_CTRL: - states = &(st_common_program(prog))->affected_states; + states = &(st_program(prog))->affected_states; *states = ST_NEW_TCS_STATE; @@ -139,7 +139,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog) break; case MESA_SHADER_TESS_EVAL: - states = &(st_common_program(prog))->affected_states; + states = &(st_program(prog))->affected_states; *states = ST_NEW_TES_STATE | ST_NEW_RASTERIZER; @@ -155,7 +155,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog) break; case MESA_SHADER_GEOMETRY: - states = &(st_common_program(prog))->affected_states; + states = &(st_program(prog))->affected_states; *states = ST_NEW_GS_STATE | ST_NEW_RASTERIZER; @@ -171,7 +171,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog) break; case MESA_SHADER_FRAGMENT: - states = &((struct st_common_program*)prog)->affected_states; + states = &((struct st_program*)prog)->affected_states; /* gl_FragCoord and glDrawPixels always use constants. */ *states = ST_NEW_FS_STATE | @@ -189,7 +189,7 @@ st_set_prog_affected_state_flags(struct gl_program *prog) break; case MESA_SHADER_COMPUTE: - states = &((struct st_common_program*)prog)->affected_states; + states = &((struct st_program*)prog)->affected_states; *states = ST_NEW_CS_STATE; @@ -258,7 +258,7 @@ delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv) */ void st_release_vp_variants( struct st_context *st, - struct st_common_program *stvp ) + struct st_program *stvp ) { struct st_vp_variant *vpv; @@ -299,7 +299,7 @@ delete_fp_variant(struct st_context *st, struct st_fp_variant *fpv) * Free all variants of a fragment program. */ void -st_release_fp_variants(struct st_context *st, struct st_common_program *stfp) +st_release_fp_variants(struct st_context *st, struct st_program *stfp) { struct st_fp_variant *fpv; @@ -374,7 +374,7 @@ delete_common_variant(struct st_context *st, struct st_common_variant *v, * Free all basic program variants. */ void -st_release_common_variants(struct st_context *st, struct st_common_program *p) +st_release_common_variants(struct st_context *st, struct st_program *p) { struct st_common_variant *v; @@ -440,7 +440,7 @@ st_translate_prog_to_nir(struct st_context *st, struct gl_program *prog, } void -st_prepare_vertex_program(struct st_common_program *stvp) +st_prepare_vertex_program(struct st_program *stvp) { stvp->num_inputs = 0; memset(stvp->input_to_index, ~0, sizeof(stvp->input_to_index)); @@ -496,9 +496,9 @@ 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_common_program*)prog)->state.stream_output; + so_info = &((struct st_program*)prog)->state.stream_output; else - so_info = &((struct st_common_program*)prog)->state.stream_output; + so_info = &((struct st_program*)prog)->state.stream_output; for (unsigned i = 0; i < info->NumOutputs; i++) { so_info->output[i].register_index = @@ -521,7 +521,7 @@ st_translate_stream_output_info(struct gl_program *prog) */ bool st_translate_vertex_program(struct st_context *st, - struct st_common_program *stvp) + struct st_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_common_program *stvp, + struct st_program *stvp, const struct st_common_variant_key *key) { struct st_vp_variant *vpv = CALLOC_STRUCT(st_vp_variant); @@ -810,7 +810,7 @@ st_create_vp_variant(struct st_context *st, */ struct st_vp_variant * st_get_vp_variant(struct st_context *st, - struct st_common_program *stvp, + struct st_program *stvp, const struct st_common_variant_key *key) { struct st_vp_variant *vpv; @@ -848,7 +848,7 @@ st_get_vp_variant(struct st_context *st, */ bool st_translate_fragment_program(struct st_context *st, - struct st_common_program *stfp) + struct st_program *stfp) { /* Non-GLSL programs: */ if (!stfp->glsl_to_tgsi) { @@ -1221,7 +1221,7 @@ st_translate_fragment_program(struct st_context *st, static struct st_fp_variant * st_create_fp_variant(struct st_context *st, - struct st_common_program *stfp, + struct st_program *stfp, const struct st_fp_variant_key *key) { struct pipe_context *pipe = st->pipe; @@ -1511,7 +1511,7 @@ st_create_fp_variant(struct st_context *st, */ struct st_fp_variant * st_get_fp_variant(struct st_context *st, - struct st_common_program *stfp, + struct st_program *stfp, const struct st_fp_variant_key *key) { struct st_fp_variant *fpv; @@ -1558,7 +1558,7 @@ st_get_fp_variant(struct st_context *st, */ bool st_translate_common_program(struct st_context *st, - struct st_common_program *stcp) + struct st_program *stcp) { struct gl_program *prog = &stcp->Base; enum pipe_shader_type stage = @@ -1746,7 +1746,7 @@ st_translate_common_program(struct st_context *st, */ struct st_common_variant * st_get_common_variant(struct st_context *st, - struct st_common_program *prog, + struct st_program *prog, const struct st_common_variant_key *key) { struct pipe_context *pipe = st->pipe; @@ -1862,7 +1862,7 @@ destroy_program_variants(struct st_context *st, struct gl_program *target) switch (target->Target) { case GL_VERTEX_PROGRAM_ARB: { - struct st_common_program *stvp = (struct st_common_program *) target; + struct st_program *stvp = (struct st_program *) target; struct st_vp_variant *vpv, **prevPtr = &stvp->vp_variants; for (vpv = stvp->vp_variants; vpv; ) { @@ -1882,8 +1882,8 @@ destroy_program_variants(struct st_context *st, struct gl_program *target) break; case GL_FRAGMENT_PROGRAM_ARB: { - struct st_common_program *stfp = - (struct st_common_program *) target; + struct st_program *stfp = + (struct st_program *) target; struct st_fp_variant *fpv, **prevPtr = &stfp->fp_variants; for (fpv = stfp->fp_variants; fpv; ) { @@ -1906,7 +1906,7 @@ destroy_program_variants(struct st_context *st, struct gl_program *target) case GL_TESS_EVALUATION_PROGRAM_NV: case GL_COMPUTE_PROGRAM_NV: { - struct st_common_program *p = st_common_program(target); + struct st_program *p = st_program(target); struct st_common_variant *v, **prevPtr = &p->variants; for (v = p->variants; v; ) { @@ -2012,7 +2012,7 @@ st_precompile_shader_variant(struct st_context *st, { switch (prog->Target) { case GL_VERTEX_PROGRAM_ARB: { - struct st_common_program *p = (struct st_common_program *)prog; + struct st_program *p = (struct st_program *)prog; struct st_common_variant_key key; memset(&key, 0, sizeof(key)); @@ -2023,7 +2023,7 @@ st_precompile_shader_variant(struct st_context *st, } case GL_FRAGMENT_PROGRAM_ARB: { - struct st_common_program *p = (struct st_common_program *)prog; + struct st_program *p = (struct st_program *)prog; struct st_fp_variant_key key; memset(&key, 0, sizeof(key)); @@ -2037,7 +2037,7 @@ st_precompile_shader_variant(struct st_context *st, case GL_TESS_EVALUATION_PROGRAM_NV: case GL_GEOMETRY_PROGRAM_NV: case GL_COMPUTE_PROGRAM_NV: { - struct st_common_program *p = st_common_program(prog); + struct st_program *p = st_program(prog); struct st_common_variant_key key; memset(&key, 0, sizeof(key)); @@ -2057,9 +2057,9 @@ 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_common_program *)prog); + st->dirty |= ST_NEW_VERTEX_PROGRAM(st, (struct st_program *)prog); else - st->dirty |= ((struct st_common_program *)prog)->affected_states; + st->dirty |= ((struct st_program *)prog)->affected_states; } /* Create Gallium shaders now instead of on demand. */ diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 3ec455d2744..8c060770719 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -235,7 +235,7 @@ struct st_common_variant /** * Derived from Mesa gl_program: */ -struct st_common_program +struct st_program { struct gl_program Base; struct pipe_shader_state state; @@ -263,16 +263,16 @@ struct st_common_program }; -static inline struct st_common_program * -st_common_program( struct gl_program *cp ) +static inline struct st_program * +st_program( struct gl_program *cp ) { - return (struct st_common_program *)cp; + return (struct st_program *)cp; } static inline void st_reference_prog(struct st_context *st, - struct st_common_program **ptr, - struct st_common_program *prog) + struct st_program **ptr, + struct st_program *prog) { _mesa_reference_program(st->ctx, (struct gl_program **) ptr, @@ -294,30 +294,30 @@ 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_common_program *stvp, + struct st_program *stvp, const struct st_common_variant_key *key); extern struct st_fp_variant * st_get_fp_variant(struct st_context *st, - struct st_common_program *stfp, + struct st_program *stfp, const struct st_fp_variant_key *key); extern struct st_common_variant * st_get_common_variant(struct st_context *st, - struct st_common_program *p, + struct st_program *p, const struct st_common_variant_key *key); extern void st_release_vp_variants( struct st_context *st, - struct st_common_program *stvp ); + struct st_program *stvp ); extern void st_release_fp_variants( struct st_context *st, - struct st_common_program *stfp ); + struct st_program *stfp ); extern void -st_release_common_variants(struct st_context *st, struct st_common_program *p); +st_release_common_variants(struct st_context *st, struct st_program *p); extern void st_destroy_program_variants(struct st_context *st); @@ -326,22 +326,22 @@ extern void st_finalize_nir_before_variants(struct nir_shader *nir); extern void -st_prepare_vertex_program(struct st_common_program *stvp); +st_prepare_vertex_program(struct st_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_common_program *stvp); + struct st_program *stvp); extern bool st_translate_fragment_program(struct st_context *st, - struct st_common_program *stfp); + struct st_program *stfp); extern bool st_translate_common_program(struct st_context *st, - struct st_common_program *stcp); + struct st_program *stcp); extern void st_finalize_program(struct st_context *st, struct gl_program *prog); diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c index bc464ec4a08..19b538eefd2 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_common_program *stvp = (struct st_common_program *) prog; + struct st_program *stvp = (struct st_program *) prog; blob_write_uint32(&blob, stvp->num_inputs); blob_write_bytes(&blob, stvp->index_to_input, @@ -109,7 +109,7 @@ st_serialise_ir_program(struct gl_context *ctx, struct gl_program *prog, case MESA_SHADER_GEOMETRY: case MESA_SHADER_FRAGMENT: case MESA_SHADER_COMPUTE: { - struct st_common_program *stcp = (struct st_common_program *) prog; + struct st_program *stcp = (struct st_program *) prog; if (prog->info.stage == MESA_SHADER_TESS_EVAL || prog->info.stage == MESA_SHADER_GEOMETRY) @@ -192,7 +192,7 @@ st_deserialise_ir_program(struct gl_context *ctx, switch (prog->info.stage) { case MESA_SHADER_VERTEX: { - struct st_common_program *stvp = (struct st_common_program *) prog; + struct st_program *stvp = (struct st_program *) prog; st_release_vp_variants(st, stvp); @@ -221,7 +221,7 @@ st_deserialise_ir_program(struct gl_context *ctx, case MESA_SHADER_GEOMETRY: case MESA_SHADER_FRAGMENT: case MESA_SHADER_COMPUTE: { - struct st_common_program *stcp = st_common_program(prog); + struct st_program *stcp = st_program(prog); if (prog->info.stage == MESA_SHADER_FRAGMENT) st_release_fp_variants(st, stcp); -- 2.30.2