Skip to content

Commit f571324

Browse files
committed
More log-wrapped functions
1 parent 8ad37e8 commit f571324

File tree

2 files changed

+27
-47
lines changed

2 files changed

+27
-47
lines changed

src/vulkan/wrapper/wrapper_device.c

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ wrapper_create_device_queue(struct wrapper_device *device,
185185
return VK_SUCCESS;
186186
}
187187

188-
VKAPI_ATTR VkResult VKAPI_CALL
189-
wrapper_CreateDevice(VkPhysicalDevice physicalDevice,
188+
WRAPPER_CreateDevice(VkPhysicalDevice physicalDevice,
190189
const VkDeviceCreateInfo* pCreateInfo,
191190
const VkAllocationCallbacks* pAllocator,
192191
VkDevice* pDevice)
@@ -393,14 +392,12 @@ wrapper_CreateDevice(VkPhysicalDevice physicalDevice,
393392
return VK_SUCCESS;
394393
}
395394

396-
VKAPI_ATTR void VKAPI_CALL
397-
wrapper_GetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex,
395+
WRAPPER_GetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex,
398396
uint32_t queueIndex, VkQueue* pQueue) {
399397
vk_common_GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
400398
}
401399

402-
VKAPI_ATTR void VKAPI_CALL
403-
wrapper_GetDeviceQueue2(VkDevice _device, const VkDeviceQueueInfo2* pQueueInfo,
400+
WRAPPER_GetDeviceQueue2(VkDevice _device, const VkDeviceQueueInfo2* pQueueInfo,
404401
VkQueue* pQueue) {
405402
VK_FROM_HANDLE(vk_device, device, _device);
406403

@@ -417,21 +414,18 @@ wrapper_GetDeviceQueue2(VkDevice _device, const VkDeviceQueueInfo2* pQueueInfo,
417414
*pQueue = queue ? vk_queue_to_handle(queue) : VK_NULL_HANDLE;
418415
}
419416

420-
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
421-
wrapper_GetDeviceProcAddr(VkDevice _device, const char* pName) {
417+
WRAPPER_GetDeviceProcAddr(VkDevice _device, const char* pName) {
422418
VK_FROM_HANDLE(wrapper_device, device, _device);
423419
return vk_device_get_proc_addr(&device->vk, pName);
424420
}
425421

426-
VKAPI_ATTR VkResult VKAPI_CALL
427-
wrapper_QueueSubmit(VkQueue _queue, uint32_t submitCount,
422+
WRAPPER_QueueSubmit(VkQueue _queue, uint32_t submitCount,
428423
const VkSubmitInfo* pSubmits, VkFence fence)
429424
{
430425
return CHECK(QueueSubmit(_queue, submitCount, pSubmits, fence));
431426
}
432427

433-
VKAPI_ATTR VkResult VKAPI_CALL
434-
wrapper_QueueSubmit2(VkQueue _queue, uint32_t submitCount,
428+
WRAPPER_QueueSubmit2(VkQueue _queue, uint32_t submitCount,
435429
const VkSubmitInfo2* pSubmits, VkFence fence)
436430
{
437431
#ifdef WRAPPER_DEBUG
@@ -457,8 +451,7 @@ wrapper_QueueSubmit2(VkQueue _queue, uint32_t submitCount,
457451
return result;
458452
}
459453

460-
VKAPI_ATTR void VKAPI_CALL
461-
wrapper_CmdExecuteCommands(VkCommandBuffer commandBuffer,
454+
WRAPPER_CmdExecuteCommands(VkCommandBuffer commandBuffer,
462455
uint32_t commandBufferCount,
463456
const VkCommandBuffer* pCommandBuffers)
464457
{
@@ -511,8 +504,7 @@ wrapper_command_buffer_destroy(struct wrapper_device *device,
511504
}
512505

513506

514-
VKAPI_ATTR VkResult VKAPI_CALL
515-
wrapper_AllocateCommandBuffers(VkDevice _device,
507+
WRAPPER_AllocateCommandBuffers(VkDevice _device,
516508
const VkCommandBufferAllocateInfo* pAllocateInfo,
517509
VkCommandBuffer* pCommandBuffers)
518510
{
@@ -559,8 +551,7 @@ wrapper_AllocateCommandBuffers(VkDevice _device,
559551
return result;
560552
}
561553

562-
VKAPI_ATTR void VKAPI_CALL
563-
wrapper_FreeCommandBuffers(VkDevice _device,
554+
WRAPPER_FreeCommandBuffers(VkDevice _device,
564555
VkCommandPool commandPool,
565556
uint32_t commandBufferCount,
566557
const VkCommandBuffer* pCommandBuffers)
@@ -587,8 +578,7 @@ wrapper_FreeCommandBuffers(VkDevice _device,
587578
CHECKV(FreeCommandBuffers(_device, commandPool, commandBufferCount, dispatch_handles));
588579
}
589580

590-
VKAPI_ATTR VkResult VKAPI_CALL
591-
wrapper_CreateCommandPool(VkDevice device,
581+
WRAPPER_CreateCommandPool(VkDevice device,
592582
const VkCommandPoolCreateInfo* pCreateInfo,
593583
const VkAllocationCallbacks* pAllocator,
594584
VkCommandPool* pCommandPool) {
@@ -599,8 +589,7 @@ wrapper_CreateCommandPool(VkDevice device,
599589
return result;
600590
}
601591

602-
VKAPI_ATTR void VKAPI_CALL
603-
wrapper_DestroyCommandPool(VkDevice _device, VkCommandPool commandPool,
592+
WRAPPER_DestroyCommandPool(VkDevice _device, VkCommandPool commandPool,
604593
const VkAllocationCallbacks* pAllocator)
605594
{
606595
VK_FROM_HANDLE(wrapper_device, device, _device);
@@ -624,8 +613,7 @@ wrapper_DestroyCommandPool(VkDevice _device, VkCommandPool commandPool,
624613
CHECKV(DestroyCommandPool(_device, commandPool, pAllocator));
625614
}
626615

627-
VKAPI_ATTR void VKAPI_CALL
628-
wrapper_DestroyDevice(VkDevice _device, const VkAllocationCallbacks* pAllocator)
616+
WRAPPER_DestroyDevice(VkDevice _device, const VkAllocationCallbacks* pAllocator)
629617
{
630618
VK_FROM_HANDLE(wrapper_device, device, _device);
631619

@@ -689,8 +677,7 @@ unwrap_device_object(VkObjectType objectType,
689677
}
690678
}
691679

692-
VKAPI_ATTR VkResult VKAPI_CALL
693-
wrapper_SetPrivateData(VkDevice _device, VkObjectType objectType,
680+
WRAPPER_SetPrivateData(VkDevice _device, VkObjectType objectType,
694681
uint64_t objectHandle,
695682
VkPrivateDataSlot privateDataSlot,
696683
uint64_t data) {
@@ -699,8 +686,7 @@ wrapper_SetPrivateData(VkDevice _device, VkObjectType objectType,
699686
objectType, object_handle, privateDataSlot, data));
700687
}
701688

702-
VKAPI_ATTR void VKAPI_CALL
703-
wrapper_GetPrivateData(VkDevice _device, VkObjectType objectType,
689+
WRAPPER_GetPrivateData(VkDevice _device, VkObjectType objectType,
704690
uint64_t objectHandle,
705691
VkPrivateDataSlot privateDataSlot,
706692
uint64_t* pData) {
@@ -759,8 +745,7 @@ static void free_temp_pool_from_buffer(VkDevice device, struct wrapper_buffer* w
759745
}
760746
}
761747

762-
VKAPI_ATTR VkResult VKAPI_CALL
763-
wrapper_CreateBuffer(
748+
WRAPPER_CreateBuffer(
764749
VkDevice device,
765750
const VkBufferCreateInfo* pCreateInfo,
766751
const VkAllocationCallbacks* pAllocator,
@@ -780,8 +765,7 @@ wrapper_CreateBuffer(
780765
return result;
781766
}
782767

783-
VKAPI_ATTR void VKAPI_CALL
784-
wrapper_DestroyBuffer(VkDevice device,
768+
WRAPPER_DestroyBuffer(VkDevice device,
785769
VkBuffer buffer,
786770
const VkAllocationCallbacks* pAllocator)
787771
{
@@ -805,8 +789,7 @@ wrapper_DestroyBuffer(VkDevice device,
805789
wrapper_buffer_destroy(_device, wbuf);
806790
}
807791

808-
VKAPI_ATTR VkResult VKAPI_CALL
809-
wrapper_BindBufferMemory(VkDevice device,
792+
WRAPPER_BindBufferMemory(VkDevice device,
810793
VkBuffer buffer,
811794
VkDeviceMemory memory,
812795
VkDeviceSize memoryOffset) {
@@ -821,8 +804,7 @@ wrapper_BindBufferMemory(VkDevice device,
821804
return WCHECK(BindBufferMemory2(device, 1, &bind));
822805
}
823806

824-
VKAPI_ATTR VkResult VKAPI_CALL
825-
wrapper_BindBufferMemory2(
807+
WRAPPER_BindBufferMemory2(
826808
VkDevice device,
827809
uint32_t bindInfoCount,
828810
const VkBindBufferMemoryInfo* pBindInfos)
@@ -1829,8 +1811,7 @@ static VkResult CreateBcnCommandBuffer(struct wrapper_device* device, struct wra
18291811
return result;
18301812
}
18311813

1832-
VKAPI_ATTR void VKAPI_CALL
1833-
wrapper_CmdCopyBufferToImage(VkCommandBuffer commandBuffer,
1814+
WRAPPER_CmdCopyBufferToImage(VkCommandBuffer commandBuffer,
18341815
VkBuffer srcBuffer,
18351816
VkImage dstImage,
18361817
VkImageLayout dstImageLayout,
@@ -1992,7 +1973,7 @@ wrapper_CmdCopyBufferToImage(VkCommandBuffer commandBuffer,
19921973
}
19931974
}
19941975

1995-
VkResult wrapper_CreateShaderModule(VkDevice device,
1976+
WRAPPER_CreateShaderModule(VkDevice device,
19961977
const VkShaderModuleCreateInfo* pCreateInfo,
19971978
const VkAllocationCallbacks* pAllocator,
19981979
VkShaderModule* pShaderModule) {
@@ -2020,4 +2001,3 @@ VkResult wrapper_CreateShaderModule(VkDevice device,
20202001
newCreateInfo.pCode = lowered.spirv_code;
20212002
return CHECK(CreateShaderModule(device, &newCreateInfo, pAllocator, pShaderModule));
20222003
}
2023-

src/vulkan/wrapper/wrapper_instance.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ static void *get_vulkan_handle_icd()
7676
}
7777
}
7878

79-
static void* icd_handle;
79+
// static void* icd_handle;
8080

8181
static void *get_vulkan_handle()
8282
{
8383
// __log("in get_vulkan_handle");
84-
if (!icd_handle)
85-
icd_handle = get_vulkan_handle_icd();
84+
// if (!icd_handle)
85+
// icd_handle = get_vulkan_handle_icd();
8686
// void* vvl = dlopen("/data/user/0/com.winlator.cmod/files/imagefs/usr/lib/libVkLayer_khronos_validation.so", RTLD_NOW | RTLD_LOCAL);
8787
// __log("Got vvl layer: %p", vvl);
88-
return icd_handle;
88+
return get_vulkan_handle_icd();
8989
}
9090

9191
static bool vulkan_library_init()
@@ -101,13 +101,13 @@ static bool vulkan_library_init()
101101
dispatch_create_instance = dlsym(vulkan_library_handle, "vkCreateInstance");
102102
dispatch_get_instance_proc_addr = dlsym(vulkan_library_handle,
103103
"vkGetInstanceProcAddr");
104-
enumerate_instance_version = dlsym(icd_handle,
104+
enumerate_instance_version = dlsym(vulkan_library_handle,
105105
"vkEnumerateInstanceVersion");
106106
enumerate_instance_extension_properties =
107-
dlsym(icd_handle, "vkEnumerateInstanceExtensionProperties");
107+
dlsym(vulkan_library_handle, "vkEnumerateInstanceExtensionProperties");
108108

109109
_vkEnumerateInstanceLayerProperties =
110-
dlsym(icd_handle, "vkEnumerateInstanceLayerProperties");
110+
dlsym(vulkan_library_handle, "vkEnumerateInstanceLayerProperties");
111111
}
112112
else {
113113
WLOGE("Failed to load vulkan handle: %s", dlerror());

0 commit comments

Comments
 (0)