Mesa (19.0): Revert "anv/radv: release memory allocated by glsl types during spirv_to_nir"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 11 03:34:48 UTC 2019


Module: Mesa
Branch: 19.0
Commit: dc6f00d53ef3523db955d58ad3a8f0be3164b334
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dc6f00d53ef3523db955d58ad3a8f0be3164b334

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Wed Mar 27 11:16:15 2019 -0500

Revert "anv/radv: release memory allocated by glsl types during spirv_to_nir"

This reverts commit 4e1bbb000cdfe4ba01bee5a6868c54fed7285dae.  It turns
out that some DXVK apps due to some implementation detail of DXVK or
other create and destroy instances in an interleaved way.  Freeing the
glsl_type memory without being a bit more careful causes use-after-free
issues.  Looks like we need to try again.

(cherry picked from commit ce47999ceed7efe010a1b6cc592780514803670a)

---

 src/amd/vulkan/radv_device.c  | 2 --
 src/intel/vulkan/anv_device.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 824a06559ec..f0c8db08273 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -48,7 +48,6 @@
 #include "util/build_id.h"
 #include "util/debug.h"
 #include "util/mesa-sha1.h"
-#include "compiler/glsl_types.h"
 
 static int
 radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
@@ -611,7 +610,6 @@ void radv_DestroyInstance(
 
 	VG(VALGRIND_DESTROY_MEMPOOL(instance));
 
-	_mesa_glsl_release_types();
 	_mesa_locale_fini();
 
 	vk_debug_report_instance_destroy(&instance->debug_report_callbacks);
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index f35d10f56e0..f0583d22774 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -41,7 +41,6 @@
 #include "git_sha1.h"
 #include "vk_util.h"
 #include "common/gen_defines.h"
-#include "compiler/glsl_types.h"
 
 #include "genxml/gen7_pack.h"
 
@@ -704,7 +703,6 @@ void anv_DestroyInstance(
 
    vk_debug_report_instance_destroy(&instance->debug_report_callbacks);
 
-   _mesa_glsl_release_types();
    _mesa_locale_fini();
 
    vk_free(&instance->alloc, instance);




More information about the mesa-commit mailing list