diff options
author | Jason Ekstrand <[email protected]> | 2016-02-06 09:05:10 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-02-09 15:00:17 -0800 |
commit | ee85014b90af1d94d637ec763a803479e9bac5dc (patch) | |
tree | 91a7aea9be51e8c18b18f40f237175e9471e0d41 /src/gallium | |
parent | 3f421849945d763b3e477ceb1c726c2dbed3bafd (diff) |
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 <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/nir/tgsi_to_nir.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index 61ff0a74379..8cd8ea4cb66 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -1309,13 +1309,13 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) instr->coord_components++; assert(tgsi_inst->Src[samp].Register.File == TGSI_FILE_SAMPLER); - instr->sampler_index = tgsi_inst->Src[samp].Register.Index; + instr->texture_index = tgsi_inst->Src[samp].Register.Index; /* TODO if we supported any opc's which take an explicit SVIEW * src, we would use that here instead. But for the "legacy" * texture opc's the SVIEW index is same as SAMP index: */ - sview = instr->sampler_index; + sview = instr->texture_index; if (op == nir_texop_lod) { instr->dest_type = nir_type_float; @@ -1456,8 +1456,8 @@ ttn_txq(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) setup_texture_info(qlv, tgsi_inst->Texture.Texture); assert(tgsi_inst->Src[1].Register.File == TGSI_FILE_SAMPLER); - txs->sampler_index = tgsi_inst->Src[1].Register.Index; - qlv->sampler_index = tgsi_inst->Src[1].Register.Index; + txs->texture_index = tgsi_inst->Src[1].Register.Index; + qlv->texture_index = tgsi_inst->Src[1].Register.Index; /* only single src, the lod: */ txs->src[0].src = nir_src_for_ssa(ttn_channel(b, src[0], X)); diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c index f38dc8643b4..63dd1700f9c 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c @@ -1548,7 +1548,7 @@ emit_tex(struct ir3_compile *ctx, nir_tex_instr *tex) type = TYPE_U32; sam = ir3_SAM(b, opc, type, TGSI_WRITEMASK_XYZW, - flags, tex->sampler_index, tex->sampler_index, + flags, tex->texture_index, tex->texture_index, create_collect(b, src0, nsrc0), create_collect(b, src1, nsrc1)); @@ -1575,7 +1575,7 @@ emit_tex_query_levels(struct ir3_compile *ctx, nir_tex_instr *tex) dst = get_dst(ctx, &tex->dest, 1); sam = ir3_SAM(b, OPC_GETINFO, TYPE_U32, TGSI_WRITEMASK_Z, 0, - tex->sampler_index, tex->sampler_index, NULL, NULL); + tex->texture_index, tex->texture_index, NULL, NULL); /* even though there is only one component, since it ends * up in .z rather than .x, we need a split_dest() @@ -1612,7 +1612,7 @@ emit_tex_txs(struct ir3_compile *ctx, nir_tex_instr *tex) lod = get_src(ctx, &tex->src[0].src)[0]; sam = ir3_SAM(b, OPC_GETSIZE, TYPE_U32, TGSI_WRITEMASK_XYZW, flags, - tex->sampler_index, tex->sampler_index, lod, NULL); + tex->texture_index, tex->texture_index, lod, NULL); split_dest(b, dst, sam, 4); diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c b/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c index 6a952c62d5f..f6ba5b802ad 100644 --- a/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c +++ b/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c @@ -47,8 +47,8 @@ vc4_nir_lower_txf_ms_instr(struct vc4_compile *c, nir_builder *b, nir_tex_instr *txf = nir_tex_instr_create(c->s, 1); txf->op = nir_texop_txf; - txf->sampler = txf_ms->sampler; - txf->sampler_index = txf_ms->sampler_index; + txf->texture = txf_ms->texture; + txf->texture_index = txf_ms->texture_index; txf->coord_components = txf_ms->coord_components; txf->is_shadow = txf_ms->is_shadow; txf->is_new_style_shadow = txf_ms->is_new_style_shadow; @@ -80,7 +80,7 @@ vc4_nir_lower_txf_ms_instr(struct vc4_compile *c, nir_builder *b, uint32_t tile_h_shift = 5; uint32_t tile_size = (tile_h * tile_w * VC4_MAX_SAMPLES * sizeof(uint32_t)); - unsigned unit = txf_ms->sampler_index; + unsigned unit = txf_ms->texture_index; uint32_t w = align(c->key->tex[unit].msaa_width, tile_w); uint32_t w_tiles = w / tile_w; diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 7db1b03cbc1..5c91c02b539 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -296,7 +296,7 @@ ntq_emit_txf(struct vc4_compile *c, nir_tex_instr *instr) uint32_t tile_size = (tile_height * tile_width * VC4_MAX_SAMPLES * sizeof(uint32_t)); - unsigned unit = instr->sampler_index; + unsigned unit = instr->texture_index; uint32_t w = align(c->key->tex[unit].msaa_width, tile_width); uint32_t w_tiles = w / tile_width; uint32_t h = align(c->key->tex[unit].msaa_height, tile_height); @@ -339,7 +339,7 @@ ntq_emit_tex(struct vc4_compile *c, nir_tex_instr *instr) { struct qreg s, t, r, lod, proj, compare; bool is_txb = false, is_txl = false, has_proj = false; - unsigned unit = instr->sampler_index; + unsigned unit = instr->texture_index; if (instr->op == nir_texop_txf) { ntq_emit_txf(c, instr); |