nir/tex_instr: Rename sampler to texture

We're about to separate the two concepts.  When we do, the sampler will
become optional.  Doing a rename first makes the separation a bit more
safe because drivers that depend on GLSL or TGSI behaviour will be fine to
just use the texture index all the time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Jason Ekstrand
2016-02-06 09:05:10 -08:00
parent 3f42184994
commit ee85014b90
18 changed files with 95 additions and 95 deletions

View File

@@ -133,7 +133,7 @@ get_texture_size(nir_builder *b, nir_tex_instr *tex)
txs = nir_tex_instr_create(b->shader, 1);
txs->op = nir_texop_txs;
txs->sampler_dim = GLSL_SAMPLER_DIM_RECT;
txs->sampler_index = tex->sampler_index;
txs->texture_index = tex->texture_index;
txs->dest_type = nir_type_int;
/* only single src, the lod: */
@@ -291,11 +291,11 @@ nir_lower_tex_block(nir_block *block, void *void_state)
/* mask of src coords to saturate (clamp): */
unsigned sat_mask = 0;
if ((1 << tex->sampler_index) & state->options->saturate_r)
if ((1 << tex->texture_index) & state->options->saturate_r)
sat_mask |= (1 << 2); /* .z */
if ((1 << tex->sampler_index) & state->options->saturate_t)
if ((1 << tex->texture_index) & state->options->saturate_t)
sat_mask |= (1 << 1); /* .y */
if ((1 << tex->sampler_index) & state->options->saturate_s)
if ((1 << tex->texture_index) & state->options->saturate_s)
sat_mask |= (1 << 0); /* .x */
/* If we are clamping any coords, we must lower projector first
@@ -317,10 +317,10 @@ nir_lower_tex_block(nir_block *block, void *void_state)
state->progress = true;
}
if (((1 << tex->sampler_index) & state->options->swizzle_result) &&
if (((1 << tex->texture_index) & state->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->sampler_index]);
swizzle_result(b, tex, state->options->swizzles[tex->texture_index]);
state->progress = true;
}
}