gallium,st/mesa: Add and set pipe_image_view::is_2d_view_of_3d

This will be useful for lavapipe since the Z-coordinate has to be
ignored for 2D view accesses.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31038>
(cherry picked from commit aa072b137b)
This commit is contained in:
Konstantin Seurer 2024-09-05 16:42:30 +02:00 committed by Eric Engestrom
parent dc465140c6
commit 97570a038d
3 changed files with 3 additions and 1 deletions

View file

@ -3244,7 +3244,7 @@
"description": "gallium,st/mesa: Add and set pipe_image_view::is_2d_view_of_3d",
"nominated": false,
"nomination_type": 3,
"resolution": 4,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -533,6 +533,7 @@ struct pipe_image_view
unsigned last_layer:16; /**< last layer to use for array textures */
unsigned level:8; /**< mipmap level to use */
bool single_layer_view; /**< single layer view of array */
bool is_2d_view_of_3d;
} tex;
struct {
unsigned offset; /**< offset in bytes */

View file

@ -114,6 +114,7 @@ st_convert_image(const struct st_context *st, const struct gl_image_unit *u,
} else {
img->u.tex.first_layer = u->_Layer;
img->u.tex.last_layer = u->_Layer;
img->u.tex.is_2d_view_of_3d = true;
}
} else {
img->u.tex.first_layer = u->_Layer + stObj->Attrib.MinLayer;