glsl/nir: convert ir_texture->clamp to nir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14488>
This commit is contained in:
Qiang Yu
2022-01-06 17:31:01 +08:00
committed by Marge Bot
parent 10a71c6106
commit 95d3617909

View File

@@ -2473,6 +2473,8 @@ nir_visitor::visit(ir_texture *ir)
/* offsets are constants we store inside nir_tex_intrs.offsets */
if (ir->offset != NULL && !ir->offset->type->is_array())
num_srcs++;
if (ir->clamp != NULL)
num_srcs++;
/* Add one for the texture deref */
num_srcs += 2;
@@ -2556,6 +2558,13 @@ nir_visitor::visit(ir_texture *ir)
}
}
if (ir->clamp) {
instr->src[src_number].src =
nir_src_for_ssa(evaluate_rvalue(ir->clamp));
instr->src[src_number].src_type = nir_tex_src_min_lod;
src_number++;
}
switch (ir->op) {
case ir_txb:
instr->src[src_number].src =