diff options
author | Timothy Arceri <[email protected]> | 2016-11-17 10:52:28 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-11-17 12:53:12 +1100 |
commit | c3df65c123c6392b0b116900395a89fd3dbb9b85 (patch) | |
tree | 2b7c4a89aff0ccbbfb7f9fec4e0b0459858b58bb /src/mesa/drivers/dri/r200 | |
parent | d6bdb3a86293da2164e9355f0262ef83afeece7f (diff) |
st/mesa/r200/i915/i965: move ARB program fields into a union
It's common for games to compile 2000 programs or more so at
32bits x 2000 programs x 22 fields x 2 (at least) stages
This should give us something like 352 kilobytes in savings
once we add some more glsl only fields.
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_state_init.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_vertprog.c | 36 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index f31a19150df..8e14ba73ff9 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -271,8 +271,8 @@ TCL_OR_VP_CHECK( tcl_or_vp, GL_TRUE, 0 ) TCL_OR_VP_CHECK( tcl_or_vp_add2, GL_TRUE, 2 ) VP_CHECK( tcl_vp, GL_TRUE, 0 ) VP_CHECK( tcl_vp_add4, GL_TRUE, 4 ) -VP_CHECK( tcl_vp_size_add4, ctx->VertexProgram.Current->NumNativeInstructions > 64, 4 ) -VP_CHECK( tcl_vpp_size_add4, ctx->VertexProgram.Current->NumNativeParameters > 96, 4 ) +VP_CHECK( tcl_vp_size_add4, ctx->VertexProgram.Current->arb.NumNativeInstructions > 64, 4 ) +VP_CHECK( tcl_vpp_size_add4, ctx->VertexProgram.Current->arb.NumNativeParameters > 96, 4 ) #define OUT_VEC(hdr, data) do { \ drm_radeon_cmd_header_t h; \ diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c index 5965c6e8048..ded8e2af244 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.c +++ b/src/mesa/drivers/dri/r200/r200_vertprog.c @@ -409,7 +409,7 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2 vp->translated = GL_TRUE; vp->fogmode = ctx->Fog.Mode; - if (mesa_vp->NumInstructions == 0) + if (mesa_vp->arb.NumInstructions == 0) return GL_FALSE; #if 0 @@ -445,7 +445,7 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2 struct prog_dst_register dst; /* FIXME: is changing the prog safe to do here? */ - if (mesa_vp->IsPositionInvariant && + if (mesa_vp->arb.IsPositionInvariant && /* make sure we only do this once */ !(mesa_vp->info.outputs_written & (1 << VARYING_SLOT_POS))) { _mesa_insert_mvp_code(ctx, mesa_vp); @@ -462,11 +462,11 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2 } vp->pos_end = 0; - mesa_vp->NumNativeInstructions = 0; + mesa_vp->arb.NumNativeInstructions = 0; if (mesa_vp->Parameters) - mesa_vp->NumNativeParameters = mesa_vp->Parameters->NumParameters; + mesa_vp->arb.NumNativeParameters = mesa_vp->Parameters->NumParameters; else - mesa_vp->NumNativeParameters = 0; + mesa_vp->arb.NumNativeParameters = 0; for(i = 0; i < VERT_ATTRIB_MAX; i++) vp->inputs[i] = -1; @@ -590,7 +590,7 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2 } o_inst = vp->instr; - for (vpi = mesa_vp->Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){ + for (vpi = mesa_vp->arb.Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){ operands = op_operands(vpi->Opcode); are_srcs_scalar = operands & SCALAR_FLAG; operands &= OP_MASK; @@ -1070,20 +1070,20 @@ else { } u_temp_used = (R200_VSF_MAX_TEMPS - 1) - u_temp_i; - if (mesa_vp->NumNativeTemporaries < - (mesa_vp->NumTemporaries + u_temp_used)) { - mesa_vp->NumNativeTemporaries = - mesa_vp->NumTemporaries + u_temp_used; + if (mesa_vp->arb.NumNativeTemporaries < + (mesa_vp->arb.NumTemporaries + u_temp_used)) { + mesa_vp->arb.NumNativeTemporaries = + mesa_vp->arb.NumTemporaries + u_temp_used; } - if ((mesa_vp->NumTemporaries + u_temp_used) > R200_VSF_MAX_TEMPS) { + if ((mesa_vp->arb.NumTemporaries + u_temp_used) > R200_VSF_MAX_TEMPS) { if (R200_DEBUG & RADEON_FALLBACKS) { - fprintf(stderr, "Ran out of temps, num temps %d, us %d\n", mesa_vp->NumTemporaries, u_temp_used); + fprintf(stderr, "Ran out of temps, num temps %d, us %d\n", mesa_vp->arb.NumTemporaries, u_temp_used); } return GL_FALSE; } u_temp_i = R200_VSF_MAX_TEMPS - 1; if(o_inst - vp->instr >= R200_VSF_MAX_INST) { - mesa_vp->NumNativeInstructions = 129; + mesa_vp->arb.NumNativeInstructions = 129; if (R200_DEBUG & RADEON_FALLBACKS) { fprintf(stderr, "more than 128 native instructions\n"); } @@ -1095,7 +1095,7 @@ else { } vp->native = GL_TRUE; - mesa_vp->NumNativeInstructions = (o_inst - vp->instr); + mesa_vp->arb.NumNativeInstructions = (o_inst - vp->instr); #if 0 fprintf(stderr, "hw program:\n"); for(i=0; i < vp->program.length; i++) @@ -1127,15 +1127,15 @@ void r200SetupVertexProg( struct gl_context *ctx ) { R200_STATECHANGE( rmesa, pvs ); rmesa->hw.pvs.cmd[PVS_CNTL_1] = (0 << R200_PVS_CNTL_1_PROGRAM_START_SHIFT) | - ((vp->mesa_program.NumNativeInstructions - 1) << R200_PVS_CNTL_1_PROGRAM_END_SHIFT) | + ((vp->mesa_program.arb.NumNativeInstructions - 1) << R200_PVS_CNTL_1_PROGRAM_END_SHIFT) | (vp->pos_end << R200_PVS_CNTL_1_POS_END_SHIFT); rmesa->hw.pvs.cmd[PVS_CNTL_2] = (0 << R200_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | - (vp->mesa_program.NumNativeParameters << R200_PVS_CNTL_2_PARAM_COUNT_SHIFT); + (vp->mesa_program.arb.NumNativeParameters << R200_PVS_CNTL_2_PARAM_COUNT_SHIFT); /* maybe user clip planes just work with vertex progs... untested */ if (ctx->Transform.ClipPlanesEnabled) { R200_STATECHANGE( rmesa, tcl ); - if (vp->mesa_program.IsPositionInvariant) { + if (vp->mesa_program.arb.IsPositionInvariant) { rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= (ctx->Transform.ClipPlanesEnabled << 2); } else { @@ -1144,7 +1144,7 @@ void r200SetupVertexProg( struct gl_context *ctx ) { } if (vp != rmesa->curr_vp_hw) { - GLuint count = vp->mesa_program.NumNativeInstructions; + GLuint count = vp->mesa_program.arb.NumNativeInstructions; drm_radeon_cmd_header_t tmp; R200_STATECHANGE( rmesa, vpi[0] ); |