nir: Add flag to tex instruction to indicate lowering cube to array

Graphics / Mesa 3D Graphics Library / Mesa - Gert Wollny [collabora.com] - 26 February 2021 08:51 UTC

E.g. r600 a cube texture lookup uses a specific cube instruction to evaluate the sample coordinates and the face ID, so that the cube texture lookup can be lowered to a array texture lookup, thereby sharing the code with the 2D array texture lopkup. However, for TXD the given gradients still need to be three-component
vectors, so add a flag that the NIR validation knows that we deal with cube texture that was lowered to an array and can validate accordingly.

v2: Handle new flag in serialization (Marek)
v3: Rebase so that the change does not require the patch to deduct the number of offset and grad components from sampler type

4f4e1e5ed9a nir: Add flag to tex instruction to indicate lowering cube to array
src/compiler/nir/nir.h | 6 +++++-
src/compiler/nir/nir_clone.c | 1 +
src/compiler/nir/nir_serialize.c | 5 ++++-
3 files changed, 10 insertions(+), 2 deletions(-)

Upstream: cgit.freedesktop.org


  • Share