case nir_texop_tex:
case nir_texop_txb:
return TEXTURE_OP_NORMAL;
+ case nir_texop_txl:
+ return TEXTURE_OP_LOD;
default:
unreachable("Unhanlded texture op");
}
break;
}
- case nir_tex_src_bias: {
+ case nir_tex_src_bias:
+ case nir_tex_src_lod: {
/* To keep RA simple, we put the bias/LOD into the w
* component of the input source, which is otherwise in xy */
/* Always 1 */
.unknown7 = 1,
-
- /* Assume we can continue; hint it out later */
- .cont = 1,
}
};
/* Setup bias/LOD if necessary. Only register mode support right now.
* TODO: Immediate mode for performance gains */
- if (instr->op == nir_texop_txb) {
+ if (instr->op == nir_texop_txb || instr->op == nir_texop_txl) {
ins.texture.lod_register = true;
midgard_tex_register_select sel = {
ctx->texture_op_count--;
- if (!ctx->texture_op_count) {
- ins->texture.cont = 0;
- ins->texture.last = 1;
+ if (ins->texture.op == TEXTURE_OP_NORMAL) {
+ bool continues = ctx->texture_op_count > 0;
+ ins->texture.cont = continues;
+ ins->texture.last = !continues;
+ } else {
+ ins->texture.cont = ins->texture.last = 1;
}
util_dynarray_append(emission, midgard_texture_word, ins->texture);