ac/nir: handle non-const offset with txf/txf_ms
It might be a vec2. If it's a constant, LLVM will fold it. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7077>
This commit is contained in:
parent
e690a1b78b
commit
9aa89b36fc
|
@ -4271,10 +4271,8 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
|
|||
int num_offsets = instr->src[offset_src].src.ssa->num_components;
|
||||
num_offsets = MIN2(num_offsets, instr->coord_components);
|
||||
for (unsigned i = 0; i < num_offsets; ++i) {
|
||||
args.coords[i] = LLVMBuildAdd(
|
||||
ctx->ac.builder, args.coords[i],
|
||||
LLVMConstInt(ctx->ac.i32, nir_src_comp_as_uint(instr->src[offset_src].src, i), false),
|
||||
"");
|
||||
LLVMValueRef off = ac_llvm_extract_elem(&ctx->ac, args.offset, i);
|
||||
args.coords[i] = LLVMBuildAdd(ctx->ac.builder, args.coords[i], off, "");
|
||||
}
|
||||
args.offset = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue