Module: Mesa
Branch: master
Commit: 54cb05b46c5fee48277ca2545417a2f6657642d5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=54cb05b46c5fee48277ca2545417a2f6657642d5

Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Sep 15 14:57:45 2020 -0400

zink: always set VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT for non-staging 
resources

this is weird but sometimes gallium makes resources with bind==0, which will
crash later if we don't add this

Acked-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9066>

---

 src/gallium/drivers/zink/zink_resource.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_resource.c 
b/src/gallium/drivers/zink/zink_resource.c
index 96d219d5429..6d665a68c7d 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -122,6 +122,9 @@ resource_create(struct pipe_screen *pscreen,
                   VK_BUFFER_USAGE_TRANSFER_DST_BIT |
                   VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
 
+      if (templ->usage != PIPE_USAGE_STAGING)
+         bci.usage |= VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT;
+
       /* apparently gallium thinks these are the jack-of-all-trades bind types 
*/
       if (templ->bind & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_QUERY_BUFFER)) {
          bci.usage |= VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT |

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to