blob: 0b61a3be69b15eb1d8cc84cc0ebb02ad81fdaa33 [file] [log] [blame]
/*
* 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 vkCreateAndroidSurfaceKHR(VkInstance instance, VkAndroidSurfaceCreateInfoKHR* pCreateInfo, VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
Spy* s = Spy::get();
GAPID_DEBUG("vkCreateAndroidSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return 0;
}
CallObserver observer(s);
s->lock(&observer, "vkCreateAndroidSurfaceKHR");
auto _result_ = s->vkCreateAndroidSurfaceKHR(&observer, instance, pCreateInfo, pAllocator, pSurface);
s->unlock();
s->VulkanSpy::exit();
return _result_;
}
VKAPI_ATTR uint32_t VKAPI_CALL vkCreateXlibSurfaceKHR(VkInstance instance, VkXlibSurfaceCreateInfoKHR* pCreateInfo, VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
Spy* s = Spy::get();
GAPID_DEBUG("vkCreateXlibSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return 0;
}
CallObserver observer(s);
s->lock(&observer, "vkCreateXlibSurfaceKHR");
auto _result_ = s->vkCreateXlibSurfaceKHR(&observer, instance, pCreateInfo, pAllocator, pSurface);
s->unlock();
s->VulkanSpy::exit();
return _result_;
}
VKAPI_ATTR uint32_t VKAPI_CALL vkCreateXcbSurfaceKHR(VkInstance instance, VkXcbSurfaceCreateInfoKHR* pCreateInfo, VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
Spy* s = Spy::get();
GAPID_DEBUG("vkCreateXcbSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return 0;
}
CallObserver observer(s);
s->lock(&observer, "vkCreateXcbSurfaceKHR");
auto _result_ = s->vkCreateXcbSurfaceKHR(&observer, instance, pCreateInfo, pAllocator, pSurface);
s->unlock();
s->VulkanSpy::exit();
return _result_;
}
VKAPI_ATTR uint32_t VKAPI_CALL vkCreateWaylandSurfaceKHR(VkInstance instance, VkWaylandSurfaceCreateInfoKHR* pCreateInfo, VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
Spy* s = Spy::get();
GAPID_DEBUG("vkCreateWaylandSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return 0;
}
CallObserver observer(s);
s->lock(&observer, "vkCreateWaylandSurfaceKHR");
auto _result_ = s->vkCreateWaylandSurfaceKHR(&observer, instance, pCreateInfo, pAllocator, pSurface);
s->unlock();
s->VulkanSpy::exit();
return _result_;
}
VKAPI_ATTR uint32_t VKAPI_CALL vkCreateMirSurfaceKHR(VkInstance instance, VkMirSurfaceCreateInfoKHR* pCreateInfo, VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
Spy* s = Spy::get();
GAPID_DEBUG("vkCreateMirSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return 0;
}
CallObserver observer(s);
s->lock(&observer, "vkCreateMirSurfaceKHR");
auto _result_ = s->vkCreateMirSurfaceKHR(&observer, instance, pCreateInfo, pAllocator, pSurface);
s->unlock();
s->VulkanSpy::exit();
return _result_;
}
VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, VkAllocationCallbacks* pAllocator) {
Spy* s = Spy::get();
GAPID_DEBUG("vkDestroyInstance(%zu, %p)", instance, pAllocator);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return ;
}
CallObserver observer(s);
s->lock(&observer, "vkDestroyInstance");
s->vkDestroyInstance(&observer, instance, pAllocator);
s->unlock();
s->VulkanSpy::exit();
}
VKAPI_ATTR uint32_t VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) {
Spy* s = Spy::get();
GAPID_DEBUG("vkEnumeratePhysicalDevices(%zu, %p, %p)", instance, pPhysicalDeviceCount, pPhysicalDevices);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return 0;
}
CallObserver observer(s);
s->lock(&observer, "vkEnumeratePhysicalDevices");
auto _result_ = s->vkEnumeratePhysicalDevices(&observer, instance, pPhysicalDeviceCount, pPhysicalDevices);
s->unlock();
s->VulkanSpy::exit();
return _result_;
}
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char* pName) {
Spy* s = Spy::get();
GAPID_DEBUG("vkGetInstanceProcAddr(%zu, %s)", instance, pName);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return nullptr;
}
CallObserver observer(s);
s->lock(&observer, "vkGetInstanceProcAddr");
auto _result_ = s->vkGetInstanceProcAddr(&observer, instance, pName);
s->unlock();
s->VulkanSpy::exit();
return _result_;
}
VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, VkAllocationCallbacks* pAllocator) {
Spy* s = Spy::get();
GAPID_DEBUG("vkDestroySurfaceKHR(%zu, %" PRIu64 ", %p)", instance, surface, pAllocator);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return ;
}
CallObserver observer(s);
s->lock(&observer, "vkDestroySurfaceKHR");
s->vkDestroySurfaceKHR(&observer, instance, surface, pAllocator);
s->unlock();
s->VulkanSpy::exit();
}
VKAPI_ATTR uint32_t VKAPI_CALL vkCreateDisplayPlaneSurfaceKHR(VkInstance instance, VkDisplaySurfaceCreateInfoKHR* pCreateInfo, VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
Spy* s = Spy::get();
GAPID_DEBUG("vkCreateDisplayPlaneSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return 0;
}
CallObserver observer(s);
s->lock(&observer, "vkCreateDisplayPlaneSurfaceKHR");
auto _result_ = s->vkCreateDisplayPlaneSurfaceKHR(&observer, instance, pCreateInfo, pAllocator, pSurface);
s->unlock();
s->VulkanSpy::exit();
return _result_;
}
VKAPI_ATTR uint32_t VKAPI_CALL vkCreateDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackCreateInfoEXT* pCreateInfo, VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) {
Spy* s = Spy::get();
GAPID_DEBUG("vkCreateDebugReportCallbackEXT(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pCallback);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return 0;
}
CallObserver observer(s);
s->lock(&observer, "vkCreateDebugReportCallbackEXT");
auto _result_ = s->vkCreateDebugReportCallbackEXT(&observer, instance, pCreateInfo, pAllocator, pCallback);
s->unlock();
s->VulkanSpy::exit();
return _result_;
}
VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, VkAllocationCallbacks* pAllocator) {
Spy* s = Spy::get();
GAPID_DEBUG("vkDestroyDebugReportCallbackEXT(%zu, %" PRIu64 ", %p)", instance, callback, pAllocator);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return ;
}
CallObserver observer(s);
s->lock(&observer, "vkDestroyDebugReportCallbackEXT");
s->vkDestroyDebugReportCallbackEXT(&observer, instance, callback, pAllocator);
s->unlock();
s->VulkanSpy::exit();
}
VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, uint32_t objectType, uint64_t object, size_val location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage) {
Spy* s = Spy::get();
GAPID_DEBUG("vkDebugReportMessageEXT(%zu, %" PRIu32 ", %u, %" PRIu64 ", %zu, %" PRId32 ", %s, %s)", instance, flags, objectType, object, location, messageCode, pLayerPrefix, pMessage);
if (!s->try_to_enter()) {
GAPID_FATAL("Unexpected re-entrant call to vulkan function");
return ;
}
CallObserver observer(s);
s->lock(&observer, "vkDebugReportMessageEXT");
s->vkDebugReportMessageEXT(&observer, instance, flags, objectType, object, location, messageCode, pLayerPrefix, pMessage);
s->unlock();
s->VulkanSpy::exit();
}
}