Module: Mesa
Branch: main
Commit: 0388783a03e48b7efce984436a2b424c95761522
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0388783a03e48b7efce984436a2b424c95761522

Author: Iván Briano <[email protected]>
Date:   Wed Nov 17 11:02:26 2021 -0800

intel/nir: also allow unknown format for getting the size of a storage image

Fixes: fa251cf111df ("intel/nir: allow unknown format in lowering of storage 
images")
Reviewed-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13847>

---

 src/intel/compiler/brw_nir_lower_storage_image.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/intel/compiler/brw_nir_lower_storage_image.c 
b/src/intel/compiler/brw_nir_lower_storage_image.c
index 57f553c4ac6..b0aabb5e64a 100644
--- a/src/intel/compiler/brw_nir_lower_storage_image.c
+++ b/src/intel/compiler/brw_nir_lower_storage_image.c
@@ -646,6 +646,9 @@ lower_image_size_instr(nir_builder *b,
    if (var->data.access & ACCESS_NON_READABLE)
       return false;
 
+   if (var->data.image.format == PIPE_FORMAT_NONE)
+      return false;
+
    /* If we have a matching typed format, then we have an actual image surface
     * so we fall back and let the back-end emit a TXS for this.
     */

Reply via email to