gallivm: add lp_build_emit_fetch_src() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 30 Mar 2017 17:57:43 +0000 (19:57 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 1 Apr 2017 16:07:49 +0000 (18:07 +0200)
commit8a3ef8c65d9125012d32522eef58e5fc5c0b086a
treeabf8a4da54c68e486fa84ab7f9d59c3422c07640
parent8b10bf273d087fd648a4d622174b4b81c7e4a7bb
gallivm: add lp_build_emit_fetch_src() helper

lp_build_emit_fetch() is useful when the source type can be
infered from the instruction opcode.

However, for bindless samplers/images we can't do that easily
because tgsi_opcode_infer_src_type() returns TGSI_TYPE_FLOAT for
TEX instructions, while we need TGSI_TYPE_UNSIGNED64 if the
resource register is bindless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h