void compute_sample_position(fs_reg dst, fs_reg int_sample_pos);
fs_reg rescale_texcoord(fs_reg coordinate, const glsl_type *coord_type,
bool is_rect, uint32_t sampler, int texunit);
- fs_inst *emit_texture_gen4(ir_texture *ir, fs_reg dst,
+ fs_inst *emit_texture_gen4(ir_texture_opcode op, fs_reg dst,
fs_reg coordinate, int coord_components,
fs_reg shadow_comp,
fs_reg lod, fs_reg lod2, int grad_components,
uint32_t sampler);
- fs_inst *emit_texture_gen5(ir_texture *ir, fs_reg dst,
+ fs_inst *emit_texture_gen5(ir_texture_opcode op, fs_reg dst,
fs_reg coordinate, int coord_components,
fs_reg shadow_comp,
fs_reg lod, fs_reg lod2, int grad_components,
fs_reg sample_index, uint32_t sampler,
bool has_offset);
- fs_inst *emit_texture_gen7(ir_texture *ir, fs_reg dst,
+ fs_inst *emit_texture_gen7(ir_texture_opcode op, fs_reg dst,
fs_reg coordinate, int coord_components,
fs_reg shadow_comp,
fs_reg lod, fs_reg lod2, int grad_components,
fs_inst *inst;
if (brw->gen >= 7) {
- inst = emit_texture_gen7(ir, dst, coordinate, coord_components, shadow_c, lod, dpdy, 0, sample_index, fs_reg(0u), fs_reg(fpi->TexSrcUnit), texel_offset);
+ inst = emit_texture_gen7(ir->op, dst, coordinate, coord_components, shadow_c, lod, dpdy, 0, sample_index, fs_reg(0u), fs_reg(fpi->TexSrcUnit), texel_offset);
} else if (brw->gen >= 5) {
- inst = emit_texture_gen5(ir, dst, coordinate, coord_components, shadow_c, lod, dpdy, 0, sample_index, fpi->TexSrcUnit, false);
+ inst = emit_texture_gen5(ir->op, dst, coordinate, coord_components, shadow_c, lod, dpdy, 0, sample_index, fpi->TexSrcUnit, false);
} else {
- inst = emit_texture_gen4(ir, dst, coordinate, coord_components, shadow_c, lod, dpdy, 0, fpi->TexSrcUnit);
+ inst = emit_texture_gen4(ir->op, dst, coordinate, coord_components, shadow_c, lod, dpdy, 0, fpi->TexSrcUnit);
}
inst->shadow_compare = fpi->TexShadow;
}
fs_inst *
-fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst,
+fs_visitor::emit_texture_gen4(ir_texture_opcode op, fs_reg dst,
fs_reg coordinate, int coord_components,
fs_reg shadow_c,
fs_reg lod, fs_reg dPdy, int grad_components,
}
mlen += 3;
- if (ir->op == ir_tex) {
+ if (op == ir_tex) {
/* There's no plain shadow compare message, so we use shadow
* compare with a bias of 0.0.
*/
emit(MOV(fs_reg(MRF, base_mrf + mlen), fs_reg(0.0f)));
mlen++;
- } else if (ir->op == ir_txb || ir->op == ir_txl) {
+ } else if (op == ir_txb || op == ir_txl) {
emit(MOV(fs_reg(MRF, base_mrf + mlen), lod));
mlen++;
} else {
emit(MOV(fs_reg(MRF, base_mrf + mlen), shadow_c));
mlen++;
- } else if (ir->op == ir_tex) {
+ } else if (op == ir_tex) {
for (int i = 0; i < coord_components; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate));
coordinate = offset(coordinate, 1);
}
/* gen4's SIMD8 sampler always has the slots for u,v,r present. */
mlen += 3;
- } else if (ir->op == ir_txd) {
+ } else if (op == ir_txd) {
fs_reg &dPdx = lod;
for (int i = 0; i < coord_components; i++) {
dPdy = offset(dPdy, 1);
}
mlen += MAX2(grad_components, 2);
- } else if (ir->op == ir_txs) {
+ } else if (op == ir_txs) {
/* There's no SIMD8 resinfo message on Gen4. Use SIMD16 instead. */
simd16 = true;
emit(MOV(fs_reg(MRF, base_mrf + mlen, BRW_REGISTER_TYPE_UD), lod));
* instructions. We'll need to do SIMD16 here.
*/
simd16 = true;
- assert(ir->op == ir_txb || ir->op == ir_txl || ir->op == ir_txf);
+ assert(op == ir_txb || op == ir_txl || op == ir_txf);
for (int i = 0; i < coord_components; i++) {
emit(MOV(fs_reg(MRF, base_mrf + mlen + i * 2, coordinate.type),
}
enum opcode opcode;
-
- switch (ir->op) {
+ switch (op) {
case ir_tex: opcode = SHADER_OPCODE_TEX; break;
case ir_txb: opcode = FS_OPCODE_TXB; break;
case ir_txl: opcode = SHADER_OPCODE_TXL; break;
* surprising in the disassembly.
*/
fs_inst *
-fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst,
+fs_visitor::emit_texture_gen5(ir_texture_opcode op, fs_reg dst,
fs_reg coordinate, int vector_elements,
fs_reg shadow_c,
fs_reg lod, fs_reg lod2, int grad_components,
}
enum opcode opcode;
- switch (ir->op) {
+ switch (op) {
case ir_tex:
opcode = SHADER_OPCODE_TEX;
break;
}
fs_inst *
-fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst,
+fs_visitor::emit_texture_gen7(ir_texture_opcode op, fs_reg dst,
fs_reg coordinate, int coord_components,
fs_reg shadow_c,
fs_reg lod, fs_reg lod2, int grad_components,
}
int length = 0;
- if (ir->op == ir_tg4 || offset_value.file != BAD_FILE ||
+ if (op == ir_tg4 || offset_value.file != BAD_FILE ||
is_high_sampler(brw, sampler)) {
/* For general texture offsets (no txf workaround), we need a header to
* put them in. Note that for SIMD16 we're making space for two actual
bool coordinate_done = false;
/* Set up the LOD info */
- switch (ir->op) {
+ switch (op) {
case ir_tex:
case ir_lod:
break;
/* Generate the SEND */
enum opcode opcode;
- switch (ir->op) {
+ switch (op) {
case ir_tex: opcode = SHADER_OPCODE_TEX; break;
case ir_txb: opcode = FS_OPCODE_TXB; break;
case ir_txl: opcode = SHADER_OPCODE_TXL; break;
fs_reg dst = fs_reg(this, glsl_type::get_instance(ir->type->base_type, 4, 1));
if (brw->gen >= 7) {
- inst = emit_texture_gen7(ir, dst, coordinate, coord_components,
+ inst = emit_texture_gen7(ir->op, dst, coordinate, coord_components,
shadow_comparitor,
lod, lod2, grad_components,
sample_index, mcs, sampler_reg,
offset_value);
} else if (brw->gen >= 5) {
- inst = emit_texture_gen5(ir, dst, coordinate, coord_components,
+ inst = emit_texture_gen5(ir->op, dst, coordinate, coord_components,
shadow_comparitor,
lod, lod2, grad_components,
sample_index, sampler,
ir->offset != NULL);
} else {
- inst = emit_texture_gen4(ir, dst, coordinate, coord_components,
+ inst = emit_texture_gen4(ir->op, dst, coordinate, coord_components,
shadow_comparitor,
lod, lod2, grad_components,
sampler);