# -*- coding: UTF-8 -*-

__initialized = False

try:
    from vulkan import *
    from vulkan import __version__
    import vulkan._vulkan as _vulkan
    __initialized = True

except OSError:
    # patch constants from vulkan package which are needed for the modules to be importable
    VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1
    VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2
    VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3
    VK_PHYSICAL_DEVICE_TYPE_CPU = 4

    VK_QUEUE_GRAPHICS_BIT = 0x00000001
    VK_QUEUE_COMPUTE_BIT = 0x00000002
    VK_QUEUE_TRANSFER_BIT = 0x00000004
    VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008

    VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001
    VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002
    VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004
    VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008
    VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010

    VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001
    VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002
    VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010
    VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020

    VK_DESCRIPTOR_TYPE_SAMPLER = 0
    VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6
    VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7

    VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001
    VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004


def initialized():
    return __initialized
