unsigned dmask = 0xf;
LLVMValueRef address[16];
LLVMValueRef coords[5];
- LLVMValueRef coord = NULL, lod = NULL, comparitor = NULL;
+ LLVMValueRef coord = NULL, lod = NULL, comparator = NULL;
LLVMValueRef bias = NULL, offsets = NULL;
LLVMValueRef res_ptr, samp_ptr, fmask_ptr = NULL, sample_index = NULL;
LLVMValueRef ddx = NULL, ddy = NULL;
break;
case nir_tex_src_projector:
break;
- case nir_tex_src_comparitor:
- comparitor = get_src(ctx, instr->src[i].src);
+ case nir_tex_src_comparator:
+ comparator = get_src(ctx, instr->src[i].src);
break;
case nir_tex_src_offset:
offsets = get_src(ctx, instr->src[i].src);
}
/* Pack depth comparison value */
- if (instr->is_shadow && comparitor) {
- address[count++] = llvm_extract_elem(ctx, comparitor, 0);
+ if (instr->is_shadow && comparator) {
+ address[count++] = llvm_extract_elem(ctx, comparator, 0);
}
/* pack derivatives */
_texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type),
_texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type),
/* samplerCubeArrayShadow is special; it has an extra parameter
- * for the shadow comparitor since there is no vec5 type.
+ * for the shadow comparator since there is no vec5 type.
*/
_textureCubeArrayShadow(),
if (coord_size == coord_type->vector_elements) {
tex->coordinate = var_ref(P);
} else {
- /* The incoming coordinate also has the projector or shadow comparitor,
+ /* The incoming coordinate also has the projector or shadow comparator,
* so we need to swizzle those away.
*/
tex->coordinate = swizzle_for_size(P, coord_size);
*/
ir_variable *refz = in_var(glsl_type::float_type, "refz");
sig->parameters.push_tail(refz);
- tex->shadow_comparitor = var_ref(refz);
+ tex->shadow_comparator = var_ref(refz);
} else {
- /* The shadow comparitor is normally in the Z component, but a few types
+ /* The shadow comparator is normally in the Z component, but a few types
* have sufficiently large coordinates that it's in W.
*/
- tex->shadow_comparitor = swizzle(P, MAX2(coord_size, SWIZZLE_Z), 1);
+ tex->shadow_comparator = swizzle(P, MAX2(coord_size, SWIZZLE_Z), 1);
}
}
tex->set_sampler(var_ref(s), glsl_type::float_type);
tex->coordinate = var_ref(P);
- tex->shadow_comparitor = var_ref(compare);
+ tex->shadow_comparator = var_ref(compare);
body.emit(ret(tex));
if (ir->projector != NULL)
num_srcs++;
- if (ir->shadow_comparitor != NULL)
+ if (ir->shadow_comparator != NULL)
num_srcs++;
if (ir->offset != NULL)
num_srcs++;
src_number++;
}
- if (ir->shadow_comparitor != NULL) {
+ if (ir->shadow_comparator != NULL) {
instr->src[src_number].src =
- nir_src_for_ssa(evaluate_rvalue(ir->shadow_comparitor));
- instr->src[src_number].src_type = nir_tex_src_comparitor;
+ nir_src_for_ssa(evaluate_rvalue(ir->shadow_comparator));
+ instr->src[src_number].src_type = nir_tex_src_comparator;
src_number++;
}
*
* Texel offset (0 or an expression)
* | Projection divisor
- * | | Shadow comparitor
+ * | | Shadow comparator
* | | |
* v v v
* (tex <type> <sampler> <coordinate> 0 1 ( ))
ir_texture(enum ir_texture_opcode op)
: ir_rvalue(ir_type_texture),
op(op), sampler(NULL), coordinate(NULL), projector(NULL),
- shadow_comparitor(NULL), offset(NULL)
+ shadow_comparator(NULL), offset(NULL)
{
memset(&lod_info, 0, sizeof(lod_info));
}
* If there is no shadow comparison, this will be \c NULL. For the
* \c ir_txf opcode, this *must* be \c NULL.
*/
- ir_rvalue *shadow_comparitor;
+ ir_rvalue *shadow_comparator;
/** Texel offset. */
ir_rvalue *offset;
new_tex->coordinate = this->coordinate->clone(mem_ctx, ht);
if (this->projector)
new_tex->projector = this->projector->clone(mem_ctx, ht);
- if (this->shadow_comparitor) {
- new_tex->shadow_comparitor = this->shadow_comparitor->clone(mem_ctx, ht);
+ if (this->shadow_comparator) {
+ new_tex->shadow_comparator = this->shadow_comparator->clone(mem_ctx, ht);
}
if (this->offset != NULL)
if (!possibly_null_equals(projector, other->projector, ignore))
return false;
- if (!possibly_null_equals(shadow_comparitor, other->shadow_comparitor, ignore))
+ if (!possibly_null_equals(shadow_comparator, other->shadow_comparator, ignore))
return false;
if (!possibly_null_equals(offset, other->offset, ignore))
return (s == visit_continue_with_parent) ? visit_continue : s;
}
- if (this->shadow_comparitor) {
- s = this->shadow_comparitor->accept(v);
+ if (this->shadow_comparator) {
+ s = this->shadow_comparator->accept(v);
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
}
else
fprintf(f, "1");
- if (ir->shadow_comparitor) {
+ if (ir->shadow_comparator) {
fprintf(f, " ");
- ir->shadow_comparitor->accept(this);
+ ir->shadow_comparator->accept(this);
} else {
fprintf(f, " ()");
}
}
if (s_shadow->subexpressions.is_empty()) {
- tex->shadow_comparitor = NULL;
+ tex->shadow_comparator = NULL;
} else {
- tex->shadow_comparitor = read_rvalue(s_shadow);
- if (tex->shadow_comparitor == NULL) {
- ir_read_error(NULL, "when reading shadow comparitor in (%s ..)",
+ tex->shadow_comparator = read_rvalue(s_shadow);
+ if (tex->shadow_comparator == NULL) {
+ ir_read_error(NULL, "when reading shadow comparator in (%s ..)",
tex->opcode_string());
return NULL;
}
{
handle_rvalue(&ir->coordinate);
handle_rvalue(&ir->projector);
- handle_rvalue(&ir->shadow_comparitor);
+ handle_rvalue(&ir->shadow_comparator);
handle_rvalue(&ir->offset);
switch (ir->op) {
ir->coordinate,
deref);
- if (ir->shadow_comparitor) {
+ if (ir->shadow_comparator) {
deref = new(mem_ctx) ir_dereference_variable(var);
- ir->shadow_comparitor = new(mem_ctx) ir_expression(ir_binop_mul,
- ir->shadow_comparitor->type,
- ir->shadow_comparitor,
+ ir->shadow_comparator = new(mem_ctx) ir_expression(ir_binop_mul,
+ ir->shadow_comparator->type,
+ ir->shadow_comparator,
deref);
}
if (do_graft(&ir->coordinate) ||
do_graft(&ir->projector) ||
do_graft(&ir->offset) ||
- do_graft(&ir->shadow_comparitor))
+ do_graft(&ir->shadow_comparator))
return visit_stop;
switch (ir->op) {
*
* Note that this is often different than actual coordinate type used in
* a texturing built-in function, since those pack additional values (such
- * as the shadow comparitor or projector) into the coordinate type.
+ * as the shadow comparator or projector) into the coordinate type.
*/
int coordinate_components() const;
typedef enum {
nir_tex_src_coord,
nir_tex_src_projector,
- nir_tex_src_comparitor, /* shadow comparitor */
+ nir_tex_src_comparator, /* shadow comparator */
nir_tex_src_offset,
nir_tex_src_bias,
nir_tex_src_lod,
}
case nir_tex_src_projector:
- case nir_tex_src_comparitor:
+ case nir_tex_src_comparator:
case nir_tex_src_bias:
case nir_tex_src_ddx:
case nir_tex_src_ddy:
for (unsigned i = 0; i < tex->num_srcs; i++) {
switch (tex->src[i].src_type) {
case nir_tex_src_coord:
- case nir_tex_src_comparitor:
+ case nir_tex_src_comparator:
break;
default:
continue;
case nir_tex_src_projector:
fprintf(fp, "(projector)");
break;
- case nir_tex_src_comparitor:
- fprintf(fp, "(comparitor)");
+ case nir_tex_src_comparator:
+ fprintf(fp, "(comparator)");
break;
case nir_tex_src_offset:
fprintf(fp, "(offset)");
case SpvOpImageSampleProjDrefExplicitLod:
case SpvOpImageDrefGather:
/* These all have an explicit depth value as their next source */
- (*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_comparitor);
+ (*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_comparator);
break;
case SpvOpImageGather:
else
instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[0], Z));
- instr->src[src_number].src_type = nir_tex_src_comparitor;
+ instr->src[src_number].src_type = nir_tex_src_comparator;
src_number++;
}
lod = get_src(ctx, &tex->src[i].src)[0];
has_lod = true;
break;
- case nir_tex_src_comparitor: /* shadow comparator */
+ case nir_tex_src_comparator: /* shadow comparator */
compare = get_src(ctx, &tex->src[i].src)[0];
break;
case nir_tex_src_projector:
lod = ntq_get_src(c, instr->src[i].src, 0);
is_txl = true;
break;
- case nir_tex_src_comparitor:
+ case nir_tex_src_comparator:
compare = ntq_get_src(c, instr->src[i].src, 0);
break;
default:
enum tex_logical_srcs {
/** Texture coordinates */
TEX_LOGICAL_SRC_COORDINATE,
- /** Shadow comparitor */
+ /** Shadow comparator */
TEX_LOGICAL_SRC_SHADOW_C,
/** dPdx if the operation takes explicit derivatives, otherwise LOD value */
TEX_LOGICAL_SRC_LOD,
}
if (has_lod) {
- /* Bias/LOD with shadow comparitor is unsupported in SIMD16 -- *Without*
- * shadow comparitor (including RESINFO) it's unsupported in SIMD8 mode.
+ /* Bias/LOD with shadow comparator is unsupported in SIMD16 -- *Without*
+ * shadow comparator (including RESINFO) it's unsupported in SIMD8 mode.
*/
assert(shadow_c.file != BAD_FILE ? bld.dispatch_width() == 8 :
bld.dispatch_width() == 16);
srcs[TEX_LOGICAL_SRC_LOD] =
retype(get_nir_src_imm(instr->src[i].src), BRW_REGISTER_TYPE_F);
break;
- case nir_tex_src_comparitor:
+ case nir_tex_src_comparator:
srcs[TEX_LOGICAL_SRC_SHADOW_C] = retype(src, BRW_REGISTER_TYPE_F);
break;
case nir_tex_src_coord:
/* Only lower textureGrad with cube maps or shadow samplers */
if (ir->op != ir_txd ||
(ir->sampler->type->sampler_dimensionality != GLSL_SAMPLER_DIM_CUBE &&
- !ir->shadow_comparitor))
+ !ir->shadow_comparator))
return visit_continue;
/* Lower textureGrad() with samplerCube* even if we have the sample_d_c
const glsl_type *dest_type,
src_reg coordinate,
int coord_components,
- src_reg shadow_comparitor,
+ src_reg shadow_comparator,
src_reg lod, src_reg lod2,
src_reg sample_index,
uint32_t constant_offset,
src_reg sampler_reg = brw_imm_ud(sampler);
src_reg coordinate;
const glsl_type *coord_type = NULL;
- src_reg shadow_comparitor;
+ src_reg shadow_comparator;
src_reg offset_value;
src_reg lod, lod2;
src_reg sample_index;
uint32_t constant_offset = 0;
for (unsigned i = 0; i < instr->num_srcs; i++) {
switch (instr->src[i].src_type) {
- case nir_tex_src_comparitor:
- shadow_comparitor = get_nir_src(instr->src[i].src,
+ case nir_tex_src_comparator:
+ shadow_comparator = get_nir_src(instr->src[i].src,
BRW_REGISTER_TYPE_F, 1);
break;
ir_texture_opcode op = ir_texture_opcode_for_nir_texop(instr->op);
emit_texture(op, dest, dest_type, coordinate, instr->coord_components,
- shadow_comparitor,
+ shadow_comparator,
lod, lod2, sample_index,
constant_offset, offset_value, mcs,
texture, texture_reg, sampler_reg);
const glsl_type *dest_type,
src_reg coordinate,
int coord_components,
- src_reg shadow_comparitor,
+ src_reg shadow_comparator,
src_reg lod, src_reg lod2,
src_reg sample_index,
uint32_t constant_offset,
inst->base_mrf = 2;
inst->mlen = inst->header_size;
inst->dst.writemask = WRITEMASK_XYZW;
- inst->shadow_compare = shadow_comparitor.file != BAD_FILE;
+ inst->shadow_compare = shadow_comparator.file != BAD_FILE;
inst->src[1] = surface_reg;
inst->src[2] = sampler_reg;
emit(MOV(dst_reg(MRF, param_base, coordinate.type, zero_mask),
brw_imm_d(0)));
}
- /* Load the shadow comparitor */
- if (shadow_comparitor.file != BAD_FILE && op != ir_txd && (op != ir_tg4 || offset_value.file == BAD_FILE)) {
- emit(MOV(dst_reg(MRF, param_base + 1, shadow_comparitor.type,
+ /* Load the shadow comparator */
+ if (shadow_comparator.file != BAD_FILE && op != ir_txd && (op != ir_tg4 || offset_value.file == BAD_FILE)) {
+ emit(MOV(dst_reg(MRF, param_base + 1, shadow_comparator.type,
WRITEMASK_X),
- shadow_comparitor));
+ shadow_comparator));
inst->mlen++;
}
int mrf, writemask;
if (devinfo->gen >= 5) {
mrf = param_base + 1;
- if (shadow_comparitor.file != BAD_FILE) {
+ if (shadow_comparator.file != BAD_FILE) {
writemask = WRITEMASK_Y;
/* mlen already incremented */
} else {
emit(MOV(dst_reg(MRF, param_base + 1, type, WRITEMASK_YW), lod2));
inst->mlen++;
- if (dest_type->vector_elements == 3 || shadow_comparitor.file != BAD_FILE) {
+ if (dest_type->vector_elements == 3 || shadow_comparator.file != BAD_FILE) {
lod.swizzle = BRW_SWIZZLE_ZZZZ;
lod2.swizzle = BRW_SWIZZLE_ZZZZ;
emit(MOV(dst_reg(MRF, param_base + 2, type, WRITEMASK_X), lod));
emit(MOV(dst_reg(MRF, param_base + 2, type, WRITEMASK_Y), lod2));
inst->mlen++;
- if (shadow_comparitor.file != BAD_FILE) {
+ if (shadow_comparator.file != BAD_FILE) {
emit(MOV(dst_reg(MRF, param_base + 2,
- shadow_comparitor.type, WRITEMASK_Z),
- shadow_comparitor));
+ shadow_comparator.type, WRITEMASK_Z),
+ shadow_comparator));
}
}
} else /* devinfo->gen == 4 */ {
inst->mlen += 2;
}
} else if (op == ir_tg4 && offset_value.file != BAD_FILE) {
- if (shadow_comparitor.file != BAD_FILE) {
- emit(MOV(dst_reg(MRF, param_base, shadow_comparitor.type, WRITEMASK_W),
- shadow_comparitor));
+ if (shadow_comparator.file != BAD_FILE) {
+ emit(MOV(dst_reg(MRF, param_base, shadow_comparator.type, WRITEMASK_W),
+ shadow_comparator));
}
emit(MOV(dst_reg(MRF, param_base + 1, glsl_type::ivec2_type, WRITEMASK_XY),
if (p->state->unit[unit].shadow) {
texcoord = texcoord->clone(p->mem_ctx, NULL);
- tex->shadow_comparitor = new(p->mem_ctx) ir_swizzle(texcoord,
+ tex->shadow_comparator = new(p->mem_ctx) ir_swizzle(texcoord,
coords, 0, 0, 0,
1);
coords++;
emit(ir, OPCODE_RCP, coord_dst, projector);
/* In the case where we have to project the coordinates "by hand,"
- * the shadow comparitor value must also be projected.
+ * the shadow comparator value must also be projected.
*/
src_reg tmp_src = coord;
- if (ir->shadow_comparitor) {
+ if (ir->shadow_comparator) {
/* Slot the shadow value in as the second to last component of the
* coord.
*/
- ir->shadow_comparitor->accept(this);
+ ir->shadow_comparator->accept(this);
tmp_src = get_temp(glsl_type::vec4_type);
dst_reg tmp_dst = dst_reg(tmp_src);
}
/* If projection is done and the opcode is not OPCODE_TXP, then the shadow
- * comparitor was put in the correct place (and projected) by the code,
+ * comparator was put in the correct place (and projected) by the code,
* above, that handles by-hand projection.
*/
- if (ir->shadow_comparitor && (!ir->projector || opcode == OPCODE_TXP)) {
+ if (ir->shadow_comparator && (!ir->projector || opcode == OPCODE_TXP)) {
/* Slot the shadow value in as the second to last component of the
* coord.
*/
- ir->shadow_comparitor->accept(this);
+ ir->shadow_comparator->accept(this);
/* XXX This will need to be updated for cubemap array samplers. */
if (sampler_type->sampler_dimensionality == GLSL_SAMPLER_DIM_2D &&
else
inst = emit(ir, opcode, result_dst, coord);
- if (ir->shadow_comparitor)
+ if (ir->shadow_comparator)
inst->tex_shadow = GL_TRUE;
inst->sampler = get_sampler_uniform_value(ir->sampler, shader_program,
else
instr->src[src_number].src = nir_src_for_ssa(ptn_channel(b, src[0], W));
- instr->src[src_number].src_type = nir_tex_src_comparitor;
+ instr->src[src_number].src_type = nir_tex_src_comparator;
src_number++;
}
switch (ir->op) {
case ir_tex:
- opcode = (is_cube_array && ir->shadow_comparitor) ? TGSI_OPCODE_TEX2 : TGSI_OPCODE_TEX;
+ opcode = (is_cube_array && ir->shadow_comparator) ? TGSI_OPCODE_TEX2 : TGSI_OPCODE_TEX;
if (ir->offset) {
ir->offset->accept(this);
offset[0] = this->result;
* the shadow comparator value must also be projected.
*/
st_src_reg tmp_src = coord;
- if (ir->shadow_comparitor) {
+ if (ir->shadow_comparator) {
/* Slot the shadow value in as the second to last component of the
* coord.
*/
- ir->shadow_comparitor->accept(this);
+ ir->shadow_comparator->accept(this);
tmp_src = get_temp(glsl_type::vec4_type);
st_dst_reg tmp_dst = st_dst_reg(tmp_src);
* comparator was put in the correct place (and projected) by the code,
* above, that handles by-hand projection.
*/
- if (ir->shadow_comparitor && (!ir->projector || opcode == TGSI_OPCODE_TXP)) {
+ if (ir->shadow_comparator && (!ir->projector || opcode == TGSI_OPCODE_TXP)) {
/* Slot the shadow value in as the second to last component of the
* coord.
*/
- ir->shadow_comparitor->accept(this);
+ ir->shadow_comparator->accept(this);
if (is_cube_array) {
cube_sc = get_temp(glsl_type::float_type);
} else if (opcode == TGSI_OPCODE_TEX2) {
inst = emit_asm(ir, opcode, result_dst, coord, cube_sc);
} else if (opcode == TGSI_OPCODE_TG4) {
- if (is_cube_array && ir->shadow_comparitor) {
+ if (is_cube_array && ir->shadow_comparator) {
inst = emit_asm(ir, opcode, result_dst, coord, cube_sc);
} else {
inst = emit_asm(ir, opcode, result_dst, coord, component);
} else
inst = emit_asm(ir, opcode, result_dst, coord);
- if (ir->shadow_comparitor)
+ if (ir->shadow_comparator)
inst->tex_shadow = GL_TRUE;
inst->resource.index = sampler_index;