| /* |
| * Copyright 2015, The Android Open Source Project |
| * |
| * 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. |
| * |
| * THIS FILE WAS GENERATED BY apic. DO NOT EDIT. |
| */ |
| |
| |
| #include "vulkan_types.h" |
| #include "vulkan_spy.h" |
| #include "vulkan_exports.h" |
| #include "spy.h" |
| |
| #include <gapic/get_vulkan_proc_address.h> |
| #include <gapic/lock.h> |
| #include <gapic/log.h> |
| #include <gapic/target.h> // STDCALL |
| |
| #include <memory> |
| |
| #include <cstring> |
| |
| using namespace gapii; |
| |
| namespace gapii { |
| VKAPI_ATTR uint32_t VKAPI_CALL replayCreateVkInstance(VkInstanceCreateInfo* pCreateInfo, VkAllocationCallbacks* pAllocator, VkInstance* pInstance) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("replayCreateVkInstance(%p, %p, %p)", pCreateInfo, pAllocator, pInstance); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return 0; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "replayCreateVkInstance"); |
| auto _result_ = s->replayCreateVkInstance(&observer, pCreateInfo, pAllocator, pInstance); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| return _result_; |
| } |
| VKAPI_ATTR uint32_t VKAPI_CALL ReplayCreateVkDevice(VkPhysicalDevice physicalDevice, VkDeviceCreateInfo* pCreateInfo, VkAllocationCallbacks* pAllocator, VkDevice* pDevice) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("ReplayCreateVkDevice(%zu, %p, %p, %p)", physicalDevice, pCreateInfo, pAllocator, pDevice); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return 0; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "ReplayCreateVkDevice"); |
| auto _result_ = s->ReplayCreateVkDevice(&observer, physicalDevice, pCreateInfo, pAllocator, pDevice); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| return _result_; |
| } |
| VKAPI_ATTR void VKAPI_CALL replayRegisterVkInstance(VkInstance instance) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("replayRegisterVkInstance(%zu)", instance); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return ; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "replayRegisterVkInstance"); |
| s->replayRegisterVkInstance(&observer, instance); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| } |
| VKAPI_ATTR void VKAPI_CALL replayUnregisterVkInstance(VkInstance instance) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("replayUnregisterVkInstance(%zu)", instance); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return ; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "replayUnregisterVkInstance"); |
| s->replayUnregisterVkInstance(&observer, instance); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| } |
| VKAPI_ATTR void VKAPI_CALL replayRegisterVkDevice(VkPhysicalDevice physicalDevice, VkDevice device, VkDeviceCreateInfo* createInfo) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("replayRegisterVkDevice(%zu, %zu, %p)", physicalDevice, device, createInfo); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return ; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "replayRegisterVkDevice"); |
| s->replayRegisterVkDevice(&observer, physicalDevice, device, createInfo); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| } |
| VKAPI_ATTR void VKAPI_CALL replayUnregisterVkDevice(VkDevice device) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("replayUnregisterVkDevice(%zu)", device); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return ; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "replayUnregisterVkDevice"); |
| s->replayUnregisterVkDevice(&observer, device); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| } |
| VKAPI_ATTR void VKAPI_CALL replayRegisterVkCommandBuffers(VkDevice device, uint32_t count, VkCommandBuffer* commandBuffers) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("replayRegisterVkCommandBuffers(%zu, %" PRIu32 ", %p)", device, count, commandBuffers); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return ; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "replayRegisterVkCommandBuffers"); |
| s->replayRegisterVkCommandBuffers(&observer, device, count, commandBuffers); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| } |
| VKAPI_ATTR void VKAPI_CALL replayUnregisterVkCommandBuffers(uint32_t count, VkCommandBuffer* commandBuffers) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("replayUnregisterVkCommandBuffers(%" PRIu32 ", %p)", count, commandBuffers); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return ; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "replayUnregisterVkCommandBuffers"); |
| s->replayUnregisterVkCommandBuffers(&observer, count, commandBuffers); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| } |
| VKAPI_ATTR void VKAPI_CALL toggleVirtualSwapchainReturnAcquiredImage(VkSwapchainKHR* pSwapchain) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("toggleVirtualSwapchainReturnAcquiredImage(%p)", pSwapchain); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return ; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "toggleVirtualSwapchainReturnAcquiredImage"); |
| s->toggleVirtualSwapchainReturnAcquiredImage(&observer, pSwapchain); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| } |
| VKAPI_ATTR uint32_t VKAPI_CALL replayGetFenceStatus(VkDevice device, VkFence fence, uint32_t expected) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("replayGetFenceStatus(%zu, %" PRIu64 ", %u)", device, fence, expected); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return 0; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "replayGetFenceStatus"); |
| auto _result_ = s->replayGetFenceStatus(&observer, device, fence, expected); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| return _result_; |
| } |
| VKAPI_ATTR uint32_t VKAPI_CALL replayAllocateImageMemory(VkDevice device, VkPhysicalDeviceMemoryProperties* pPhysicalDeviceMemoryProperties, VkImage image, VkDeviceMemory* pMemory) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("replayAllocateImageMemory(%zu, %p, %" PRIu64 ", %p)", device, pPhysicalDeviceMemoryProperties, image, pMemory); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return 0; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "replayAllocateImageMemory"); |
| auto _result_ = s->replayAllocateImageMemory(&observer, device, pPhysicalDeviceMemoryProperties, image, pMemory); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| return _result_; |
| } |
| VKAPI_ATTR uint32_t VKAPI_CALL vkCreateInstance(VkInstanceCreateInfo* pCreateInfo, VkAllocationCallbacks* pAllocator, VkInstance* pInstance) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("vkCreateInstance(%p, %p, %p)", pCreateInfo, pAllocator, pInstance); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return 0; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "vkCreateInstance"); |
| auto _result_ = s->vkCreateInstance(&observer, pCreateInfo, pAllocator, pInstance); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| return _result_; |
| } |
| VKAPI_ATTR uint32_t VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("vkEnumerateInstanceExtensionProperties(%s, %p, %p)", pLayerName, pPropertyCount, pProperties); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return 0; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "vkEnumerateInstanceExtensionProperties"); |
| auto _result_ = s->vkEnumerateInstanceExtensionProperties(&observer, pLayerName, pPropertyCount, pProperties); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| return _result_; |
| } |
| VKAPI_ATTR uint32_t VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t* pPropertyCount, VkLayerProperties* pProperties) { |
| Spy* s = Spy::get(); |
| GAPID_DEBUG("vkEnumerateInstanceLayerProperties(%p, %p)", pPropertyCount, pProperties); |
| if (!s->try_to_enter()) { |
| GAPID_FATAL("Unexpected re-entrant call to vulkan function"); |
| return 0; |
| } |
| CallObserver observer(s); |
| s->lock(&observer, "vkEnumerateInstanceLayerProperties"); |
| auto _result_ = s->vkEnumerateInstanceLayerProperties(&observer, pPropertyCount, pProperties); |
| s->unlock(); |
| s->VulkanSpy::exit(); |
| return _result_; |
| } |
| } |