nir: Add new texop nir_texop_tex_prefetch
authorEduardo Lima Mitev <elima@igalia.com>
Wed, 10 Jul 2019 07:48:21 +0000 (09:48 +0200)
committerRob Clark <robdclark@gmail.com>
Fri, 18 Oct 2019 21:11:54 +0000 (21:11 +0000)
commitf1d4fadf1bdc399be515fc21bea3c2832e802f3e
tree3c33c78257bbf3a55a873a7765816b05f19af666
parent27df3e015bd1c0f74461b05a9f5b8c1a3fdf6ee5
nir: Add new texop nir_texop_tex_prefetch

This is like nir_texop_tex, but signals that the sampling coordinates
are immutable during the shader stage, in a way that allows the HW
that supports pre-dispatching sampling operations to pre-fetch
the result prior to scheduling the shader stage.

This is introduced to support the feature in Freedreno. Adreno HW
from a4xx supports it.

A NIR pass introduced later in this series will detect sampling
operations that are eligible for pre-dispatch, and replace
nir_texop_tex by this new op, to tell the backend to enable
pre-fetch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
src/compiler/nir/nir.h
src/compiler/nir/nir_print.c
src/compiler/spirv/spirv_to_nir.c