diff options
author | Marek Olšák <[email protected]> | 2017-11-16 04:29:35 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-02-13 01:00:45 +0100 |
commit | e149a0253c12d103805230bc7bc0a36887c3b8df (patch) | |
tree | 2eedb0e74a1d0f71c76634ac165f925feecfa1b3 /src/mesa/program/programopt.c | |
parent | a7882013d3e788a76cce638704c02b7bea0e67a1 (diff) |
mesa,glsl,nir: reduce gl_state_index size to 2 bytes
Let's use the new gl_state_index16 type everywhere and remove
the typecasts.
This helps reduce the size of gl_program_parameter.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/program/programopt.c')
-rw-r--r-- | src/mesa/program/programopt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/program/programopt.c b/src/mesa/program/programopt.c index f560bce62e4..a9c0beb31bc 100644 --- a/src/mesa/program/programopt.c +++ b/src/mesa/program/programopt.c @@ -57,7 +57,7 @@ insert_mvp_dp4_code(struct gl_context *ctx, struct gl_program *vprog) * Setup state references for the modelview/projection matrix. * XXX we should check if these state vars are already declared. */ - static const gl_state_index mvpState[4][STATE_LENGTH] = { + static const gl_state_index16 mvpState[4][STATE_LENGTH] = { { STATE_MVP_MATRIX, 0, 0, 0, 0 }, /* state.matrix.mvp.row[0] */ { STATE_MVP_MATRIX, 0, 1, 1, 0 }, /* state.matrix.mvp.row[1] */ { STATE_MVP_MATRIX, 0, 2, 2, 0 }, /* state.matrix.mvp.row[2] */ @@ -125,7 +125,7 @@ insert_mvp_mad_code(struct gl_context *ctx, struct gl_program *vprog) * Setup state references for the modelview/projection matrix. * XXX we should check if these state vars are already declared. */ - static const gl_state_index mvpState[4][STATE_LENGTH] = { + static const gl_state_index16 mvpState[4][STATE_LENGTH] = { { STATE_MVP_MATRIX, 0, 0, 0, STATE_MATRIX_TRANSPOSE }, { STATE_MVP_MATRIX, 0, 1, 1, STATE_MATRIX_TRANSPOSE }, { STATE_MVP_MATRIX, 0, 2, 2, STATE_MATRIX_TRANSPOSE }, @@ -247,9 +247,9 @@ void _mesa_append_fog_code(struct gl_context *ctx, struct gl_program *fprog, GLenum fog_mode, GLboolean saturate) { - static const gl_state_index fogPStateOpt[STATE_LENGTH] + static const gl_state_index16 fogPStateOpt[STATE_LENGTH] = { STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED, 0, 0, 0 }; - static const gl_state_index fogColorState[STATE_LENGTH] + static const gl_state_index16 fogColorState[STATE_LENGTH] = { STATE_FOG_COLOR, 0, 0, 0, 0}; struct prog_instruction *newInst, *inst; const GLuint origLen = fprog->arb.NumInstructions; |