zink: clear null image surfaces to 0
authorSoroushIMG <soroush.kashani@imgtec.com>
Sun, 5 Feb 2023 14:18:16 +0000 (14:18 +0000)
committerEric Engestrom <eric@engestrom.ch>
Wed, 8 Feb 2023 20:34:45 +0000 (20:34 +0000)
commitdf96e9c0a078a9d9603d37dc675733fefd88ca36
tree88c4c4a23afd39a6df1d9cf22d95e551351e42cb
parent4f58fe67d23f225da9915d9595ad4bf11743ff19
zink: clear null image surfaces to 0

GL Spec says that imageLoad from incomplete images must return 0.
This is not really spec compliant as for proper behavior nullDescriptor
and robustImageAccess2 is needed.
A workaround for lack of either of these requires a shader variant.
Clearing the null surface and hoping the app doesn't write to the image
is closer to spec, while avoiding a shader recompile.

KHR-GL46.shader_image_load_store.incomplete_textures tests this.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21135>
(cherry picked from commit 22e91af1a77361249b9c71ee609b67ec187e612c)
.pick_status.json
src/gallium/drivers/zink/zink_context.c