if (r)
return r;
}
+
+ /* for cube forms of lod and bias we need to route the lod
+ value into Z */
+ if (inst->Instruction.Opcode == TGSI_OPCODE_TXB ||
+ inst->Instruction.Opcode == TGSI_OPCODE_TXL) {
+ memset(&alu, 0, sizeof(struct r600_bytecode_alu));
+ alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
+ r600_bytecode_src(&alu.src[0], &ctx->src[0], 3);
+ alu.dst.sel = ctx->temp_reg;
+ alu.dst.chan = 2;
+ alu.last = 1;
+ alu.dst.write = 1;
+ r = r600_bytecode_add_alu(ctx->bc, &alu);
+ if (r)
+ return r;
+ }
+
src_loaded = TRUE;
src_gpr = ctx->temp_reg;
}
tex.src_rel = ctx->src[0].rel;
}
- if (inst->Texture.Texture == TGSI_TEXTURE_CUBE) {
- tex.src_sel_x = 1;
- tex.src_sel_y = 0;
- tex.src_sel_z = 3;
- tex.src_sel_w = 1;
- }
- if (inst->Texture.Texture == TGSI_TEXTURE_SHADOWCUBE) {
+ if (inst->Texture.Texture == TGSI_TEXTURE_CUBE ||
+ inst->Texture.Texture == TGSI_TEXTURE_SHADOWCUBE) {
tex.src_sel_x = 1;
tex.src_sel_y = 0;
tex.src_sel_z = 3;
- tex.src_sel_w = 2; /* route Z compare value into W */
+ tex.src_sel_w = 2; /* route Z compare or Lod value into W */
}
if (inst->Texture.Texture != TGSI_TEXTURE_RECT &&