Mesa (staging/21.1): svga: Initialize pipe_shader_state for transform shaders

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 16 06:40:59 UTC 2021


Module: Mesa
Branch: staging/21.1
Commit: 27681b45a3387123d714406a20fed270ec5ee6c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=27681b45a3387123d714406a20fed270ec5ee6c8

Author: Neha Bhende <bhenden at vmware.com>
Date:   Wed Jun  9 11:08:28 2021 -0700

svga: Initialize pipe_shader_state for transform shaders

This fixes crashes for opengl apps. Issue is found in vmware
internal testing

Fixes: f01c0565bb9 ("draw: free the NIR IR.")

Reviewed-by: Charmaine Lee <charmainel at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11274>
(cherry picked from commit 8a3fa2c4d587e803118518d03b4944917c72245b)

---

 .pick_status.json                                    | 2 +-
 src/gallium/drivers/svga/svga_state_tgsi_transform.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 85bb9fa97c6..2ae2d1d95b9 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3667,7 +3667,7 @@
         "description": "svga: Initialize pipe_shader_state for transform shaders",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "f01c0565bb9ad7335395920aebc7489cb76d1b72"
     },
diff --git a/src/gallium/drivers/svga/svga_state_tgsi_transform.c b/src/gallium/drivers/svga/svga_state_tgsi_transform.c
index e0b054acbcf..b049d557234 100644
--- a/src/gallium/drivers/svga/svga_state_tgsi_transform.c
+++ b/src/gallium/drivers/svga/svga_state_tgsi_transform.c
@@ -148,7 +148,7 @@ write_vpos(struct svga_context *svga,
    }
 
    if (!use_existing) {
-      struct pipe_shader_state state;
+      struct pipe_shader_state state = {0};
       struct tgsi_token *new_tokens = NULL;
 
       new_tokens = tgsi_write_vpos(shader->tokens,
@@ -197,7 +197,7 @@ transform_dynamic_indexing(struct svga_context *svga,
    struct tgsi_token *new_tokens = NULL;
 
    if (!use_existing) {
-      struct pipe_shader_state state;
+      struct pipe_shader_state state = {0};
       new_tokens = tgsi_remove_dynamic_indexing(shader->tokens,
                                                 info->const_buffers_declared,
                                                 info->samplers_declared,



More information about the mesa-commit mailing list