static void initThreading(layer_data *my_data, const VkAllocationCallbacks *pAllocator) {

    layer_debug_actions(my_data->report_data, my_data->logging_callback, pAllocator, "google_threading");

    if (!threadingLockInitialized) {
        loader_platform_thread_create_mutex(&threadingLock);
        loader_platform_thread_init_cond(&threadingCond);
        threadingLockInitialized = 1;
    }
}
Exemple #2
0
static void init_overlay(layer_data *my_data) {
    if (!globalLockInitialized) {
        // TODO/TBD: Need to delete this mutex sometime.  How???  One
        // suggestion is to call this during vkCreateInstance(), and then we
        // can clean it up during vkDestroyInstance().  However, that requires
        // that the layer have per-instance locks.  We need to come back and
        // address this soon.
        loader_platform_thread_create_mutex(&globalLock);
        globalLockInitialized = 1;
    }
}
static void init_device_limits(layer_data *my_data, const VkAllocationCallbacks *pAllocator) {

    layer_debug_actions(my_data->report_data, my_data->logging_callback, pAllocator, "lunarg_device_limits");

    if (!globalLockInitialized) {
        // TODO/TBD: Need to delete this mutex sometime.  How???  One
        // suggestion is to call this during vkCreateInstance(), and then we
        // can clean it up during vkDestroyInstance().  However, that requires
        // that the layer have per-instance locks.  We need to come back and
        // address this soon.
        loader_platform_thread_create_mutex(&globalLock);
        globalLockInitialized = 1;
    }
}
static void initThreading(layer_data *my_data, const VkAllocationCallbacks *pAllocator)
{

    uint32_t report_flags = 0;
    uint32_t debug_action = 0;
    FILE *log_output = NULL;
    const char *strOpt;
    VkDebugReportCallbackEXT callback;
    // initialize Threading options
    report_flags = getLayerOptionFlags("ThreadingReportFlags", 0);
    getLayerOptionEnum("ThreadingDebugAction", (uint32_t *) &debug_action);

    if (debug_action & VK_DBG_LAYER_ACTION_LOG_MSG)
    {
        strOpt = getLayerOption("ThreadingLogFilename");
        log_output = getLayerLogOutput(strOpt, "Threading");
        VkDebugReportCallbackCreateInfoEXT dbgCreateInfo;
        memset(&dbgCreateInfo, 0, sizeof(dbgCreateInfo));
        dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
        dbgCreateInfo.flags = report_flags;
        dbgCreateInfo.pfnCallback = log_callback;
        dbgCreateInfo.pUserData = (void *) log_output;
        layer_create_msg_callback(my_data->report_data, &dbgCreateInfo, pAllocator, &callback);
        my_data->logging_callback.push_back(callback);
    }

    if (debug_action & VK_DBG_LAYER_ACTION_DEBUG_OUTPUT) {
        VkDebugReportCallbackCreateInfoEXT dbgCreateInfo;
        memset(&dbgCreateInfo, 0, sizeof(dbgCreateInfo));
        dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
        dbgCreateInfo.flags = report_flags;
        dbgCreateInfo.pfnCallback = win32_debug_output_msg;
        dbgCreateInfo.pUserData = NULL;
        layer_create_msg_callback(my_data->report_data, &dbgCreateInfo, pAllocator, &callback);
        my_data->logging_callback.push_back(callback);
    }

    if (!threadingLockInitialized)
    {
        loader_platform_thread_create_mutex(&threadingLock);
        loader_platform_thread_init_cond(&threadingCond);
        threadingLockInitialized = 1;
    }
}