nir/lower-tex: make options a local var
Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
@@ -279,6 +279,7 @@ static bool
|
|||||||
nir_lower_tex_block(nir_block *block, void *void_state)
|
nir_lower_tex_block(nir_block *block, void *void_state)
|
||||||
{
|
{
|
||||||
lower_tex_state *state = void_state;
|
lower_tex_state *state = void_state;
|
||||||
|
const nir_lower_tex_options *options = state->options;
|
||||||
nir_builder *b = &state->b;
|
nir_builder *b = &state->b;
|
||||||
|
|
||||||
nir_foreach_instr_safe(block, instr) {
|
nir_foreach_instr_safe(block, instr) {
|
||||||
@@ -286,16 +287,16 @@ nir_lower_tex_block(nir_block *block, void *void_state)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
nir_tex_instr *tex = nir_instr_as_tex(instr);
|
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): */
|
/* mask of src coords to saturate (clamp): */
|
||||||
unsigned sat_mask = 0;
|
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 */
|
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 */
|
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 */
|
sat_mask |= (1 << 0); /* .x */
|
||||||
|
|
||||||
/* If we are clamping any coords, we must lower projector first
|
/* 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;
|
state->progress = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tex->sampler_dim == GLSL_SAMPLER_DIM_RECT) &&
|
if ((tex->sampler_dim == GLSL_SAMPLER_DIM_RECT) && options->lower_rect) {
|
||||||
state->options->lower_rect) {
|
|
||||||
lower_rect(b, tex);
|
lower_rect(b, tex);
|
||||||
state->progress = true;
|
state->progress = true;
|
||||||
}
|
}
|
||||||
@@ -317,10 +317,10 @@ nir_lower_tex_block(nir_block *block, void *void_state)
|
|||||||
state->progress = true;
|
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) &&
|
!nir_tex_instr_is_query(tex) &&
|
||||||
!(tex->is_shadow && tex->is_new_style_shadow)) {
|
!(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;
|
state->progress = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user