nvc0: fix 3d images
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 16 May 2021 03:18:52 +0000 (23:18 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sun, 6 Jun 2021 18:26:26 +0000 (18:26 +0000)
commitc7e877b0bfd704935762d025c942f260184b1520
treed0365eb44f38a17520cd87de009d1cbcf2246b76
parent729020c7e096ddb17b262797153d56fa4bade990
nvc0: fix 3d images

The hardware has no support for 3d image loads/stores. So present the
image as a larger 2d image and fudge the coordinates. Note that a 2d
image (in the shader) may be backed by a slice of a 3d image, so we
always have to do the coordinate adjustments for 2d as well.

This is largely copied from the nv50 support, which has the same
restriction, with extra care taken to differentiate loads (which
specifies the X coordinate in bytes) and stores, which specifies it in
(formatted) pixels.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10820>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
src/gallium/drivers/nouveau/nvc0/nvc0_tex.c