nvk: drop explicit u_gralloc init
u_gralloc will be initialized upon the initial vk_android_get_ugralloc. Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Acked-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35561>
This commit is contained in:
@@ -15,11 +15,6 @@
|
||||
#include "util/mesa-sha1.h"
|
||||
#include "util/u_debug.h"
|
||||
|
||||
#if DETECT_OS_ANDROID
|
||||
#include "util/u_gralloc/u_gralloc.h"
|
||||
#include "vk_android.h"
|
||||
#endif
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
nvk_EnumerateInstanceVersion(uint32_t *pApiVersion)
|
||||
{
|
||||
@@ -187,16 +182,6 @@ nvk_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
|
||||
STATIC_ASSERT(sizeof(instance->driver_build_sha) == SHA1_DIGEST_LENGTH);
|
||||
memcpy(instance->driver_build_sha, build_id_data(note), SHA1_DIGEST_LENGTH);
|
||||
|
||||
#if DETECT_OS_ANDROID
|
||||
struct u_gralloc *u_gralloc = vk_android_init_ugralloc();
|
||||
|
||||
if (u_gralloc && u_gralloc_get_type(u_gralloc) == U_GRALLOC_TYPE_FALLBACK) {
|
||||
mesa_logw(
|
||||
"nvk: Gralloc is not supported. Android extensions are disabled.");
|
||||
vk_android_destroy_ugralloc();
|
||||
}
|
||||
#endif
|
||||
|
||||
*pInstance = nvk_instance_to_handle(instance);
|
||||
return VK_SUCCESS;
|
||||
|
||||
@@ -217,10 +202,6 @@ nvk_DestroyInstance(VkInstance _instance,
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
#if DETECT_OS_ANDROID
|
||||
vk_android_destroy_ugralloc();
|
||||
#endif
|
||||
|
||||
driDestroyOptionCache(&instance->dri_options);
|
||||
driDestroyOptionInfo(&instance->available_dri_options);
|
||||
|
||||
|
||||
@@ -269,7 +269,8 @@ nvk_get_device_extensions(const struct nvk_instance *instance,
|
||||
.EXT_ycbcr_image_arrays = true,
|
||||
.EXT_zero_initialize_device_memory = true,
|
||||
#if DETECT_OS_ANDROID
|
||||
.ANDROID_native_buffer = vk_android_get_ugralloc() != NULL,
|
||||
.ANDROID_native_buffer = vk_android_get_ugralloc() &&
|
||||
u_gralloc_get_type(vk_android_get_ugralloc()) != U_GRALLOC_TYPE_FALLBACK,
|
||||
#endif
|
||||
.GOOGLE_decorate_string = true,
|
||||
.GOOGLE_hlsl_functionality1 = true,
|
||||
|
||||
Reference in New Issue
Block a user