svga: Initialize pipe_shader_state for transform shaders
authorNeha Bhende <bhenden@vmware.com>
Wed, 9 Jun 2021 18:08:28 +0000 (11:08 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 10 Jun 2021 17:28:41 +0000 (17:28 +0000)
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@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11274>

src/gallium/drivers/svga/svga_state_tgsi_transform.c

index e0b054a..b049d55 100644 (file)
@@ -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,