tu: Set up glsl types.
authorBas Nieuwenhuizen <basni@chromium.org>
Wed, 18 Sep 2019 12:11:47 +0000 (14:11 +0200)
committerBas Nieuwenhuizen <basni@chromium.org>
Wed, 18 Sep 2019 14:51:18 +0000 (16:51 +0200)
Addresses this assert:

deqp-vk: ../mesa-freedreno-9999/src/compiler/glsl_types.cpp:1244: static const glsl_type *glsl_type::get_interface_instance(const glsl_struct_field *, unsigned int, enum glsl_interface_packing, bool, const char *): Assertion `glsl_type_users > 0' failed.

running dEQP-VK.api.smoke.triangle .

Fixes: 624789e3708 "compiler/glsl: handle case where we have multiple users for types"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/freedreno/vulkan/tu_device.c

index fdb9e1e0a1e2e89bd0f70c5d667a97db5d02085e..8799f4109fb92583be7921fe590a0296797d4d26 100644 (file)
@@ -36,6 +36,7 @@
 #include <unistd.h>
 #include <xf86drm.h>
 
+#include "compiler/glsl_types.h"
 #include "util/debug.h"
 #include "util/disk_cache.h"
 #include "util/strtod.h"
@@ -431,6 +432,7 @@ tu_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
    }
 
    _mesa_locale_init();
+   glsl_type_singleton_init_or_ref();
 
    VG(VALGRIND_CREATE_MEMPOOL(instance, 0, false));
 
@@ -454,6 +456,7 @@ tu_DestroyInstance(VkInstance _instance,
 
    VG(VALGRIND_DESTROY_MEMPOOL(instance));
 
+   glsl_type_singleton_decref();
    _mesa_locale_fini();
 
    vk_debug_report_instance_destroy(&instance->debug_report_callbacks);