diff options
author | Rob Clark <robclark@freedesktop.org> | 2016-04-19 07:46:50 -0400 |
---|---|---|
committer | Rob Clark <robclark@freedesktop.org> | 2016-04-19 16:12:49 -0400 |
commit | 52ccc6349fe42a8a480d7472c61c8eb069aadb6b (patch) | |
tree | d9107dae7dd1079a5a56a956648ae629b7d411bd /src/compiler | |
parent | d4ff42bd0a80acfac080507e4e14f33f0b3bffbb (diff) |
nir/lower-tex: make options a local var
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_lower_tex.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index 4999603e592..7740e588790 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -279,6 +279,7 @@ static bool nir_lower_tex_block(nir_block *block, void *void_state) { lower_tex_state *state = void_state; + const nir_lower_tex_options *options = state->options; nir_builder *b = &state->b; nir_foreach_instr_safe(block, instr) { @@ -286,16 +287,16 @@ nir_lower_tex_block(nir_block *block, void *void_state) continue; nir_tex_instr *tex = nir_instr_as_tex(instr); - bool lower_txp = !!(state->options->lower_txp & (1 << tex->sampler_dim)); + bool lower_txp = !!(options->lower_txp & (1 << tex->sampler_dim)); /* mask of src coords to saturate (clamp): */ unsigned sat_mask = 0; - if ((1 << tex->sampler_index) & state->options->saturate_r) + if ((1 << tex->sampler_index) & options->saturate_r) sat_mask |= (1 << 2); /* .z */ - if ((1 << tex->sampler_index) & state->options->saturate_t) + if ((1 << tex->sampler_index) & options->saturate_t) sat_mask |= (1 << 1); /* .y */ - if ((1 << tex->sampler_index) & state->options->saturate_s) + if ((1 << tex->sampler_index) & options->saturate_s) sat_mask |= (1 << 0); /* .x */ /* If we are clamping any coords, we must lower projector first @@ -306,8 +307,7 @@ nir_lower_tex_block(nir_block *block, void *void_state) state->progress = true; } - if ((tex->sampler_dim == GLSL_SAMPLER_DIM_RECT) && - state->options->lower_rect) { + if ((tex->sampler_dim == GLSL_SAMPLER_DIM_RECT) && options->lower_rect) { lower_rect(b, tex); state->progress = true; } @@ -317,10 +317,10 @@ nir_lower_tex_block(nir_block *block, void *void_state) state->progress = true; } - if (((1 << tex->texture_index) & state->options->swizzle_result) && + if (((1 << tex->texture_index) & options->swizzle_result) && !nir_tex_instr_is_query(tex) && !(tex->is_shadow && tex->is_new_style_shadow)) { - swizzle_result(b, tex, state->options->swizzles[tex->texture_index]); + swizzle_result(b, tex, options->swizzles[tex->texture_index]); state->progress = true; } } |