Why is it when creating an instance with Vulkan on Mac it calls an assert error and if it is put in a try catch statement it calls vkWaitForfFences

I am trying to create an instance for a basic Vulkan renderer. When creating an instance on Mac I am using the same code that I used in visual studio on windows. I am using Xcode on Mac with C++. Immediately after creating an instance when creating a debug messenger an assert is called in Vulkan.h called VULKAN_HPP_ASSERT. When putting create instance in a try catch statement with a throw runtime error then I get an error that says it is from improper use of vkWaitForFences. This code works on windows with no errors. I have no idea as to what is causing the error.

I have tried checking the version and I have set up a bunch of debug statements to make sure all the layers and extensions are supported. They are all successful and supported.

debug print statements:
System can Support vulkan variant: 0,
Major: 1,
Minor: 3,
Patch: 280
Supperted Extensions:
VK_KHR_device_group_creation
VK_KHR_external_fence_capabilities
VK_KHR_external_memory_capabilities
VK_KHR_external_semaphore_capabilities
VK_KHR_get_physical_device_properties2
VK_KHR_get_surface_capabilities2
VK_KHR_surface
VK_EXT_debug_report
VK_EXT_debug_utils
VK_EXT_headless_surface
VK_EXT_layer_settings
VK_EXT_metal_surface
VK_EXT_surface_maintenance1
VK_EXT_swapchain_colorspace
VK_MVK_macos_surface
VK_KHR_portability_enumeration
VK_LUNARG_direct_driver_loading
Required Extensions:
“VK_KHR_surface
“VK_EXT_metal_surface
“VK_EXT_debug_utils
VK_KHR_surface is a supported extension
VK_EXT_metal_surface is a supported extension
VK_EXT_debug_utils is a supported extension

Requested Layers:
VK_LAYER_KHRONOS_validation
Supperted Layers:
VK_LAYER_LUNARG_api_dump
VK_LAYER_KHRONOS_profiles
VK_LAYER_KHRONOS_validation
VK_LAYER_LUNARG_screenshot
VK_LAYER_KHRONOS_synchronization2
VK_LAYER_KHRONOS_shader_object
VK_LAYER_KHRONOS_validation is a supported layer

code:
void Engine::createInstance(const char* appName)
{
if (m_Debug)
{
std::cout << “Instance being created…” << std::endl;
}

    //unsigned int version{ 0 };
    unsigned int version{ 0 };
    if (vk::enumerateInstanceVersion(&version) == vk::Result::eSuccess)
    {
        if (m_Debug)
        {
            std::cout << "System can Support vulkan variant: " <<
            VK_API_VERSION_VARIANT(version)
            << ",nMajor: " << VK_API_VERSION_MAJOR(version)
            << ",nMinor: " << VK_API_VERSION_MINOR(version)
            << ",nPatch: " << VK_API_VERSION_PATCH(version) << "n";
        }
    }
    else
    {
        std::cout << "Failed to check Instance version";
    }

    version &= ~(0xFFFU);
    version = VK_MAKE_API_VERSION(0, 1, 0, 0);

    vk::ApplicationInfo appInfo = vk::ApplicationInfo(
        appName,
        version,
        appName,
        version,
        version
    );

    // Extensions

    unsigned int glfwExtensionCount = 0;
    const char** glfwExtensions;
    glfwExtensions = glfwGetRequiredInstanceExtensions(&glfwExtensionCount);

    std::vector<const char*> extensions(glfwExtensions, glfwExtensions +     
        glfwExtensionCount);

    if (m_Debug)
    {
    extensions.push_back("VK_EXT_debug_utils");
    }

    //Validation Layers

    std::vector<const char*> layers;

    if (m_Debug)
    {
        layers.push_back("VK_LAYER_KHRONOS_validation");
    }

    if (!supportedAdditions(nullptr, extensions, layers))
    {
        throw std::runtime_error("Extensions or Layers are not supported.nYou should check 
            to see if you are using the right extensions or layers");
    }

    vk::InstanceCreateInfo createInfo = vk::InstanceCreateInfo(
        vk::InstanceCreateFlags(),
        &appInfo,
        static_cast<unsigned int>(layers.size()), layers.data(),
        static_cast<unsigned int>(extensions.size()), extensions.data()
    );

    try 
    {
        m_Instance = vk::createInstance(createInfo);
        if (m_Debug)
        {
            std::cout << "Successfully created instance" << std::endl;
        }
    }
    catch (const vk::SystemError& err) 
    {
        //throw std::runtime_error("Failed to create Vulkan instance: " +     
            std::string(err.what())); //vkWaitForFences error on this line
    }
}

void Engine::createDebugMessenger()
{
    std::cout << "nCreating debug messenger..." << std::endl;

    m_Dldi = vk::DispatchLoaderDynamic(m_Instance, vkGetInstanceProcAddr);//ASSERT on this 
        line
    ... rest of create debug messenger function

New contributor

Eriond is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật