Revert "anv/radv: release memory allocated by glsl types during spirv_to_nir"
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 27 Mar 2019 16:16:15 +0000 (11:16 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 27 Mar 2019 16:24:58 +0000 (11:24 -0500)
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.

src/amd/vulkan/radv_device.c
src/intel/vulkan/anv_device.c

index bac5855bb964e0e224aac1d731f5895012e5f90e..d26557fd449e9688bde2bf8eeb6c5b8fcfcf2db7 100644 (file)
@@ -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);
index e035cd18e253d67defb9d1eae192a7826e7cbf50..b0a6e10cabcdd07855e8563615e5122c0fa69318 100644 (file)
@@ -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"
 
@@ -737,7 +736,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);