2016-02-18 01:42:25 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright (c) 2015-2016 The Khronos Group Inc.
|
|
|
|
* Copyright (c) 2015-2016 Valve Corporation
|
|
|
|
* Copyright (c) 2015-2016 LunarG, Inc.
|
|
|
|
* Copyright (C) 2015 Google Inc.
|
|
|
|
*
|
2016-06-18 00:32:21 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2016-02-18 01:42:25 +00:00
|
|
|
*
|
2016-06-18 00:32:21 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2016-02-18 01:42:25 +00:00
|
|
|
*
|
2016-06-18 00:32:21 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2016-02-18 01:42:25 +00:00
|
|
|
*
|
|
|
|
* Author: Courtney Goeltzenleuchter <courtney@lunarg.com>
|
|
|
|
* Author: Jon Ashburn <jon@lunarg.com>
|
|
|
|
* Author: Tony Barbour <tony@LunarG.com>
|
|
|
|
* Author: Chia-I Wu <olv@lunarg.com>
|
|
|
|
*/
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "vk_loader_platform.h"
|
|
|
|
#include "loader.h"
|
|
|
|
#include "debug_report.h"
|
|
|
|
#include "wsi.h"
|
2017-05-12 01:09:31 +00:00
|
|
|
#include "vk_loader_extensions.h"
|
2016-06-18 00:32:21 +00:00
|
|
|
#include "gpa_helper.h"
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Trampoline entrypoints are in this file for core Vulkan commands
|
|
|
|
|
|
|
|
// Get an instance level or global level entry point address.
|
|
|
|
// @param instance
|
|
|
|
// @param pName
|
|
|
|
// @return
|
|
|
|
// If instance == NULL returns a global level functions only
|
|
|
|
// If instance is valid returns a trampoline entry point for all dispatchable Vulkan
|
|
|
|
// functions both core and extensions.
|
|
|
|
LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName) {
|
2016-06-18 00:32:21 +00:00
|
|
|
void *addr;
|
|
|
|
|
|
|
|
addr = globalGetProcAddr(pName);
|
|
|
|
if (instance == VK_NULL_HANDLE) {
|
2017-05-12 01:09:31 +00:00
|
|
|
// Get entrypoint addresses that are global (no dispatchable object)
|
2016-06-18 00:32:21 +00:00
|
|
|
|
|
|
|
return addr;
|
|
|
|
} else {
|
2017-05-12 01:09:31 +00:00
|
|
|
// If a global entrypoint return NULL
|
|
|
|
if (addr) return NULL;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct loader_instance *ptr_instance = loader_get_instance(instance);
|
2017-05-12 01:09:31 +00:00
|
|
|
if (ptr_instance == NULL) return NULL;
|
|
|
|
// Return trampoline code for non-global entrypoints including any extensions.
|
2016-06-18 00:32:21 +00:00
|
|
|
// Device extensions are returned if a layer or ICD supports the extension.
|
|
|
|
// Instance extensions are returned if the extension is enabled and the
|
2017-01-27 05:57:54 +00:00
|
|
|
// loader or someone else supports the extension
|
2016-06-18 00:32:21 +00:00
|
|
|
return trampolineGetProcAddr(ptr_instance, pName);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Get a device level or global level entry point address.
|
|
|
|
// @param device
|
|
|
|
// @param pName
|
|
|
|
// @return
|
|
|
|
// If device is valid, returns a device relative entry point for device level
|
|
|
|
// entry points both core and extensions.
|
|
|
|
// Device relative means call down the device chain.
|
|
|
|
LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *pName) {
|
2016-06-18 00:32:21 +00:00
|
|
|
void *addr;
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// For entrypoints that loader must handle (ie non-dispatchable or create object)
|
|
|
|
// make sure the loader entrypoint is returned
|
2016-06-18 00:32:21 +00:00
|
|
|
addr = loader_non_passthrough_gdpa(pName);
|
|
|
|
if (addr) {
|
|
|
|
return addr;
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Although CreateDevice is on device chain it's dispatchable object isn't
|
|
|
|
// a VkDevice or child of VkDevice so return NULL.
|
|
|
|
if (!strcmp(pName, "CreateDevice")) return NULL;
|
2016-06-18 00:32:21 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Return the dispatch table entrypoint for the fastest case
|
2016-06-18 00:32:21 +00:00
|
|
|
const VkLayerDispatchTable *disp_table = *(VkLayerDispatchTable **)device;
|
2017-05-12 01:09:31 +00:00
|
|
|
if (disp_table == NULL) return NULL;
|
2016-06-18 00:32:21 +00:00
|
|
|
|
|
|
|
addr = loader_lookup_device_dispatch_table(disp_table, pName);
|
2017-05-12 01:09:31 +00:00
|
|
|
if (addr) return addr;
|
2016-06-18 00:32:21 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
if (disp_table->GetDeviceProcAddr == NULL) return NULL;
|
2016-06-18 00:32:21 +00:00
|
|
|
return disp_table->GetDeviceProcAddr(device, pName);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName,
|
|
|
|
uint32_t *pPropertyCount,
|
|
|
|
VkExtensionProperties *pProperties) {
|
2016-06-18 00:32:21 +00:00
|
|
|
struct loader_extension_list *global_ext_list = NULL;
|
|
|
|
struct loader_layer_list instance_layers;
|
|
|
|
struct loader_extension_list local_ext_list;
|
2016-11-23 03:29:18 +00:00
|
|
|
struct loader_icd_tramp_list icd_tramp_list;
|
2016-06-18 00:32:21 +00:00
|
|
|
uint32_t copy_size;
|
2016-11-23 03:29:18 +00:00
|
|
|
VkResult res = VK_SUCCESS;
|
2016-06-18 00:32:21 +00:00
|
|
|
|
|
|
|
tls_instance = NULL;
|
|
|
|
memset(&local_ext_list, 0, sizeof(local_ext_list));
|
|
|
|
memset(&instance_layers, 0, sizeof(instance_layers));
|
|
|
|
loader_platform_thread_once(&once_init, loader_initialize);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Get layer libraries if needed
|
2016-06-18 00:32:21 +00:00
|
|
|
if (pLayerName && strlen(pLayerName) != 0) {
|
2017-05-12 01:09:31 +00:00
|
|
|
if (vk_string_validate(MaxLoaderStringLength, pLayerName) != VK_STRING_ERROR_NONE) {
|
|
|
|
assert(VK_FALSE &&
|
|
|
|
"vkEnumerateInstanceExtensionProperties: "
|
|
|
|
"pLayerName is too long or is badly formed");
|
2016-11-23 03:29:18 +00:00
|
|
|
res = VK_ERROR_EXTENSION_NOT_PRESENT;
|
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
loader_layer_scan(NULL, &instance_layers);
|
|
|
|
if (strcmp(pLayerName, std_validation_str) == 0) {
|
|
|
|
struct loader_layer_list local_list;
|
|
|
|
memset(&local_list, 0, sizeof(local_list));
|
2017-05-12 01:09:31 +00:00
|
|
|
for (uint32_t i = 0; i < sizeof(std_validation_names) / sizeof(std_validation_names[0]); i++) {
|
|
|
|
loader_find_layer_name_add_list(NULL, std_validation_names[i], VK_LAYER_TYPE_INSTANCE_EXPLICIT, &instance_layers,
|
|
|
|
&local_list);
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
for (uint32_t i = 0; i < local_list.count; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
struct loader_extension_list *ext_list = &local_list.list[i].instance_extension_list;
|
|
|
|
loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, ext_list->list);
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
2016-11-23 03:29:18 +00:00
|
|
|
loader_destroy_layer_list(NULL, NULL, &local_list);
|
2016-06-18 00:32:21 +00:00
|
|
|
global_ext_list = &local_ext_list;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
for (uint32_t i = 0; i < instance_layers.count; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
struct loader_layer_properties *props = &instance_layers.list[i];
|
2016-06-18 00:32:21 +00:00
|
|
|
if (strcmp(props->info.layerName, pLayerName) == 0) {
|
|
|
|
global_ext_list = &props->instance_extension_list;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2017-05-12 01:09:31 +00:00
|
|
|
// Scan/discover all ICD libraries
|
2016-11-23 03:29:18 +00:00
|
|
|
memset(&icd_tramp_list, 0, sizeof(struct loader_icd_tramp_list));
|
|
|
|
res = loader_icd_scan(NULL, &icd_tramp_list);
|
|
|
|
if (VK_SUCCESS != res) {
|
|
|
|
goto out;
|
|
|
|
}
|
2017-05-12 01:09:31 +00:00
|
|
|
// Get extensions from all ICD's, merge so no duplicates
|
|
|
|
res = loader_get_icd_loader_instance_extensions(NULL, &icd_tramp_list, &local_ext_list);
|
2016-11-23 03:29:18 +00:00
|
|
|
if (VK_SUCCESS != res) {
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
loader_scanned_icd_clear(NULL, &icd_tramp_list);
|
2016-06-18 00:32:21 +00:00
|
|
|
|
|
|
|
// Append implicit layers.
|
|
|
|
loader_implicit_layer_scan(NULL, &instance_layers);
|
|
|
|
for (uint32_t i = 0; i < instance_layers.count; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
struct loader_extension_list *ext_list = &instance_layers.list[i].instance_extension_list;
|
|
|
|
loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, ext_list->list);
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
global_ext_list = &local_ext_list;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (global_ext_list == NULL) {
|
2016-11-23 03:29:18 +00:00
|
|
|
res = VK_ERROR_LAYER_NOT_PRESENT;
|
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pProperties == NULL) {
|
|
|
|
*pPropertyCount = global_ext_list->count;
|
2016-11-23 03:29:18 +00:00
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
copy_size = *pPropertyCount < global_ext_list->count ? *pPropertyCount : global_ext_list->count;
|
2016-06-18 00:32:21 +00:00
|
|
|
for (uint32_t i = 0; i < copy_size; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
memcpy(&pProperties[i], &global_ext_list->list[i], sizeof(VkExtensionProperties));
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
*pPropertyCount = copy_size;
|
|
|
|
|
|
|
|
if (copy_size < global_ext_list->count) {
|
2016-11-23 03:29:18 +00:00
|
|
|
res = VK_INCOMPLETE;
|
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
out:
|
2017-01-27 05:57:54 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_destroy_generic_list(NULL, (struct loader_generic_list *)&local_ext_list);
|
2016-11-23 03:29:18 +00:00
|
|
|
loader_delete_layer_properties(NULL, &instance_layers);
|
|
|
|
return res;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pPropertyCount,
|
|
|
|
VkLayerProperties *pProperties) {
|
|
|
|
VkResult result = VK_SUCCESS;
|
2016-06-18 00:32:21 +00:00
|
|
|
struct loader_layer_list instance_layer_list;
|
|
|
|
tls_instance = NULL;
|
|
|
|
|
|
|
|
loader_platform_thread_once(&once_init, loader_initialize);
|
|
|
|
|
|
|
|
uint32_t copy_size;
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Get layer libraries
|
2016-06-18 00:32:21 +00:00
|
|
|
memset(&instance_layer_list, 0, sizeof(instance_layer_list));
|
|
|
|
loader_layer_scan(NULL, &instance_layer_list);
|
|
|
|
|
|
|
|
if (pProperties == NULL) {
|
|
|
|
*pPropertyCount = instance_layer_list.count;
|
2017-05-12 01:09:31 +00:00
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
copy_size = (*pPropertyCount < instance_layer_list.count) ? *pPropertyCount : instance_layer_list.count;
|
2016-06-18 00:32:21 +00:00
|
|
|
for (uint32_t i = 0; i < copy_size; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
memcpy(&pProperties[i], &instance_layer_list.list[i].info, sizeof(VkLayerProperties));
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*pPropertyCount = copy_size;
|
|
|
|
|
|
|
|
if (copy_size < instance_layer_list.count) {
|
2017-05-12 01:09:31 +00:00
|
|
|
result = VK_INCOMPLETE;
|
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
out:
|
2016-11-23 03:29:18 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_delete_layer_properties(NULL, &instance_layer_list);
|
|
|
|
return result;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) {
|
2016-02-18 01:42:25 +00:00
|
|
|
struct loader_instance *ptr_instance = NULL;
|
|
|
|
VkInstance created_instance = VK_NULL_HANDLE;
|
2016-11-23 03:29:18 +00:00
|
|
|
bool loaderLocked = false;
|
2016-02-18 01:42:25 +00:00
|
|
|
VkResult res = VK_ERROR_INITIALIZATION_FAILED;
|
|
|
|
|
|
|
|
loader_platform_thread_once(&once_init, loader_initialize);
|
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
|
|
|
|
{
|
|
|
|
#else
|
|
|
|
if (pAllocator) {
|
2017-05-12 01:09:31 +00:00
|
|
|
ptr_instance = (struct loader_instance *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(struct loader_instance),
|
|
|
|
sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
|
2016-02-18 01:42:25 +00:00
|
|
|
} else {
|
|
|
|
#endif
|
2017-05-12 01:09:31 +00:00
|
|
|
ptr_instance = (struct loader_instance *)malloc(sizeof(struct loader_instance));
|
2016-11-23 03:29:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VkInstanceCreateInfo ici = *pCreateInfo;
|
|
|
|
|
2016-02-18 01:42:25 +00:00
|
|
|
if (ptr_instance == NULL) {
|
2016-11-23 03:29:18 +00:00
|
|
|
res = VK_ERROR_OUT_OF_HOST_MEMORY;
|
|
|
|
goto out;
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tls_instance = ptr_instance;
|
|
|
|
loader_platform_thread_lock_mutex(&loader_lock);
|
2016-11-23 03:29:18 +00:00
|
|
|
loaderLocked = true;
|
2016-02-18 01:42:25 +00:00
|
|
|
memset(ptr_instance, 0, sizeof(struct loader_instance));
|
|
|
|
if (pAllocator) {
|
|
|
|
ptr_instance->alloc_callbacks = *pAllocator;
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Look for one or more debug report create info structures
|
|
|
|
// and setup a callback(s) for each one found.
|
2016-06-18 00:32:21 +00:00
|
|
|
ptr_instance->num_tmp_callbacks = 0;
|
|
|
|
ptr_instance->tmp_dbg_create_infos = NULL;
|
|
|
|
ptr_instance->tmp_callbacks = NULL;
|
2017-05-12 01:09:31 +00:00
|
|
|
if (util_CopyDebugReportCreateInfos(pCreateInfo->pNext, pAllocator, &ptr_instance->num_tmp_callbacks,
|
|
|
|
&ptr_instance->tmp_dbg_create_infos, &ptr_instance->tmp_callbacks)) {
|
2016-06-18 00:32:21 +00:00
|
|
|
// One or more were found, but allocation failed. Therefore, clean up
|
|
|
|
// and fail this function:
|
2016-11-23 03:29:18 +00:00
|
|
|
res = VK_ERROR_OUT_OF_HOST_MEMORY;
|
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
} else if (ptr_instance->num_tmp_callbacks > 0) {
|
|
|
|
// Setup the temporary callback(s) here to catch early issues:
|
2017-05-12 01:09:31 +00:00
|
|
|
if (util_CreateDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks,
|
|
|
|
ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks)) {
|
2016-06-18 00:32:21 +00:00
|
|
|
// Failure of setting up one or more of the callback. Therefore,
|
|
|
|
// clean up and fail this function:
|
2016-11-23 03:29:18 +00:00
|
|
|
res = VK_ERROR_OUT_OF_HOST_MEMORY;
|
|
|
|
goto out;
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Due to implicit layers need to get layer list even if
|
|
|
|
// enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always
|
|
|
|
// get layer list via loader_layer_scan().
|
|
|
|
memset(&ptr_instance->instance_layer_list, 0, sizeof(ptr_instance->instance_layer_list));
|
2016-06-18 00:32:21 +00:00
|
|
|
loader_layer_scan(ptr_instance, &ptr_instance->instance_layer_list);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Validate the app requested layers to be enabled
|
2016-02-18 01:42:25 +00:00
|
|
|
if (pCreateInfo->enabledLayerCount > 0) {
|
2017-05-12 01:09:31 +00:00
|
|
|
res = loader_validate_layers(ptr_instance, pCreateInfo->enabledLayerCount, pCreateInfo->ppEnabledLayerNames,
|
|
|
|
&ptr_instance->instance_layer_list);
|
2016-02-18 01:42:25 +00:00
|
|
|
if (res != VK_SUCCESS) {
|
2016-11-23 03:29:18 +00:00
|
|
|
goto out;
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Convert any meta layers to the actual layers makes a copy of layer name
|
|
|
|
VkResult layerErr =
|
|
|
|
loader_expand_layer_names(ptr_instance, std_validation_str, sizeof(std_validation_names) / sizeof(std_validation_names[0]),
|
|
|
|
std_validation_names, &ici.enabledLayerCount, &ici.ppEnabledLayerNames);
|
2016-11-23 03:29:18 +00:00
|
|
|
if (VK_SUCCESS != layerErr) {
|
|
|
|
res = layerErr;
|
|
|
|
goto out;
|
|
|
|
}
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Scan/discover all ICD libraries
|
|
|
|
memset(&ptr_instance->icd_tramp_list, 0, sizeof(ptr_instance->icd_tramp_list));
|
2016-11-23 03:29:18 +00:00
|
|
|
res = loader_icd_scan(ptr_instance, &ptr_instance->icd_tramp_list);
|
|
|
|
if (res != VK_SUCCESS) {
|
|
|
|
goto out;
|
|
|
|
}
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Get extensions from all ICD's, merge so no duplicates, then validate
|
|
|
|
res = loader_get_icd_loader_instance_extensions(ptr_instance, &ptr_instance->icd_tramp_list, &ptr_instance->ext_list);
|
2016-11-23 03:29:18 +00:00
|
|
|
if (res != VK_SUCCESS) {
|
|
|
|
goto out;
|
|
|
|
}
|
2017-05-12 01:09:31 +00:00
|
|
|
res = loader_validate_instance_extensions(ptr_instance, &ptr_instance->ext_list, &ptr_instance->instance_layer_list, &ici);
|
2016-02-18 01:42:25 +00:00
|
|
|
if (res != VK_SUCCESS) {
|
2016-11-23 03:29:18 +00:00
|
|
|
goto out;
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
ptr_instance->disp =
|
|
|
|
loader_instance_heap_alloc(ptr_instance, sizeof(VkLayerInstanceDispatchTable), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
|
2016-02-18 01:42:25 +00:00
|
|
|
if (ptr_instance->disp == NULL) {
|
2017-01-27 05:57:54 +00:00
|
|
|
loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
|
|
|
"vkCreateInstance: Failed to allocate Instance dispatch"
|
|
|
|
" table.");
|
2016-11-23 03:29:18 +00:00
|
|
|
res = VK_ERROR_OUT_OF_HOST_MEMORY;
|
|
|
|
goto out;
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
memcpy(ptr_instance->disp, &instance_disp, sizeof(instance_disp));
|
|
|
|
ptr_instance->next = loader.instances;
|
|
|
|
loader.instances = ptr_instance;
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Activate any layers on instance chain
|
|
|
|
res = loader_enable_instance_layers(ptr_instance, &ici, &ptr_instance->instance_layer_list);
|
2016-02-18 01:42:25 +00:00
|
|
|
if (res != VK_SUCCESS) {
|
2016-11-23 03:29:18 +00:00
|
|
|
goto out;
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
created_instance = (VkInstance)ptr_instance;
|
2017-05-12 01:09:31 +00:00
|
|
|
res = loader_create_instance_chain(&ici, pAllocator, ptr_instance, &created_instance);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
|
|
|
if (res == VK_SUCCESS) {
|
2017-01-27 05:57:54 +00:00
|
|
|
memset(ptr_instance->enabled_known_extensions.padding, 0, sizeof(uint64_t) * 4);
|
|
|
|
|
2016-06-18 00:32:21 +00:00
|
|
|
wsi_create_instance(ptr_instance, &ici);
|
|
|
|
debug_report_create_instance(ptr_instance, &ici);
|
2016-11-23 03:29:18 +00:00
|
|
|
extensions_create_instance(ptr_instance, &ici);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
|
|
|
*pInstance = created_instance;
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Finally have the layers in place and everyone has seen
|
|
|
|
// the CreateInstance command go by. This allows the layer's
|
|
|
|
// GetInstanceProcAddr functions to return valid extension functions
|
|
|
|
// if enabled.
|
2016-02-18 01:42:25 +00:00
|
|
|
loader_activate_instance_layer_extensions(ptr_instance, *pInstance);
|
|
|
|
}
|
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
out:
|
|
|
|
|
|
|
|
if (NULL != ptr_instance) {
|
|
|
|
if (res != VK_SUCCESS) {
|
|
|
|
if (NULL != ptr_instance->next) {
|
|
|
|
loader.instances = ptr_instance->next;
|
|
|
|
}
|
|
|
|
if (NULL != ptr_instance->disp) {
|
|
|
|
loader_instance_heap_free(ptr_instance, ptr_instance->disp);
|
|
|
|
}
|
|
|
|
if (ptr_instance->num_tmp_callbacks > 0) {
|
2017-05-12 01:09:31 +00:00
|
|
|
util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks,
|
|
|
|
ptr_instance->tmp_callbacks);
|
|
|
|
util_FreeDebugReportCreateInfos(pAllocator, ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks);
|
2016-11-23 03:29:18 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_deactivate_layers(ptr_instance, NULL, &ptr_instance->activated_layer_list);
|
2016-11-23 03:29:18 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, &ici);
|
|
|
|
loader_delete_layer_properties(ptr_instance, &ptr_instance->instance_layer_list);
|
|
|
|
loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_tramp_list);
|
|
|
|
loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)&ptr_instance->ext_list);
|
2016-11-23 03:29:18 +00:00
|
|
|
|
|
|
|
loader_instance_heap_free(ptr_instance, ptr_instance);
|
|
|
|
} else {
|
2017-05-12 01:09:31 +00:00
|
|
|
// Remove temporary debug_report callback
|
|
|
|
util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks,
|
2016-11-23 03:29:18 +00:00
|
|
|
ptr_instance->tmp_callbacks);
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, &ici);
|
2016-11-23 03:29:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (loaderLocked) {
|
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-18 01:42:25 +00:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerInstanceDispatchTable *disp;
|
|
|
|
struct loader_instance *ptr_instance = NULL;
|
2016-06-18 00:32:21 +00:00
|
|
|
bool callback_setup = false;
|
|
|
|
|
|
|
|
if (instance == VK_NULL_HANDLE) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-01-27 05:57:54 +00:00
|
|
|
disp = loader_get_instance_layer_dispatch(instance);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
|
|
|
loader_platform_thread_lock_mutex(&loader_lock);
|
|
|
|
|
|
|
|
ptr_instance = loader_get_instance(instance);
|
2016-06-18 00:32:21 +00:00
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
if (pAllocator) {
|
|
|
|
ptr_instance->alloc_callbacks = *pAllocator;
|
|
|
|
}
|
|
|
|
|
2016-06-18 00:32:21 +00:00
|
|
|
if (ptr_instance->num_tmp_callbacks > 0) {
|
|
|
|
// Setup the temporary callback(s) here to catch cleanup issues:
|
2017-05-12 01:09:31 +00:00
|
|
|
if (!util_CreateDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks,
|
|
|
|
ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks)) {
|
2016-06-18 00:32:21 +00:00
|
|
|
callback_setup = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-18 01:42:25 +00:00
|
|
|
disp->DestroyInstance(instance, pAllocator);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_deactivate_layers(ptr_instance, NULL, &ptr_instance->activated_layer_list);
|
2017-01-27 05:57:54 +00:00
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
if (ptr_instance->phys_devs_tramp) {
|
2017-01-27 05:57:54 +00:00
|
|
|
for (uint32_t i = 0; i < ptr_instance->phys_dev_count_tramp; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_instance_heap_free(ptr_instance, ptr_instance->phys_devs_tramp[i]);
|
2017-01-27 05:57:54 +00:00
|
|
|
}
|
2016-11-23 03:29:18 +00:00
|
|
|
loader_instance_heap_free(ptr_instance, ptr_instance->phys_devs_tramp);
|
|
|
|
}
|
2017-01-27 05:57:54 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
if (ptr_instance->phys_dev_groups_tramp) {
|
|
|
|
for (uint32_t i = 0; i < ptr_instance->phys_dev_group_count_tramp; i++) {
|
|
|
|
loader_instance_heap_free(ptr_instance, ptr_instance->phys_dev_groups_tramp[i]);
|
|
|
|
}
|
|
|
|
loader_instance_heap_free(ptr_instance, ptr_instance->phys_dev_groups_tramp);
|
|
|
|
}
|
|
|
|
|
2016-06-18 00:32:21 +00:00
|
|
|
if (callback_setup) {
|
2017-05-12 01:09:31 +00:00
|
|
|
util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, ptr_instance->tmp_callbacks);
|
|
|
|
util_FreeDebugReportCreateInfos(pAllocator, ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks);
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
2016-11-23 03:29:18 +00:00
|
|
|
loader_instance_heap_free(ptr_instance, ptr_instance->disp);
|
|
|
|
loader_instance_heap_free(ptr_instance, ptr_instance);
|
2016-02-18 01:42:25 +00:00
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount,
|
|
|
|
VkPhysicalDevice *pPhysicalDevices) {
|
2017-01-27 05:57:54 +00:00
|
|
|
VkResult res = VK_SUCCESS;
|
2017-05-12 01:09:31 +00:00
|
|
|
uint32_t count;
|
|
|
|
uint32_t i;
|
2016-06-18 00:32:21 +00:00
|
|
|
struct loader_instance *inst;
|
2016-02-18 01:42:25 +00:00
|
|
|
|
|
|
|
loader_platform_thread_lock_mutex(&loader_lock);
|
2016-06-18 00:32:21 +00:00
|
|
|
|
2017-01-27 05:57:54 +00:00
|
|
|
inst = loader_get_instance(instance);
|
|
|
|
if (NULL == inst) {
|
|
|
|
res = VK_ERROR_INITIALIZATION_FAILED;
|
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
if (NULL == pPhysicalDeviceCount) {
|
|
|
|
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
|
|
|
"vkEnumeratePhysicalDevices: Received NULL pointer for physical device count return value.");
|
|
|
|
res = VK_ERROR_INITIALIZATION_FAILED;
|
2017-01-27 05:57:54 +00:00
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
2017-01-27 05:57:54 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Setup the trampoline loader physical devices. This will actually
|
|
|
|
// call down and setup the terminator loader physical devices during the
|
|
|
|
// process.
|
2017-01-27 05:57:54 +00:00
|
|
|
VkResult setup_res = setupLoaderTrampPhysDevs(instance);
|
|
|
|
if (setup_res != VK_SUCCESS && setup_res != VK_INCOMPLETE) {
|
|
|
|
res = setup_res;
|
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
2017-01-27 05:57:54 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
count = inst->phys_dev_count_tramp;
|
|
|
|
|
2017-01-27 05:57:54 +00:00
|
|
|
// Wrap the PhysDev object for loader usage, return wrapped objects
|
2017-05-12 01:09:31 +00:00
|
|
|
if (NULL != pPhysicalDevices) {
|
|
|
|
if (inst->phys_dev_count_tramp > *pPhysicalDeviceCount) {
|
|
|
|
loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
|
|
|
|
"vkEnumeratePhysicalDevices: Trimming device count down"
|
|
|
|
" by application request from %d to %d physical devices",
|
|
|
|
inst->phys_dev_count_tramp, *pPhysicalDeviceCount);
|
|
|
|
count = *pPhysicalDeviceCount;
|
|
|
|
res = VK_INCOMPLETE;
|
|
|
|
}
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
pPhysicalDevices[i] = (VkPhysicalDevice)inst->phys_devs_tramp[i];
|
|
|
|
}
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
*pPhysicalDeviceCount = count;
|
2016-06-18 00:32:21 +00:00
|
|
|
|
2017-01-27 05:57:54 +00:00
|
|
|
out:
|
2016-06-18 00:32:21 +00:00
|
|
|
|
2016-02-18 01:42:25 +00:00
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,
|
|
|
|
VkPhysicalDeviceFeatures *pFeatures) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerInstanceDispatchTable *disp;
|
2017-05-12 01:09:31 +00:00
|
|
|
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
|
2017-01-27 05:57:54 +00:00
|
|
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
2016-06-18 00:32:21 +00:00
|
|
|
disp->GetPhysicalDeviceFeatures(unwrapped_phys_dev, pFeatures);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format,
|
|
|
|
VkFormatProperties *pFormatInfo) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerInstanceDispatchTable *disp;
|
2017-05-12 01:09:31 +00:00
|
|
|
VkPhysicalDevice unwrapped_pd = loader_unwrap_physical_device(physicalDevice);
|
2017-01-27 05:57:54 +00:00
|
|
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
2016-06-18 00:32:21 +00:00
|
|
|
disp->GetPhysicalDeviceFormatProperties(unwrapped_pd, format, pFormatInfo);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(
|
|
|
|
VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage,
|
|
|
|
VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerInstanceDispatchTable *disp;
|
2017-05-12 01:09:31 +00:00
|
|
|
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
|
2017-01-27 05:57:54 +00:00
|
|
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->GetPhysicalDeviceImageFormatProperties(unwrapped_phys_dev, format, type, tiling, usage, flags,
|
|
|
|
pImageFormatProperties);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
|
|
|
|
VkPhysicalDeviceProperties *pProperties) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerInstanceDispatchTable *disp;
|
2017-05-12 01:09:31 +00:00
|
|
|
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
|
2017-01-27 05:57:54 +00:00
|
|
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
2016-06-18 00:32:21 +00:00
|
|
|
disp->GetPhysicalDeviceProperties(unwrapped_phys_dev, pProperties);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t *pQueueFamilyPropertyCount,
|
|
|
|
VkQueueFamilyProperties *pQueueProperties) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerInstanceDispatchTable *disp;
|
2017-05-12 01:09:31 +00:00
|
|
|
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
|
2017-01-27 05:57:54 +00:00
|
|
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->GetPhysicalDeviceQueueFamilyProperties(unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueProperties);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice,
|
|
|
|
VkPhysicalDeviceMemoryProperties *pMemoryProperties) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerInstanceDispatchTable *disp;
|
2017-05-12 01:09:31 +00:00
|
|
|
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
|
2017-01-27 05:57:54 +00:00
|
|
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->GetPhysicalDeviceMemoryProperties(unwrapped_phys_dev, pMemoryProperties);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) {
|
2016-02-18 01:42:25 +00:00
|
|
|
VkResult res;
|
2016-11-23 03:29:18 +00:00
|
|
|
struct loader_physical_device_tramp *phys_dev = NULL;
|
|
|
|
struct loader_device *dev = NULL;
|
|
|
|
struct loader_instance *inst = NULL;
|
2016-06-18 00:32:21 +00:00
|
|
|
|
|
|
|
assert(pCreateInfo->queueCreateInfoCount >= 1);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
|
|
|
loader_platform_thread_lock_mutex(&loader_lock);
|
|
|
|
|
2016-06-18 00:32:21 +00:00
|
|
|
phys_dev = (struct loader_physical_device_tramp *)physicalDevice;
|
|
|
|
inst = (struct loader_instance *)phys_dev->this_instance;
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Get the physical device (ICD) extensions
|
2016-06-18 00:32:21 +00:00
|
|
|
struct loader_extension_list icd_exts;
|
2016-11-23 03:29:18 +00:00
|
|
|
icd_exts.list = NULL;
|
2017-05-12 01:09:31 +00:00
|
|
|
res = loader_init_generic_list(inst, (struct loader_generic_list *)&icd_exts, sizeof(VkExtensionProperties));
|
2016-11-23 03:29:18 +00:00
|
|
|
if (VK_SUCCESS != res) {
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to create ICD extension list");
|
2016-11-23 03:29:18 +00:00
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
res = loader_add_device_extensions(inst, inst->disp->layer_inst_disp.EnumerateDeviceExtensionProperties, phys_dev->phys_dev,
|
|
|
|
"Unknown", &icd_exts);
|
2016-06-18 00:32:21 +00:00
|
|
|
if (res != VK_SUCCESS) {
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to add extensions to list");
|
2016-11-23 03:29:18 +00:00
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Make sure requested extensions to be enabled are supported
|
|
|
|
res = loader_validate_device_extensions(phys_dev, &inst->activated_layer_list, &icd_exts, pCreateInfo);
|
2016-06-18 00:32:21 +00:00
|
|
|
if (res != VK_SUCCESS) {
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to validate extensions in list");
|
2016-11-23 03:29:18 +00:00
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
dev = loader_create_logical_device(inst, pAllocator);
|
2016-06-18 00:32:21 +00:00
|
|
|
if (dev == NULL) {
|
2016-11-23 03:29:18 +00:00
|
|
|
res = VK_ERROR_OUT_OF_HOST_MEMORY;
|
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Copy the instance layer list into the device
|
2016-06-18 00:32:21 +00:00
|
|
|
dev->activated_layer_list.capacity = inst->activated_layer_list.capacity;
|
|
|
|
dev->activated_layer_list.count = inst->activated_layer_list.count;
|
2016-11-23 03:29:18 +00:00
|
|
|
dev->activated_layer_list.list =
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_device_heap_alloc(dev, inst->activated_layer_list.capacity, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
|
2016-06-18 00:32:21 +00:00
|
|
|
if (dev->activated_layer_list.list == NULL) {
|
2017-01-27 05:57:54 +00:00
|
|
|
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
|
|
|
"vkCreateDevice: Failed to allocate activated layer"
|
|
|
|
"list of size %d.",
|
|
|
|
inst->activated_layer_list.capacity);
|
2016-11-23 03:29:18 +00:00
|
|
|
res = VK_ERROR_OUT_OF_HOST_MEMORY;
|
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
memcpy(dev->activated_layer_list.list, inst->activated_layer_list.list,
|
2017-05-12 01:09:31 +00:00
|
|
|
sizeof(*dev->activated_layer_list.list) * dev->activated_layer_list.count);
|
2016-06-18 00:32:21 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
res = loader_create_device_chain(phys_dev, pCreateInfo, pAllocator, inst, dev);
|
2016-06-18 00:32:21 +00:00
|
|
|
if (res != VK_SUCCESS) {
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to create device chain.");
|
2016-11-23 03:29:18 +00:00
|
|
|
goto out;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
*pDevice = dev->chain_device;
|
2016-06-18 00:32:21 +00:00
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
// Initialize any device extension dispatch entry's from the instance list
|
2016-06-18 00:32:21 +00:00
|
|
|
loader_init_dispatch_dev_ext(inst, dev);
|
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
// Initialize WSI device extensions as part of core dispatch since loader
|
|
|
|
// has dedicated trampoline code for these*/
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_init_device_extension_dispatch_table(&dev->loader_dispatch, dev->loader_dispatch.core_dispatch.GetDeviceProcAddr,
|
|
|
|
*pDevice);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
out:
|
|
|
|
|
|
|
|
// Failure cleanup
|
|
|
|
if (VK_SUCCESS != res) {
|
|
|
|
if (NULL != dev) {
|
|
|
|
loader_destroy_logical_device(inst, dev, pAllocator);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != icd_exts.list) {
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_destroy_generic_list(inst, (struct loader_generic_list *)&icd_exts);
|
2016-11-23 03:29:18 +00:00
|
|
|
}
|
2016-02-18 01:42:25 +00:00
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
struct loader_device *dev;
|
|
|
|
|
2016-06-18 00:32:21 +00:00
|
|
|
if (device == VK_NULL_HANDLE) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-02-18 01:42:25 +00:00
|
|
|
loader_platform_thread_lock_mutex(&loader_lock);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, NULL);
|
2016-11-23 03:29:18 +00:00
|
|
|
const struct loader_instance *inst = icd_term->this_instance;
|
2016-02-18 01:42:25 +00:00
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyDevice(device, pAllocator);
|
2016-11-23 03:29:18 +00:00
|
|
|
dev->chain_device = NULL;
|
|
|
|
dev->icd_device = NULL;
|
|
|
|
loader_remove_logical_device(inst, icd_term, dev, pAllocator);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
|
|
|
|
const char *pLayerName, uint32_t *pPropertyCount,
|
|
|
|
VkExtensionProperties *pProperties) {
|
2016-06-18 00:32:21 +00:00
|
|
|
VkResult res = VK_SUCCESS;
|
|
|
|
struct loader_physical_device_tramp *phys_dev;
|
|
|
|
phys_dev = (struct loader_physical_device_tramp *)physicalDevice;
|
2016-02-18 01:42:25 +00:00
|
|
|
|
|
|
|
loader_platform_thread_lock_mutex(&loader_lock);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// If pLayerName == NULL, then querying ICD extensions, pass this call
|
|
|
|
// down the instance chain which will terminate in the ICD. This allows
|
|
|
|
// layers to filter the extensions coming back up the chain.
|
|
|
|
// If pLayerName != NULL then get layer extensions from manifest file.
|
2016-02-18 01:42:25 +00:00
|
|
|
if (pLayerName == NULL || strlen(pLayerName) == 0) {
|
|
|
|
const VkLayerInstanceDispatchTable *disp;
|
|
|
|
|
2017-01-27 05:57:54 +00:00
|
|
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
2017-05-12 01:09:31 +00:00
|
|
|
res = disp->EnumerateDeviceExtensionProperties(phys_dev->phys_dev, NULL, pPropertyCount, pProperties);
|
2016-02-18 01:42:25 +00:00
|
|
|
} else {
|
2016-06-18 00:32:21 +00:00
|
|
|
uint32_t count;
|
|
|
|
uint32_t copy_size;
|
|
|
|
const struct loader_instance *inst = phys_dev->this_instance;
|
|
|
|
struct loader_device_extension_list *dev_ext_list = NULL;
|
|
|
|
struct loader_device_extension_list local_ext_list;
|
|
|
|
memset(&local_ext_list, 0, sizeof(local_ext_list));
|
2017-05-12 01:09:31 +00:00
|
|
|
if (vk_string_validate(MaxLoaderStringLength, pLayerName) == VK_STRING_ERROR_NONE) {
|
2016-06-18 00:32:21 +00:00
|
|
|
if (strcmp(pLayerName, std_validation_str) == 0) {
|
|
|
|
struct loader_layer_list local_list;
|
|
|
|
memset(&local_list, 0, sizeof(local_list));
|
2017-05-12 01:09:31 +00:00
|
|
|
for (uint32_t i = 0; i < sizeof(std_validation_names) / sizeof(std_validation_names[0]); i++) {
|
|
|
|
loader_find_layer_name_add_list(NULL, std_validation_names[i], VK_LAYER_TYPE_INSTANCE_EXPLICIT,
|
|
|
|
&inst->instance_layer_list, &local_list);
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
for (uint32_t i = 0; i < local_list.count; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
struct loader_device_extension_list *ext_list = &local_list.list[i].device_extension_list;
|
2016-06-18 00:32:21 +00:00
|
|
|
for (uint32_t j = 0; j < ext_list->count; j++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_add_to_dev_ext_list(NULL, &local_ext_list, &ext_list->list[j].props, 0, NULL);
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_destroy_layer_list(NULL, NULL, &local_list);
|
2016-06-18 00:32:21 +00:00
|
|
|
dev_ext_list = &local_ext_list;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
for (uint32_t i = 0; i < inst->instance_layer_list.count; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
struct loader_layer_properties *props = &inst->instance_layer_list.list[i];
|
2016-06-18 00:32:21 +00:00
|
|
|
if (strcmp(props->info.layerName, pLayerName) == 0) {
|
|
|
|
dev_ext_list = &props->device_extension_list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
count = (dev_ext_list == NULL) ? 0 : dev_ext_list->count;
|
|
|
|
if (pProperties == NULL) {
|
|
|
|
*pPropertyCount = count;
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_destroy_generic_list(inst, (struct loader_generic_list *)&local_ext_list);
|
2016-06-18 00:32:21 +00:00
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
return VK_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
copy_size = *pPropertyCount < count ? *pPropertyCount : count;
|
|
|
|
for (uint32_t i = 0; i < copy_size; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
memcpy(&pProperties[i], &dev_ext_list->list[i].props, sizeof(VkExtensionProperties));
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
*pPropertyCount = copy_size;
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_destroy_generic_list(inst, (struct loader_generic_list *)&local_ext_list);
|
2016-06-18 00:32:21 +00:00
|
|
|
if (copy_size < count) {
|
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
return VK_INCOMPLETE;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
|
|
|
"vkEnumerateDeviceExtensionProperties: pLayerName "
|
|
|
|
"is too long or is badly formed");
|
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
return VK_ERROR_EXTENSION_NOT_PRESENT;
|
|
|
|
}
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t *pPropertyCount,
|
|
|
|
VkLayerProperties *pProperties) {
|
2016-06-18 00:32:21 +00:00
|
|
|
uint32_t copy_size;
|
|
|
|
struct loader_physical_device_tramp *phys_dev;
|
|
|
|
struct loader_layer_list *enabled_layers, layers_list;
|
2017-05-12 01:09:31 +00:00
|
|
|
uint32_t std_val_count = sizeof(std_validation_names) / sizeof(std_validation_names[0]);
|
2016-06-18 00:32:21 +00:00
|
|
|
memset(&layers_list, 0, sizeof(layers_list));
|
2016-02-18 01:42:25 +00:00
|
|
|
loader_platform_thread_lock_mutex(&loader_lock);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
// Don't dispatch this call down the instance chain, want all device layers
|
|
|
|
// enumerated and instance chain may not contain all device layers
|
2016-06-18 00:32:21 +00:00
|
|
|
// TODO re-evaluate the above statement we maybe able to start calling
|
|
|
|
// down the chain
|
|
|
|
|
|
|
|
phys_dev = (struct loader_physical_device_tramp *)physicalDevice;
|
|
|
|
const struct loader_instance *inst = phys_dev->this_instance;
|
|
|
|
|
|
|
|
uint32_t count = inst->activated_layer_list.count;
|
2017-05-12 01:09:31 +00:00
|
|
|
if (inst->activated_layers_are_std_val) count = count - std_val_count + 1;
|
2016-06-18 00:32:21 +00:00
|
|
|
if (pProperties == NULL) {
|
|
|
|
*pPropertyCount = count;
|
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
return VK_SUCCESS;
|
|
|
|
}
|
2017-05-12 01:09:31 +00:00
|
|
|
// Make sure to enumerate standard_validation if that is what was used
|
|
|
|
// at the instance layer enablement
|
2016-06-18 00:32:21 +00:00
|
|
|
if (inst->activated_layers_are_std_val) {
|
|
|
|
enabled_layers = &layers_list;
|
|
|
|
enabled_layers->count = count;
|
2017-05-12 01:09:31 +00:00
|
|
|
enabled_layers->capacity = enabled_layers->count * sizeof(struct loader_layer_properties);
|
|
|
|
enabled_layers->list = loader_instance_heap_alloc(inst, enabled_layers->capacity, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
|
2017-01-27 05:57:54 +00:00
|
|
|
if (!enabled_layers->list) {
|
2017-05-12 01:09:31 +00:00
|
|
|
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
|
|
|
"vkEnumerateDeviceLayerProperties: Failed to allocate enabled"
|
|
|
|
"layer list of size %d",
|
|
|
|
enabled_layers->capacity);
|
2016-06-18 00:32:21 +00:00
|
|
|
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
2017-01-27 05:57:54 +00:00
|
|
|
}
|
2016-06-18 00:32:21 +00:00
|
|
|
|
|
|
|
uint32_t j = 0;
|
|
|
|
for (uint32_t i = 0; i < inst->activated_layer_list.count; j++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
if (loader_find_layer_name_array(inst->activated_layer_list.list[i].info.layerName, std_val_count,
|
|
|
|
std_validation_names)) {
|
2016-06-18 00:32:21 +00:00
|
|
|
struct loader_layer_properties props;
|
|
|
|
loader_init_std_validation_props(&props);
|
2017-05-12 01:09:31 +00:00
|
|
|
VkResult err = loader_copy_layer_properties(inst, &enabled_layers->list[j], &props);
|
2016-11-23 03:29:18 +00:00
|
|
|
if (err != VK_SUCCESS) {
|
|
|
|
return err;
|
|
|
|
}
|
2016-06-18 00:32:21 +00:00
|
|
|
i += std_val_count;
|
2017-05-12 01:09:31 +00:00
|
|
|
} else {
|
|
|
|
VkResult err = loader_copy_layer_properties(inst, &enabled_layers->list[j], &inst->activated_layer_list.list[i++]);
|
2016-11-23 03:29:18 +00:00
|
|
|
if (err != VK_SUCCESS) {
|
|
|
|
return err;
|
|
|
|
}
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 01:09:31 +00:00
|
|
|
} else {
|
|
|
|
enabled_layers = (struct loader_layer_list *)&inst->activated_layer_list;
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
copy_size = (*pPropertyCount < count) ? *pPropertyCount : count;
|
|
|
|
for (uint32_t i = 0; i < copy_size; i++) {
|
2017-05-12 01:09:31 +00:00
|
|
|
memcpy(&pProperties[i], &(enabled_layers->list[i].info), sizeof(VkLayerProperties));
|
2016-06-18 00:32:21 +00:00
|
|
|
}
|
|
|
|
*pPropertyCount = copy_size;
|
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
if (inst->activated_layers_are_std_val) {
|
2016-06-18 00:32:21 +00:00
|
|
|
loader_delete_layer_properties(inst, enabled_layers);
|
2016-11-23 03:29:18 +00:00
|
|
|
}
|
2016-06-18 00:32:21 +00:00
|
|
|
if (copy_size < count) {
|
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
|
|
|
return VK_INCOMPLETE;
|
|
|
|
}
|
|
|
|
|
2016-02-18 01:42:25 +00:00
|
|
|
loader_platform_thread_unlock_mutex(&loader_lock);
|
2016-06-18 00:32:21 +00:00
|
|
|
return VK_SUCCESS;
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex,
|
|
|
|
VkQueue *pQueue) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue);
|
|
|
|
loader_set_dispatch(*pQueue, disp);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits,
|
|
|
|
VkFence fence) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(queue);
|
|
|
|
|
|
|
|
return disp->QueueSubmit(queue, submitCount, pSubmits, fence);
|
|
|
|
}
|
|
|
|
|
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue) {
|
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(queue);
|
|
|
|
|
|
|
|
return disp->QueueWaitIdle(queue);
|
|
|
|
}
|
|
|
|
|
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) {
|
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->DeviceWaitIdle(device);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeMemory(VkDevice device, VkDeviceMemory mem,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->FreeMemory(device, mem, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset,
|
|
|
|
VkDeviceSize size, VkFlags flags, void **ppData) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->MapMemory(device, mem, offset, size, flags, ppData);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory mem) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->UnmapMemory(device, mem);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
|
|
|
|
const VkMappedMemoryRange *pMemoryRanges) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
|
|
|
|
const VkMappedMemoryRange *pMemoryRanges) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory,
|
|
|
|
VkDeviceSize *pCommittedMemoryInBytes) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem,
|
|
|
|
VkDeviceSize offset) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->BindBufferMemory(device, buffer, mem, offset);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem,
|
|
|
|
VkDeviceSize offset) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->BindImageMemory(device, image, mem, offset);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer,
|
|
|
|
VkMemoryRequirements *pMemoryRequirements) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image,
|
|
|
|
VkMemoryRequirements *pMemoryRequirements) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->GetImageMemoryRequirements(device, image, pMemoryRequirements);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
|
|
|
|
vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount,
|
|
|
|
VkSparseImageMemoryRequirements *pSparseMemoryRequirements) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(
|
|
|
|
VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage,
|
|
|
|
VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerInstanceDispatchTable *disp;
|
2017-05-12 01:09:31 +00:00
|
|
|
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
|
2017-01-27 05:57:54 +00:00
|
|
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->GetPhysicalDeviceSparseImageFormatProperties(unwrapped_phys_dev, format, type, samples, usage, tiling, pPropertyCount,
|
|
|
|
pProperties);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount,
|
|
|
|
const VkBindSparseInfo *pBindInfo, VkFence fence) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(queue);
|
|
|
|
|
|
|
|
return disp->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkFence *pFence) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateFence(device, pCreateInfo, pAllocator, pFence);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyFence(device, fence, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->ResetFences(device, fenceCount, pFences);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->GetFenceStatus(device, fence);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences,
|
|
|
|
VkBool32 waitAll, uint64_t timeout) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroySemaphore(device, semaphore, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateEvent(device, pCreateInfo, pAllocator, pEvent);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyEvent(device, event, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->GetEventStatus(device, event);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->SetEvent(device, event);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->ResetEvent(device, event);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyQueryPool(device, queryPool, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
|
|
|
|
uint32_t queryCount, size_t dataSize, void *pData,
|
|
|
|
VkDeviceSize stride, VkQueryResultFlags flags) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyBuffer(device, buffer, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkBufferView *pView) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateBufferView(device, pCreateInfo, pAllocator, pView);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyBufferView(device, bufferView, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkImage *pImage) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateImage(device, pCreateInfo, pAllocator, pImage);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyImage(device, image, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image,
|
|
|
|
const VkImageSubresource *pSubresource,
|
|
|
|
VkSubresourceLayout *pLayout) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkImageView *pView) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateImageView(device, pCreateInfo, pAllocator, pView);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyImageView(device, imageView, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkShaderModule *pShader) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateShaderModule(device, pCreateInfo, pAllocator, pShader);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyShaderModule(device, shaderModule, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkPipelineCache *pPipelineCache) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyPipelineCache(device, pipelineCache, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache,
|
|
|
|
size_t *pDataSize, void *pData) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache,
|
|
|
|
uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache,
|
|
|
|
uint32_t createInfoCount,
|
|
|
|
const VkGraphicsPipelineCreateInfo *pCreateInfos,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkPipeline *pPipelines) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache,
|
|
|
|
uint32_t createInfoCount,
|
|
|
|
const VkComputePipelineCreateInfo *pCreateInfos,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkPipeline *pPipelines) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline(VkDevice device, VkPipeline pipeline,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyPipeline(device, pipeline, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkPipelineLayout *pPipelineLayout) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyPipelineLayout(device, pipelineLayout, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateSampler(device, pCreateInfo, pAllocator, pSampler);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroySampler(device, sampler, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device,
|
|
|
|
const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkDescriptorSetLayout *pSetLayout) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkDescriptorPool *pDescriptorPool) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyDescriptorPool(device, descriptorPool, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
|
|
|
|
VkDescriptorPoolResetFlags flags) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->ResetDescriptorPool(device, descriptorPool, flags);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device,
|
|
|
|
const VkDescriptorSetAllocateInfo *pAllocateInfo,
|
|
|
|
VkDescriptorSet *pDescriptorSets) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool,
|
|
|
|
uint32_t descriptorSetCount,
|
|
|
|
const VkDescriptorSet *pDescriptorSets) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
|
|
|
|
const VkWriteDescriptorSet *pDescriptorWrites,
|
|
|
|
uint32_t descriptorCopyCount,
|
|
|
|
const VkCopyDescriptorSet *pDescriptorCopies) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkFramebuffer *pFramebuffer) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyFramebuffer(device, framebuffer, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkRenderPass *pRenderPass) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyRenderPass(device, renderPass, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass,
|
|
|
|
VkExtent2D *pGranularity) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->GetRenderAreaGranularity(device, renderPass, pGranularity);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkCommandPool *pCommandPool) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
return disp->CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool,
|
|
|
|
const VkAllocationCallbacks *pAllocator) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
disp->DestroyCommandPool(device, commandPool, pAllocator);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool,
|
|
|
|
VkCommandPoolResetFlags flags) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
return disp->ResetCommandPool(device, commandPool, flags);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device,
|
|
|
|
const VkCommandBufferAllocateInfo *pAllocateInfo,
|
|
|
|
VkCommandBuffer *pCommandBuffers) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
VkResult res;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
|
|
|
res = disp->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
|
|
|
|
if (res == VK_SUCCESS) {
|
|
|
|
for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) {
|
|
|
|
if (pCommandBuffers[i]) {
|
|
|
|
loader_init_dispatch(pCommandBuffers[i], disp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool,
|
|
|
|
uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(device);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
|
|
|
|
const VkCommandBufferBeginInfo *pBeginInfo) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
return disp->BeginCommandBuffer(commandBuffer, pBeginInfo);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
return disp->EndCommandBuffer(commandBuffer);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
return disp->ResetCommandBuffer(commandBuffer, flags);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
|
|
|
|
VkPipeline pipeline) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport,
|
|
|
|
uint32_t viewportCount, const VkViewport *pViewports) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor,
|
|
|
|
uint32_t scissorCount, const VkRect2D *pScissors) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdSetLineWidth(commandBuffer, lineWidth);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor,
|
|
|
|
float depthBiasClamp, float depthBiasSlopeFactor) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdSetBlendConstants(commandBuffer, blendConstants);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds,
|
|
|
|
float maxDepthBounds) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
|
|
|
|
uint32_t compareMask) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
|
|
|
|
uint32_t writeMask) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
|
|
|
|
uint32_t reference) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdSetStencilReference(commandBuffer, faceMask, reference);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer,
|
|
|
|
VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
|
|
|
|
uint32_t firstSet, uint32_t descriptorSetCount,
|
|
|
|
const VkDescriptorSet *pDescriptorSets,
|
|
|
|
uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets,
|
2016-02-18 01:42:25 +00:00
|
|
|
dynamicOffsetCount, pDynamicOffsets);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
|
|
|
|
VkIndexType indexType) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding,
|
|
|
|
uint32_t bindingCount, const VkBuffer *pBuffers,
|
|
|
|
const VkDeviceSize *pOffsets) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount,
|
|
|
|
uint32_t firstVertex, uint32_t firstInstance) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount,
|
|
|
|
uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset,
|
|
|
|
uint32_t firstInstance) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
|
|
|
|
uint32_t drawCount, uint32_t stride) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
|
|
|
|
VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdDispatch(commandBuffer, x, y, z);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
|
|
|
|
VkDeviceSize offset) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdDispatchIndirect(commandBuffer, buffer, offset);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer,
|
|
|
|
uint32_t regionCount, const VkBufferCopy *pRegions) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage,
|
|
|
|
VkImageLayout srcImageLayout, VkImage dstImage,
|
|
|
|
VkImageLayout dstImageLayout, uint32_t regionCount,
|
|
|
|
const VkImageCopy *pRegions) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage,
|
|
|
|
VkImageLayout srcImageLayout, VkImage dstImage,
|
|
|
|
VkImageLayout dstImageLayout, uint32_t regionCount,
|
|
|
|
const VkImageBlit *pRegions, VkFilter filter) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage,
|
|
|
|
VkImageLayout dstImageLayout, uint32_t regionCount,
|
|
|
|
const VkBufferImageCopy *pRegions) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage,
|
|
|
|
VkImageLayout srcImageLayout, VkBuffer dstBuffer,
|
|
|
|
uint32_t regionCount, const VkBufferImageCopy *pRegions) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
|
|
|
|
VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset,
|
|
|
|
VkDeviceSize size, uint32_t data) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image,
|
|
|
|
VkImageLayout imageLayout, const VkClearColorValue *pColor,
|
|
|
|
uint32_t rangeCount, const VkImageSubresourceRange *pRanges) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image,
|
|
|
|
VkImageLayout imageLayout,
|
|
|
|
const VkClearDepthStencilValue *pDepthStencil,
|
|
|
|
uint32_t rangeCount, const VkImageSubresourceRange *pRanges) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
|
|
|
|
const VkClearAttachment *pAttachments, uint32_t rectCount,
|
|
|
|
const VkClearRect *pRects) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage,
|
|
|
|
VkImageLayout srcImageLayout, VkImage dstImage,
|
|
|
|
VkImageLayout dstImageLayout, uint32_t regionCount,
|
|
|
|
const VkImageResolve *pRegions) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event,
|
|
|
|
VkPipelineStageFlags stageMask) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdSetEvent(commandBuffer, event, stageMask);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event,
|
|
|
|
VkPipelineStageFlags stageMask) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdResetEvent(commandBuffer, event, stageMask);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents,
|
|
|
|
VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask,
|
|
|
|
uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers,
|
|
|
|
uint32_t bufferMemoryBarrierCount,
|
|
|
|
const VkBufferMemoryBarrier *pBufferMemoryBarriers,
|
|
|
|
uint32_t imageMemoryBarrierCount,
|
|
|
|
const VkImageMemoryBarrier *pImageMemoryBarriers) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers,
|
|
|
|
bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
|
|
|
|
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
|
|
|
|
uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers,
|
|
|
|
uint32_t bufferMemoryBarrierCount,
|
|
|
|
const VkBufferMemoryBarrier *pBufferMemoryBarriers,
|
|
|
|
uint32_t imageMemoryBarrierCount,
|
|
|
|
const VkImageMemoryBarrier *pImageMemoryBarriers) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers,
|
|
|
|
bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot,
|
|
|
|
VkFlags flags) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdBeginQuery(commandBuffer, queryPool, slot, flags);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdEndQuery(commandBuffer, queryPool, slot);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
|
|
|
|
uint32_t firstQuery, uint32_t queryCount) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage,
|
|
|
|
VkQueryPool queryPool, uint32_t slot) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
|
|
|
|
uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer,
|
|
|
|
VkDeviceSize dstOffset, VkDeviceSize stride, VkFlags flags) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout,
|
|
|
|
VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size,
|
|
|
|
const void *pValues) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer,
|
|
|
|
const VkRenderPassBeginInfo *pRenderPassBegin,
|
|
|
|
VkSubpassContents contents) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdNextSubpass(commandBuffer, contents);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
|
|
|
disp->CmdEndRenderPass(commandBuffer);
|
|
|
|
}
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount,
|
|
|
|
const VkCommandBuffer *pCommandBuffers) {
|
2016-02-18 01:42:25 +00:00
|
|
|
const VkLayerDispatchTable *disp;
|
|
|
|
|
|
|
|
disp = loader_get_dispatch(commandBuffer);
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
disp->CmdExecuteCommands(commandBuffer, commandBuffersCount, pCommandBuffers);
|
2016-02-18 01:42:25 +00:00
|
|
|
}
|