diff options
author | Timothy Arceri <[email protected]> | 2016-10-19 12:30:09 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-10-26 14:29:36 +1100 |
commit | 81faead818a0b2fde131df019f5dfb0baef49273 (patch) | |
tree | 66610c70a8ed5a963ce927729e8a56115142783d /src/mesa/state_tracker | |
parent | 0ab51f8e164b33c5e3bc6836d0574080ef9d1dd8 (diff) |
mesa/i965/i915/r200: eliminate gl_vertex_program
Here we move the only field in gl_vertex_program to the
ARB program fields in gl_program.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_constbuf.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_rasterizer.c | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_sampler.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_shader.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_feedback.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_program.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_debug.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 35 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.h | 4 |
11 files changed, 34 insertions, 35 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index dc4e1432eab..573615e2ea0 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -69,7 +69,7 @@ static void check_program_state( struct st_context *st ) struct st_geometry_program *old_gp = st->gp; struct st_fragment_program *old_fp = st->fp; - struct gl_vertex_program *new_vp = ctx->VertexProgram._Current; + struct gl_program *new_vp = ctx->VertexProgram._Current; struct gl_program *new_tcp = ctx->TessCtrlProgram._Current; struct gl_program *new_tep = ctx->TessEvalProgram._Current; struct gl_program *new_gp = ctx->GeometryProgram._Current; @@ -122,7 +122,7 @@ static void check_attrib_edgeflag(struct st_context *st) { const struct gl_client_array **arrays = st->ctx->Array._DrawArrays; GLboolean vertdata_edgeflags, edgeflag_culls_prims, edgeflags_enabled; - struct gl_vertex_program *vp = st->ctx->VertexProgram._Current; + struct gl_program *vp = st->ctx->VertexProgram._Current; if (!arrays) return; diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 74d18e34ac9..bc9a1568ed3 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -142,7 +142,7 @@ void st_upload_constants( struct st_context *st, static void update_vs_constants(struct st_context *st ) { struct st_vertex_program *vp = st->vp; - struct gl_program_parameter_list *params = vp->Base.Base.Parameters; + struct gl_program_parameter_list *params = vp->Base.Parameters; st_upload_constants( st, params, MESA_SHADER_VERTEX ); } diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index 1598f5e260e..e365a45fca2 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -62,7 +62,7 @@ static void update_raster_state( struct st_context *st ) { struct gl_context *ctx = st->ctx; struct pipe_rasterizer_state *raster = &st->state.rasterizer; - const struct gl_vertex_program *vertProg = ctx->VertexProgram._Current; + const struct gl_program *vertProg = ctx->VertexProgram._Current; const struct gl_fragment_program *fragProg = ctx->FragmentProgram._Current; memset(raster, 0, sizeof(*raster)); @@ -194,8 +194,8 @@ static void update_raster_state( struct st_context *st ) /* ST_NEW_VERTEX_PROGRAM */ if (vertProg) { - if (vertProg->Base.Id == 0) { - if (vertProg->Base.OutputsWritten & BITFIELD64_BIT(VARYING_SLOT_PSIZ)) { + if (vertProg->Id == 0) { + if (vertProg->OutputsWritten & BITFIELD64_BIT(VARYING_SLOT_PSIZ)) { /* generated program which emits point size */ raster->point_size_per_vertex = TRUE; } @@ -213,7 +213,7 @@ static void update_raster_state( struct st_context *st ) else if (ctx->TessEvalProgram._Current) last = ctx->TessEvalProgram._Current; else if (ctx->VertexProgram._Current) - last = &ctx->VertexProgram._Current->Base; + last = ctx->VertexProgram._Current; if (last) raster->point_size_per_vertex = !!(last->OutputsWritten & BITFIELD64_BIT(VARYING_SLOT_PSIZ)); diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index f17029872dc..91baa59df25 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -328,7 +328,7 @@ update_samplers(struct st_context *st) update_shader_samplers(st, PIPE_SHADER_VERTEX, - &ctx->VertexProgram._Current->Base, + ctx->VertexProgram._Current, ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits, st->state.samplers[PIPE_SHADER_VERTEX], &st->state.num_samplers[PIPE_SHADER_VERTEX]); diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 02f789c5009..554e342e805 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -175,7 +175,7 @@ update_vp( struct st_context *st ) */ assert(st->ctx->VertexProgram._Current); stvp = st_vertex_program(st->ctx->VertexProgram._Current); - assert(stvp->Base.Base.Target == GL_VERTEX_PROGRAM_ARB); + assert(stvp->Base.Target == GL_VERTEX_PROGRAM_ARB); memset(&key, 0, sizeof key); key.st = st->has_shareable_shaders ? NULL : st; @@ -190,7 +190,7 @@ update_vp( struct st_context *st ) key.clamp_color = st->clamp_vert_color_in_shader && st->ctx->Light._ClampVertexColor && - (stvp->Base.Base.OutputsWritten & + (stvp->Base.OutputsWritten & (VARYING_SLOT_COL0 | VARYING_SLOT_COL1 | VARYING_SLOT_BFC0 | diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index df77a38c46e..e4257dd2271 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -207,7 +207,7 @@ update_vertex_textures(struct st_context *st) if (ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits > 0) { update_textures(st, MESA_SHADER_VERTEX, - &ctx->VertexProgram._Current->Base, + ctx->VertexProgram._Current, ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits, st->state.sampler_views[PIPE_SHADER_VERTEX], &st->state.num_sampler_views[PIPE_SHADER_VERTEX]); diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index d624d9f176b..7f383ebce78 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -292,7 +292,7 @@ st_RenderMode(struct gl_context *ctx, GLenum newMode ) vbo_set_draw_func(ctx, st_feedback_draw_vbo); } else { - struct gl_vertex_program *vp = st->ctx->VertexProgram._Current; + struct gl_program *vp = st->ctx->VertexProgram._Current; if (!st->feedback_stage) st->feedback_stage = draw_glfeedback_stage(ctx, draw); diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 6dce2f61b9e..fb0bdd2ded3 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -59,7 +59,7 @@ st_new_program(struct gl_context *ctx, GLenum target, GLuint id) switch (target) { case GL_VERTEX_PROGRAM_ARB: { struct st_vertex_program *prog = ST_CALLOC_STRUCT(st_vertex_program); - return _mesa_init_gl_program(&prog->Base.Base, target, id); + return _mesa_init_gl_program(&prog->Base, target, id); } case GL_FRAGMENT_PROGRAM_ARB: { struct st_fragment_program *prog = ST_CALLOC_STRUCT(st_fragment_program); diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index b51f350d216..1e5bbba95a7 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -98,8 +98,8 @@ st_print_current(void) if (st->vp->variants) tgsi_dump( st->vp->variants[0].tgsi.tokens, 0 ); - if (st->vp->Base.Base.Parameters) - _mesa_print_parameter_list(st->vp->Base.Base.Parameters); + if (st->vp->Base.Parameters) + _mesa_print_parameter_list(st->vp->Base.Parameters); tgsi_dump(st->fp->tgsi.tokens, 0); if (st->fp->Base.Base.Parameters) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 9f90f6b3cc3..e671e129390 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -250,11 +250,11 @@ st_translate_vertex_program(struct st_context *st, * and TGSI generic input indexes, plus input attrib semantic info. */ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { - if ((stvp->Base.Base.InputsRead & BITFIELD64_BIT(attr)) != 0) { + if ((stvp->Base.InputsRead & BITFIELD64_BIT(attr)) != 0) { input_to_index[attr] = stvp->num_inputs; stvp->index_to_input[stvp->num_inputs] = attr; stvp->num_inputs++; - if ((stvp->Base.Base.DoubleInputsRead & BITFIELD64_BIT(attr)) != 0) { + if ((stvp->Base.DoubleInputsRead & BITFIELD64_BIT(attr)) != 0) { /* add placeholder for second part of a double attribute */ stvp->index_to_input[stvp->num_inputs] = ST_DOUBLE_ATTRIB_PLACEHOLDER; stvp->num_inputs++; @@ -268,7 +268,7 @@ st_translate_vertex_program(struct st_context *st, /* Compute mapping of vertex program outputs to slots. */ for (attr = 0; attr < VARYING_SLOT_MAX; attr++) { - if ((stvp->Base.Base.OutputsWritten & BITFIELD64_BIT(attr)) == 0) { + if ((stvp->Base.OutputsWritten & BITFIELD64_BIT(attr)) == 0) { stvp->result_to_output[attr] = ~0; } else { @@ -367,7 +367,7 @@ st_translate_vertex_program(struct st_context *st, /* ARB_vp: */ if (!stvp->glsl_to_tgsi && !stvp->shader_program) { - _mesa_remove_output_reads(&stvp->Base.Base, PROGRAM_OUTPUT); + _mesa_remove_output_reads(&stvp->Base, PROGRAM_OUTPUT); /* This determines which states will be updated when the assembly * shader is bound. @@ -376,15 +376,14 @@ st_translate_vertex_program(struct st_context *st, ST_NEW_RASTERIZER | ST_NEW_VERTEX_ARRAYS; - if (stvp->Base.Base.Parameters->NumParameters) + if (stvp->Base.Parameters->NumParameters) stvp->affected_states |= ST_NEW_VS_CONSTANTS; /* No samplers are allowed in ARB_vp. */ } if (stvp->shader_program) { - nir_shader *nir = st_glsl_to_nir(st, &stvp->Base.Base, - stvp->shader_program, + nir_shader *nir = st_glsl_to_nir(st, &stvp->Base, stvp->shader_program, MESA_SHADER_VERTEX); stvp->tgsi.type = PIPE_SHADER_IR_NIR; @@ -400,16 +399,16 @@ st_translate_vertex_program(struct st_context *st, if (ureg == NULL) return false; - if (stvp->Base.Base.ClipDistanceArraySize) + if (stvp->Base.ClipDistanceArraySize) ureg_property(ureg, TGSI_PROPERTY_NUM_CLIPDIST_ENABLED, - stvp->Base.Base.ClipDistanceArraySize); - if (stvp->Base.Base.CullDistanceArraySize) + stvp->Base.ClipDistanceArraySize); + if (stvp->Base.CullDistanceArraySize) ureg_property(ureg, TGSI_PROPERTY_NUM_CULLDIST_ENABLED, - stvp->Base.Base.CullDistanceArraySize); + stvp->Base.CullDistanceArraySize); if (ST_DEBUG & DEBUG_MESA) { - _mesa_print_program(&stvp->Base.Base); - _mesa_print_program_parameters(st->ctx, &stvp->Base.Base); + _mesa_print_program(&stvp->Base); + _mesa_print_program_parameters(st->ctx, &stvp->Base); debug_printf("\n"); } @@ -418,7 +417,7 @@ st_translate_vertex_program(struct st_context *st, PIPE_SHADER_VERTEX, ureg, stvp->glsl_to_tgsi, - &stvp->Base.Base, + &stvp->Base, /* inputs */ stvp->num_inputs, input_to_index, @@ -444,7 +443,7 @@ st_translate_vertex_program(struct st_context *st, error = st_translate_mesa_program(st->ctx, PIPE_SHADER_VERTEX, ureg, - &stvp->Base.Base, + &stvp->Base, /* inputs */ stvp->num_inputs, input_to_index, @@ -459,7 +458,7 @@ st_translate_vertex_program(struct st_context *st, if (error) { debug_printf("%s: failed to translate Mesa program:\n", __func__); - _mesa_print_program(&stvp->Base.Base); + _mesa_print_program(&stvp->Base); debug_assert(0); return false; } @@ -489,7 +488,7 @@ st_create_vp_variant(struct st_context *st, if (key->passthrough_edgeflags) NIR_PASS_V(vpv->tgsi.ir.nir, nir_lower_passthrough_edgeflags); - st_finalize_nir(st, &stvp->Base.Base, vpv->tgsi.ir.nir); + st_finalize_nir(st, &stvp->Base, vpv->tgsi.ir.nir); vpv->driver_shader = pipe->create_vs_state(pipe, &vpv->tgsi); /* driver takes ownership of IR: */ @@ -1913,7 +1912,7 @@ st_print_current_vertex_program(void) (struct st_vertex_program *) ctx->VertexProgram._Current; struct st_vp_variant *stv; - debug_printf("Vertex program %u\n", stvp->Base.Base.Id); + debug_printf("Vertex program %u\n", stvp->Base.Id); for (stv = stvp->variants; stv; stv = stv->next) { debug_printf("variant %p\n", stv); diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index ab01d7ba8d0..0263c8eb39e 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -201,7 +201,7 @@ struct st_vp_variant */ struct st_vertex_program { - struct gl_vertex_program Base; /**< The Mesa vertex program */ + struct gl_program Base; /**< The Mesa vertex 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 */ @@ -309,7 +309,7 @@ st_fragment_program( struct gl_fragment_program *fp ) static inline struct st_vertex_program * -st_vertex_program( struct gl_vertex_program *vp ) +st_vertex_program( struct gl_program *vp ) { return (struct st_vertex_program *)vp; } |