forked from google/gapid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvulkan_extras.inc
111 lines (102 loc) · 5.43 KB
/
vulkan_extras.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
* Copyright (C) 2017 Google Inc.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
// Note this file is included in context in vulkan_spy.h:
//
// namespace gapii {
//
// class VulkanSpy {
// public:
PFN_vkVoidFunction SpyOverride_vkGetInstanceProcAddr(VkInstance instance,
const char* pName);
PFN_vkVoidFunction SpyOverride_vkGetDeviceProcAddr(VkDevice device,
const char* pName);
uint32_t SpyOverride_vkEnumerateInstanceExtensionProperties(
const char* pLayerName, uint32_t* pCount,
VkExtensionProperties* pProperties);
uint32_t SpyOverride_vkEnumerateInstanceLayerProperties(
uint32_t* pPropertyCount, VkLayerProperties* pProperties);
uint32_t SpyOverride_vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance);
void SpyOverride_vkDestroyInstance(VkInstance instance,
const VkAllocationCallbacks* pAllocator);
uint32_t SpyOverride_vkCreateDevice(VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDevice* pDevice);
void SpyOverride_vkDestroyDevice(VkDevice device,
const VkAllocationCallbacks* pAllocator);
uint32_t SpyOverride_vkEnumerateDeviceLayerProperties(
VkPhysicalDevice dev, uint32_t* pCount, VkLayerProperties* pProperties);
uint32_t SpyOverride_vkEnumerateDeviceExtensionProperties(
VkPhysicalDevice dev, const char* pLayerName, uint32_t* pCount,
VkExtensionProperties* pProperties);
void SpyOverride_vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex,
uint32_t queueIndex, VkQueue* pQueue);
uint32_t SpyOverride_vkAllocateCommandBuffers(
VkDevice device, VkCommandBufferAllocateInfo* pAllocateInfo,
VkCommandBuffer* pCommandBuffers);
uint32_t SpyOverride_vkCreateBuffer(VkDevice device,
const VkBufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBuffer* pBuffer);
uint32_t SpyOverride_vkCreateImage(VkDevice device,
const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImage* pBuffer);
uint32_t SpyOverride_vkAllocateMemory(VkDevice device,
const VkMemoryAllocateInfo* pAllocateInfo,
const VkAllocationCallbacks* pAllocator,
VkDeviceMemory* pMemory);
uint32_t SpyOverride_vkCreateSwapchainKHR(VkDevice device,
const VkSwapchainCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSwapchainKHR* pImage);
uint32_t SpyOverride_vkDebugMarkerSetObjectTagEXT(
VkDevice device, VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
return VkResult::VK_SUCCESS;
}
uint32_t SpyOverride_RecreateDebugMarkerSetObjectTagEXT(
VkDevice device, VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
return VkResult::VK_SUCCESS;
}
uint32_t SpyOverride_vkDebugMarkerSetObjectNameEXT(
VkDevice device, VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
return VkResult::VK_SUCCESS;
}
void SpyOverride_vkCmdDebugMarkerBeginEXT(
VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {}
void SpyOverride_vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) {}
void SpyOverride_vkCmdDebugMarkerInsertEXT(
VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {}
static uint32_t CreateImageAndGetMemoryRequirements(VkDevice,
const VkImageCreateInfo*,
const VkAllocationCallbacks*,
VkImage*);
static uint32_t CreateBufferAndGetMemoryRequirements(VkDevice,
const VkBufferCreateInfo*,
const VkAllocationCallbacks*,
VkBuffer*);
static uint32_t EnumeratePhysicalDevicesAndCacheProperties(
VkInstance, uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice* pPhysicalDevices);
bool m_coherent_memory_tracking_enabled = false;
void SpyOverride_cacheImageSparseMemoryRequirements(
VkDevice device, VkImage image, uint32_t count,
VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
void prepareGPUBuffers(
CallObserver* observer, PackEncoder* group,
std::unordered_set<uint32_t>* gpu_pools);