From aa072b137bd8cda592fe9035bfc24591bede4ace Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Thu, 5 Sep 2024 16:42:30 +0200 Subject: [PATCH] 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 Reviewed-by: Dave Airlie Part-of: --- src/gallium/include/pipe/p_state.h | 1 + src/mesa/state_tracker/st_atom_image.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 2b0fcb09043..a86025678c2 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -534,6 +534,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 */ diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c index 70a42e9dcff..c46cc0ff0f9 100644 --- a/src/mesa/state_tracker/st_atom_image.c +++ b/src/mesa/state_tracker/st_atom_image.c @@ -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;