blob: 4474ab2afb3e80d14c0db313421a268ffbd84aca [file] [log] [blame]
////////////////////////////////////////////////////////////////////////////////
// Automatically generated file. Do not modify!
////////////////////////////////////////////////////////////////////////////////
#include "vulkan_gfx_api.h"
#include "interpreter.h"
#include "stack.h"
#include <gapic/get_vulkan_proc_address.h>
#include <gapic/log.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
namespace gapir {
const char* Vulkan::ID = "Vulkan";
uint8_t Vulkan::INDEX = 2;
Vulkan::Vulkan() {
using namespace std::placeholders;
mFunctions.insert(0, std::bind(&Vulkan::callVkCreateAndroidSurfaceKHR, this, _1, _2));
mFunctions.insert(1, std::bind(&Vulkan::callVkGetSwapchainGrallocUsageANDROID, this, _1, _2));
mFunctions.insert(2, std::bind(&Vulkan::callVkAcquireImageANDROID, this, _1, _2));
mFunctions.insert(3, std::bind(&Vulkan::callVkQueueSignalReleaseImageANDROID, this, _1, _2));
mFunctions.insert(4, std::bind(&Vulkan::callVkCreateXlibSurfaceKHR, this, _1, _2));
mFunctions.insert(5, std::bind(&Vulkan::callVkGetPhysicalDeviceXlibPresentationSupportKHR, this, _1, _2));
mFunctions.insert(6, std::bind(&Vulkan::callVkCreateXcbSurfaceKHR, this, _1, _2));
mFunctions.insert(7, std::bind(&Vulkan::callVkGetPhysicalDeviceXcbPresentationSupportKHR, this, _1, _2));
mFunctions.insert(8, std::bind(&Vulkan::callVkCreateWaylandSurfaceKHR, this, _1, _2));
mFunctions.insert(9, std::bind(&Vulkan::callVkGetPhysicalDeviceWaylandPresentationSupportKHR, this, _1, _2));
mFunctions.insert(10, std::bind(&Vulkan::callVkCreateMirSurfaceKHR, this, _1, _2));
mFunctions.insert(11, std::bind(&Vulkan::callVkGetPhysicalDeviceMirPresentationSupportKHR, this, _1, _2));
mFunctions.insert(29, std::bind(&Vulkan::callVkCreateInstance, this, _1, _2));
mFunctions.insert(30, std::bind(&Vulkan::callVkDestroyInstance, this, _1, _2));
mFunctions.insert(31, std::bind(&Vulkan::callVkEnumeratePhysicalDevices, this, _1, _2));
mFunctions.insert(32, std::bind(&Vulkan::callVkGetPhysicalDeviceFeatures, this, _1, _2));
mFunctions.insert(33, std::bind(&Vulkan::callVkGetPhysicalDeviceFormatProperties, this, _1, _2));
mFunctions.insert(34, std::bind(&Vulkan::callVkGetPhysicalDeviceImageFormatProperties, this, _1, _2));
mFunctions.insert(35, std::bind(&Vulkan::callVkGetPhysicalDeviceProperties, this, _1, _2));
mFunctions.insert(36, std::bind(&Vulkan::callVkGetPhysicalDeviceQueueFamilyProperties, this, _1, _2));
mFunctions.insert(37, std::bind(&Vulkan::callVkGetPhysicalDeviceMemoryProperties, this, _1, _2));
mFunctions.insert(38, std::bind(&Vulkan::callVkGetInstanceProcAddr, this, _1, _2));
mFunctions.insert(39, std::bind(&Vulkan::callVkGetDeviceProcAddr, this, _1, _2));
mFunctions.insert(40, std::bind(&Vulkan::callVkCreateDevice, this, _1, _2));
mFunctions.insert(41, std::bind(&Vulkan::callVkDestroyDevice, this, _1, _2));
mFunctions.insert(42, std::bind(&Vulkan::callVkEnumerateInstanceExtensionProperties, this, _1, _2));
mFunctions.insert(43, std::bind(&Vulkan::callVkEnumerateDeviceExtensionProperties, this, _1, _2));
mFunctions.insert(44, std::bind(&Vulkan::callVkEnumerateInstanceLayerProperties, this, _1, _2));
mFunctions.insert(45, std::bind(&Vulkan::callVkEnumerateDeviceLayerProperties, this, _1, _2));
mFunctions.insert(46, std::bind(&Vulkan::callVkGetDeviceQueue, this, _1, _2));
mFunctions.insert(47, std::bind(&Vulkan::callVkQueueSubmit, this, _1, _2));
mFunctions.insert(48, std::bind(&Vulkan::callVkQueueWaitIdle, this, _1, _2));
mFunctions.insert(49, std::bind(&Vulkan::callVkDeviceWaitIdle, this, _1, _2));
mFunctions.insert(50, std::bind(&Vulkan::callVkAllocateMemory, this, _1, _2));
mFunctions.insert(51, std::bind(&Vulkan::callVkFreeMemory, this, _1, _2));
mFunctions.insert(52, std::bind(&Vulkan::callVkMapMemory, this, _1, _2));
mFunctions.insert(53, std::bind(&Vulkan::callVkUnmapMemory, this, _1, _2));
mFunctions.insert(54, std::bind(&Vulkan::callVkFlushMappedMemoryRanges, this, _1, _2));
mFunctions.insert(55, std::bind(&Vulkan::callVkInvalidateMappedMemoryRanges, this, _1, _2));
mFunctions.insert(56, std::bind(&Vulkan::callVkGetDeviceMemoryCommitment, this, _1, _2));
mFunctions.insert(57, std::bind(&Vulkan::callVkBindBufferMemory, this, _1, _2));
mFunctions.insert(58, std::bind(&Vulkan::callVkBindImageMemory, this, _1, _2));
mFunctions.insert(59, std::bind(&Vulkan::callVkGetBufferMemoryRequirements, this, _1, _2));
mFunctions.insert(60, std::bind(&Vulkan::callVkGetImageMemoryRequirements, this, _1, _2));
mFunctions.insert(61, std::bind(&Vulkan::callVkGetImageSparseMemoryRequirements, this, _1, _2));
mFunctions.insert(62, std::bind(&Vulkan::callVkGetPhysicalDeviceSparseImageFormatProperties, this, _1, _2));
mFunctions.insert(63, std::bind(&Vulkan::callVkQueueBindSparse, this, _1, _2));
mFunctions.insert(64, std::bind(&Vulkan::callVkCreateFence, this, _1, _2));
mFunctions.insert(65, std::bind(&Vulkan::callVkDestroyFence, this, _1, _2));
mFunctions.insert(66, std::bind(&Vulkan::callVkResetFences, this, _1, _2));
mFunctions.insert(67, std::bind(&Vulkan::callVkGetFenceStatus, this, _1, _2));
mFunctions.insert(68, std::bind(&Vulkan::callVkWaitForFences, this, _1, _2));
mFunctions.insert(69, std::bind(&Vulkan::callVkCreateSemaphore, this, _1, _2));
mFunctions.insert(70, std::bind(&Vulkan::callVkDestroySemaphore, this, _1, _2));
mFunctions.insert(71, std::bind(&Vulkan::callVkCreateEvent, this, _1, _2));
mFunctions.insert(72, std::bind(&Vulkan::callVkDestroyEvent, this, _1, _2));
mFunctions.insert(73, std::bind(&Vulkan::callVkGetEventStatus, this, _1, _2));
mFunctions.insert(74, std::bind(&Vulkan::callVkSetEvent, this, _1, _2));
mFunctions.insert(75, std::bind(&Vulkan::callVkResetEvent, this, _1, _2));
mFunctions.insert(76, std::bind(&Vulkan::callVkCreateQueryPool, this, _1, _2));
mFunctions.insert(77, std::bind(&Vulkan::callVkDestroyQueryPool, this, _1, _2));
mFunctions.insert(78, std::bind(&Vulkan::callVkGetQueryPoolResults, this, _1, _2));
mFunctions.insert(79, std::bind(&Vulkan::callVkCreateBuffer, this, _1, _2));
mFunctions.insert(80, std::bind(&Vulkan::callVkDestroyBuffer, this, _1, _2));
mFunctions.insert(81, std::bind(&Vulkan::callVkCreateBufferView, this, _1, _2));
mFunctions.insert(82, std::bind(&Vulkan::callVkDestroyBufferView, this, _1, _2));
mFunctions.insert(83, std::bind(&Vulkan::callVkCreateImage, this, _1, _2));
mFunctions.insert(84, std::bind(&Vulkan::callVkDestroyImage, this, _1, _2));
mFunctions.insert(85, std::bind(&Vulkan::callVkGetImageSubresourceLayout, this, _1, _2));
mFunctions.insert(86, std::bind(&Vulkan::callVkCreateImageView, this, _1, _2));
mFunctions.insert(87, std::bind(&Vulkan::callVkDestroyImageView, this, _1, _2));
mFunctions.insert(88, std::bind(&Vulkan::callVkCreateShaderModule, this, _1, _2));
mFunctions.insert(89, std::bind(&Vulkan::callVkDestroyShaderModule, this, _1, _2));
mFunctions.insert(90, std::bind(&Vulkan::callVkCreatePipelineCache, this, _1, _2));
mFunctions.insert(91, std::bind(&Vulkan::callVkDestroyPipelineCache, this, _1, _2));
mFunctions.insert(92, std::bind(&Vulkan::callVkGetPipelineCacheData, this, _1, _2));
mFunctions.insert(93, std::bind(&Vulkan::callVkMergePipelineCaches, this, _1, _2));
mFunctions.insert(94, std::bind(&Vulkan::callVkCreateGraphicsPipelines, this, _1, _2));
mFunctions.insert(95, std::bind(&Vulkan::callVkCreateComputePipelines, this, _1, _2));
mFunctions.insert(96, std::bind(&Vulkan::callVkDestroyPipeline, this, _1, _2));
mFunctions.insert(97, std::bind(&Vulkan::callVkCreatePipelineLayout, this, _1, _2));
mFunctions.insert(98, std::bind(&Vulkan::callVkDestroyPipelineLayout, this, _1, _2));
mFunctions.insert(99, std::bind(&Vulkan::callVkCreateSampler, this, _1, _2));
mFunctions.insert(100, std::bind(&Vulkan::callVkDestroySampler, this, _1, _2));
mFunctions.insert(101, std::bind(&Vulkan::callVkCreateDescriptorSetLayout, this, _1, _2));
mFunctions.insert(102, std::bind(&Vulkan::callVkDestroyDescriptorSetLayout, this, _1, _2));
mFunctions.insert(103, std::bind(&Vulkan::callVkCreateDescriptorPool, this, _1, _2));
mFunctions.insert(104, std::bind(&Vulkan::callVkDestroyDescriptorPool, this, _1, _2));
mFunctions.insert(105, std::bind(&Vulkan::callVkResetDescriptorPool, this, _1, _2));
mFunctions.insert(106, std::bind(&Vulkan::callVkAllocateDescriptorSets, this, _1, _2));
mFunctions.insert(107, std::bind(&Vulkan::callVkFreeDescriptorSets, this, _1, _2));
mFunctions.insert(108, std::bind(&Vulkan::callVkUpdateDescriptorSets, this, _1, _2));
mFunctions.insert(109, std::bind(&Vulkan::callVkCreateFramebuffer, this, _1, _2));
mFunctions.insert(110, std::bind(&Vulkan::callVkDestroyFramebuffer, this, _1, _2));
mFunctions.insert(111, std::bind(&Vulkan::callVkCreateRenderPass, this, _1, _2));
mFunctions.insert(112, std::bind(&Vulkan::callVkDestroyRenderPass, this, _1, _2));
mFunctions.insert(113, std::bind(&Vulkan::callVkGetRenderAreaGranularity, this, _1, _2));
mFunctions.insert(114, std::bind(&Vulkan::callVkCreateCommandPool, this, _1, _2));
mFunctions.insert(115, std::bind(&Vulkan::callVkDestroyCommandPool, this, _1, _2));
mFunctions.insert(116, std::bind(&Vulkan::callVkResetCommandPool, this, _1, _2));
mFunctions.insert(117, std::bind(&Vulkan::callVkAllocateCommandBuffers, this, _1, _2));
mFunctions.insert(118, std::bind(&Vulkan::callVkFreeCommandBuffers, this, _1, _2));
mFunctions.insert(119, std::bind(&Vulkan::callVkBeginCommandBuffer, this, _1, _2));
mFunctions.insert(120, std::bind(&Vulkan::callVkEndCommandBuffer, this, _1, _2));
mFunctions.insert(121, std::bind(&Vulkan::callVkResetCommandBuffer, this, _1, _2));
mFunctions.insert(122, std::bind(&Vulkan::callVkCmdBindPipeline, this, _1, _2));
mFunctions.insert(123, std::bind(&Vulkan::callVkCmdSetViewport, this, _1, _2));
mFunctions.insert(124, std::bind(&Vulkan::callVkCmdSetScissor, this, _1, _2));
mFunctions.insert(125, std::bind(&Vulkan::callVkCmdSetLineWidth, this, _1, _2));
mFunctions.insert(126, std::bind(&Vulkan::callVkCmdSetDepthBias, this, _1, _2));
mFunctions.insert(127, std::bind(&Vulkan::callVkCmdSetBlendConstants, this, _1, _2));
mFunctions.insert(128, std::bind(&Vulkan::callVkCmdSetDepthBounds, this, _1, _2));
mFunctions.insert(129, std::bind(&Vulkan::callVkCmdSetStencilCompareMask, this, _1, _2));
mFunctions.insert(130, std::bind(&Vulkan::callVkCmdSetStencilWriteMask, this, _1, _2));
mFunctions.insert(131, std::bind(&Vulkan::callVkCmdSetStencilReference, this, _1, _2));
mFunctions.insert(132, std::bind(&Vulkan::callVkCmdBindDescriptorSets, this, _1, _2));
mFunctions.insert(133, std::bind(&Vulkan::callVkCmdBindIndexBuffer, this, _1, _2));
mFunctions.insert(134, std::bind(&Vulkan::callVkCmdBindVertexBuffers, this, _1, _2));
mFunctions.insert(135, std::bind(&Vulkan::callVkCmdDraw, this, _1, _2));
mFunctions.insert(136, std::bind(&Vulkan::callVkCmdDrawIndexed, this, _1, _2));
mFunctions.insert(137, std::bind(&Vulkan::callVkCmdDrawIndirect, this, _1, _2));
mFunctions.insert(138, std::bind(&Vulkan::callVkCmdDrawIndexedIndirect, this, _1, _2));
mFunctions.insert(139, std::bind(&Vulkan::callVkCmdDispatch, this, _1, _2));
mFunctions.insert(140, std::bind(&Vulkan::callVkCmdDispatchIndirect, this, _1, _2));
mFunctions.insert(141, std::bind(&Vulkan::callVkCmdCopyBuffer, this, _1, _2));
mFunctions.insert(142, std::bind(&Vulkan::callVkCmdCopyImage, this, _1, _2));
mFunctions.insert(143, std::bind(&Vulkan::callVkCmdBlitImage, this, _1, _2));
mFunctions.insert(144, std::bind(&Vulkan::callVkCmdCopyBufferToImage, this, _1, _2));
mFunctions.insert(145, std::bind(&Vulkan::callVkCmdCopyImageToBuffer, this, _1, _2));
mFunctions.insert(146, std::bind(&Vulkan::callVkCmdUpdateBuffer, this, _1, _2));
mFunctions.insert(147, std::bind(&Vulkan::callVkCmdFillBuffer, this, _1, _2));
mFunctions.insert(148, std::bind(&Vulkan::callVkCmdClearColorImage, this, _1, _2));
mFunctions.insert(149, std::bind(&Vulkan::callVkCmdClearDepthStencilImage, this, _1, _2));
mFunctions.insert(150, std::bind(&Vulkan::callVkCmdClearAttachments, this, _1, _2));
mFunctions.insert(151, std::bind(&Vulkan::callVkCmdResolveImage, this, _1, _2));
mFunctions.insert(152, std::bind(&Vulkan::callVkCmdSetEvent, this, _1, _2));
mFunctions.insert(153, std::bind(&Vulkan::callVkCmdResetEvent, this, _1, _2));
mFunctions.insert(154, std::bind(&Vulkan::callVkCmdWaitEvents, this, _1, _2));
mFunctions.insert(155, std::bind(&Vulkan::callVkCmdPipelineBarrier, this, _1, _2));
mFunctions.insert(156, std::bind(&Vulkan::callVkCmdBeginQuery, this, _1, _2));
mFunctions.insert(157, std::bind(&Vulkan::callVkCmdEndQuery, this, _1, _2));
mFunctions.insert(158, std::bind(&Vulkan::callVkCmdResetQueryPool, this, _1, _2));
mFunctions.insert(159, std::bind(&Vulkan::callVkCmdWriteTimestamp, this, _1, _2));
mFunctions.insert(160, std::bind(&Vulkan::callVkCmdCopyQueryPoolResults, this, _1, _2));
mFunctions.insert(161, std::bind(&Vulkan::callVkCmdPushConstants, this, _1, _2));
mFunctions.insert(162, std::bind(&Vulkan::callVkCmdBeginRenderPass, this, _1, _2));
mFunctions.insert(163, std::bind(&Vulkan::callVkCmdNextSubpass, this, _1, _2));
mFunctions.insert(164, std::bind(&Vulkan::callVkCmdEndRenderPass, this, _1, _2));
mFunctions.insert(165, std::bind(&Vulkan::callVkCmdExecuteCommands, this, _1, _2));
mFunctions.insert(166, std::bind(&Vulkan::callVkDestroySurfaceKHR, this, _1, _2));
mFunctions.insert(167, std::bind(&Vulkan::callVkGetPhysicalDeviceSurfaceSupportKHR, this, _1, _2));
mFunctions.insert(168, std::bind(&Vulkan::callVkGetPhysicalDeviceSurfaceCapabilitiesKHR, this, _1, _2));
mFunctions.insert(169, std::bind(&Vulkan::callVkGetPhysicalDeviceSurfaceFormatsKHR, this, _1, _2));
mFunctions.insert(170, std::bind(&Vulkan::callVkGetPhysicalDeviceSurfacePresentModesKHR, this, _1, _2));
mFunctions.insert(171, std::bind(&Vulkan::callVkCreateSwapchainKHR, this, _1, _2));
mFunctions.insert(172, std::bind(&Vulkan::callVkDestroySwapchainKHR, this, _1, _2));
mFunctions.insert(173, std::bind(&Vulkan::callVkGetSwapchainImagesKHR, this, _1, _2));
mFunctions.insert(174, std::bind(&Vulkan::callVkAcquireNextImageKHR, this, _1, _2));
mFunctions.insert(175, std::bind(&Vulkan::callVkQueuePresentKHR, this, _1, _2));
mFunctions.insert(176, std::bind(&Vulkan::callVkGetPhysicalDeviceDisplayPropertiesKHR, this, _1, _2));
mFunctions.insert(177, std::bind(&Vulkan::callVkGetPhysicalDeviceDisplayPlanePropertiesKHR, this, _1, _2));
mFunctions.insert(178, std::bind(&Vulkan::callVkGetDisplayPlaneSupportedDisplaysKHR, this, _1, _2));
mFunctions.insert(179, std::bind(&Vulkan::callVkGetDisplayModePropertiesKHR, this, _1, _2));
mFunctions.insert(180, std::bind(&Vulkan::callVkCreateDisplayModeKHR, this, _1, _2));
mFunctions.insert(181, std::bind(&Vulkan::callVkGetDisplayPlaneCapabilitiesKHR, this, _1, _2));
mFunctions.insert(182, std::bind(&Vulkan::callVkCreateDisplayPlaneSurfaceKHR, this, _1, _2));
mFunctions.insert(183, std::bind(&Vulkan::callVkCreateSharedSwapchainsKHR, this, _1, _2));
mFunctions.insert(185, std::bind(&Vulkan::callVkCreateDebugReportCallbackEXT, this, _1, _2));
mFunctions.insert(186, std::bind(&Vulkan::callVkDestroyDebugReportCallbackEXT, this, _1, _2));
mFunctions.insert(187, std::bind(&Vulkan::callVkDebugReportMessageEXT, this, _1, _2));
}
void Vulkan::resolve() {
mFunctionStubs.vkCreateInstance = reinterpret_cast<PFNVKCREATEINSTANCE>(gapic::GetVulkanProcAddress("vkCreateInstance", false));
mFunctionStubs.vkEnumerateInstanceExtensionProperties = reinterpret_cast<PFNVKENUMERATEINSTANCEEXTENSIONPROPERTIES>(gapic::GetVulkanProcAddress("vkEnumerateInstanceExtensionProperties", false));
mFunctionStubs.vkEnumerateInstanceLayerProperties = reinterpret_cast<PFNVKENUMERATEINSTANCELAYERPROPERTIES>(gapic::GetVulkanProcAddress("vkEnumerateInstanceLayerProperties", false));
}
const char* Vulkan::id() const {
return ID;
}
uint8_t Vulkan::index() const {
return INDEX;
}
bool Vulkan::callVkCreateAndroidSurfaceKHR(Stack* stack, bool pushReturn) {
auto pSurface = stack->pop<VkSurfaceKHR*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkAndroidSurfaceCreateInfoKHR*>();
auto instance = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateAndroidSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (mVkInstanceFunctionStubs.find(instance) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[instance].vkCreateAndroidSurfaceKHR) {
VkResult return_value = mVkInstanceFunctionStubs[instance].vkCreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateAndroidSurfaceKHR");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateAndroidSurfaceKHR");
return false;
}
}
bool Vulkan::callVkGetSwapchainGrallocUsageANDROID(Stack* stack, bool pushReturn) {
auto grallocUsage = stack->pop<int*>();
auto imageUsage = stack->pop<uint32_t>();
auto format = stack->pop<VkFormat>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetSwapchainGrallocUsageANDROID(%zu, %u, %" PRIu32 ", %p)", device, format, imageUsage, grallocUsage);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetSwapchainGrallocUsageANDROID) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkGetSwapchainGrallocUsageANDROID(device, format, imageUsage, grallocUsage);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetSwapchainGrallocUsageANDROID");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetSwapchainGrallocUsageANDROID");
return false;
}
}
bool Vulkan::callVkAcquireImageANDROID(Stack* stack, bool pushReturn) {
auto fence = stack->pop<uint64_t>();
auto semaphore = stack->pop<uint64_t>();
auto nativeFenceFd = stack->pop<int>();
auto image = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkAcquireImageANDROID(%zu, %" PRIu64 ", %d, %" PRIu64 ", %" PRIu64 ")", device, image, nativeFenceFd, semaphore, fence);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkAcquireImageANDROID) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkAcquireImageANDROID(device, image, nativeFenceFd, semaphore, fence);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkAcquireImageANDROID");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkAcquireImageANDROID");
return false;
}
}
bool Vulkan::callVkQueueSignalReleaseImageANDROID(Stack* stack, bool pushReturn) {
auto pNativeFenceFd = stack->pop<int*>();
auto image = stack->pop<uint64_t>();
auto pWaitSemaphores = stack->pop<VkSemaphore*>();
auto waitSemaphoreCount = stack->pop<uint32_t>();
auto queue = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkQueueSignalReleaseImageANDROID(%zu, %" PRIu32 ", %p, %" PRIu64 ", %p)", queue, waitSemaphoreCount, pWaitSemaphores, image, pNativeFenceFd);
if (mIndirectMaps.VkQueuesToVkDevices.find(queue) != mIndirectMaps.VkQueuesToVkDevices.end() &&
mVkDeviceFunctionStubs.find(mIndirectMaps.VkQueuesToVkDevices[queue]) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[mIndirectMaps.VkQueuesToVkDevices[queue]].vkQueueSignalReleaseImageANDROID) {
VkResult return_value = mVkDeviceFunctionStubs[mIndirectMaps.VkQueuesToVkDevices[queue]].vkQueueSignalReleaseImageANDROID(queue, waitSemaphoreCount, pWaitSemaphores, image, pNativeFenceFd);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkQueueSignalReleaseImageANDROID");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkQueueSignalReleaseImageANDROID");
return false;
}
}
bool Vulkan::callVkCreateXlibSurfaceKHR(Stack* stack, bool pushReturn) {
auto pSurface = stack->pop<VkSurfaceKHR*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkXlibSurfaceCreateInfoKHR*>();
auto instance = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateXlibSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (mVkInstanceFunctionStubs.find(instance) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[instance].vkCreateXlibSurfaceKHR) {
VkResult return_value = mVkInstanceFunctionStubs[instance].vkCreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateXlibSurfaceKHR");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateXlibSurfaceKHR");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceXlibPresentationSupportKHR(Stack* stack, bool pushReturn) {
auto visualID = static_cast<size_val>(stack->pop<size_val>());
auto dpy = stack->pop<Display*>();
auto queueFamilyIndex = stack->pop<uint32_t>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceXlibPresentationSupportKHR(%zu, %" PRIu32 ", %p, %zu)", physicalDevice, queueFamilyIndex, dpy, visualID);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceXlibPresentationSupportKHR) {
VkBool32 return_value = mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy, visualID);
GAPID_INFO("Returned: %" PRIu32 "", return_value);
if (pushReturn) {
stack->push<VkBool32>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceXlibPresentationSupportKHR");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceXlibPresentationSupportKHR");
return false;
}
}
bool Vulkan::callVkCreateXcbSurfaceKHR(Stack* stack, bool pushReturn) {
auto pSurface = stack->pop<VkSurfaceKHR*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkXcbSurfaceCreateInfoKHR*>();
auto instance = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateXcbSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (mVkInstanceFunctionStubs.find(instance) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[instance].vkCreateXcbSurfaceKHR) {
VkResult return_value = mVkInstanceFunctionStubs[instance].vkCreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateXcbSurfaceKHR");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateXcbSurfaceKHR");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceXcbPresentationSupportKHR(Stack* stack, bool pushReturn) {
auto visual_id = stack->pop<uint32_t>();
auto connection = stack->pop<xcb_connection_t*>();
auto queueFamilyIndex = stack->pop<uint32_t>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceXcbPresentationSupportKHR(%zu, %" PRIu32 ", %p, %" PRIu32 ")", physicalDevice, queueFamilyIndex, connection, visual_id);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceXcbPresentationSupportKHR) {
VkBool32 return_value = mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection, visual_id);
GAPID_INFO("Returned: %" PRIu32 "", return_value);
if (pushReturn) {
stack->push<VkBool32>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceXcbPresentationSupportKHR");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceXcbPresentationSupportKHR");
return false;
}
}
bool Vulkan::callVkCreateWaylandSurfaceKHR(Stack* stack, bool pushReturn) {
auto pSurface = stack->pop<VkSurfaceKHR*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkWaylandSurfaceCreateInfoKHR*>();
auto instance = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateWaylandSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (mVkInstanceFunctionStubs.find(instance) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[instance].vkCreateWaylandSurfaceKHR) {
VkResult return_value = mVkInstanceFunctionStubs[instance].vkCreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateWaylandSurfaceKHR");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateWaylandSurfaceKHR");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceWaylandPresentationSupportKHR(Stack* stack, bool pushReturn) {
auto display = stack->pop<wl_display*>();
auto queueFamilyIndex = stack->pop<uint32_t>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceWaylandPresentationSupportKHR(%zu, %" PRIu32 ", %p)", physicalDevice, queueFamilyIndex, display);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceWaylandPresentationSupportKHR) {
VkBool32 return_value = mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, display);
GAPID_INFO("Returned: %" PRIu32 "", return_value);
if (pushReturn) {
stack->push<VkBool32>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceWaylandPresentationSupportKHR");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceWaylandPresentationSupportKHR");
return false;
}
}
bool Vulkan::callVkCreateMirSurfaceKHR(Stack* stack, bool pushReturn) {
auto pSurface = stack->pop<VkSurfaceKHR*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkMirSurfaceCreateInfoKHR*>();
auto instance = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateMirSurfaceKHR(%zu, %p, %p, %p)", instance, pCreateInfo, pAllocator, pSurface);
if (mVkInstanceFunctionStubs.find(instance) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[instance].vkCreateMirSurfaceKHR) {
VkResult return_value = mVkInstanceFunctionStubs[instance].vkCreateMirSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateMirSurfaceKHR");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateMirSurfaceKHR");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceMirPresentationSupportKHR(Stack* stack, bool pushReturn) {
auto connection = stack->pop<MirConnection*>();
auto queueFamilyIndex = stack->pop<uint32_t>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceMirPresentationSupportKHR(%zu, %" PRIu32 ", %p)", physicalDevice, queueFamilyIndex, connection);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceMirPresentationSupportKHR) {
VkBool32 return_value = mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceMirPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection);
GAPID_INFO("Returned: %" PRIu32 "", return_value);
if (pushReturn) {
stack->push<VkBool32>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceMirPresentationSupportKHR");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceMirPresentationSupportKHR");
return false;
}
}
bool Vulkan::callVkCreateInstance(Stack* stack, bool pushReturn) {
auto pInstance = stack->pop<VkInstance*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkInstanceCreateInfo*>();
if (stack->isValid()) {
GAPID_INFO("vkCreateInstance(%p, %p, %p)", pCreateInfo, pAllocator, pInstance);
if (mFunctionStubs.vkCreateInstance != nullptr) {
VkResult return_value = mFunctionStubs.vkCreateInstance(pCreateInfo, pAllocator, pInstance);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateInstance");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateInstance");
return false;
}
}
bool Vulkan::callVkDestroyInstance(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto instance = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyInstance(%zu, %p)", instance, pAllocator);
if (mVkInstanceFunctionStubs.find(instance) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[instance].vkDestroyInstance) {
mVkInstanceFunctionStubs[instance].vkDestroyInstance(instance, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyInstance");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyInstance");
return false;
}
}
bool Vulkan::callVkEnumeratePhysicalDevices(Stack* stack, bool pushReturn) {
auto pPhysicalDevices = stack->pop<VkPhysicalDevice*>();
auto pPhysicalDeviceCount = stack->pop<uint32_t*>();
auto instance = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkEnumeratePhysicalDevices(%zu, %p, %p)", instance, pPhysicalDeviceCount, pPhysicalDevices);
if (mVkInstanceFunctionStubs.find(instance) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[instance].vkEnumeratePhysicalDevices) {
VkResult return_value = mVkInstanceFunctionStubs[instance].vkEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkEnumeratePhysicalDevices");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkEnumeratePhysicalDevices");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceFeatures(Stack* stack, bool pushReturn) {
auto pFeatures = stack->pop<VkPhysicalDeviceFeatures*>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceFeatures(%zu, %p)", physicalDevice, pFeatures);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceFeatures) {
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceFeatures(physicalDevice, pFeatures);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceFeatures");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceFeatures");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceFormatProperties(Stack* stack, bool pushReturn) {
auto pFormatProperties = stack->pop<VkFormatProperties*>();
auto format = stack->pop<VkFormat>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceFormatProperties(%zu, %u, %p)", physicalDevice, format, pFormatProperties);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceFormatProperties) {
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceFormatProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceFormatProperties");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceImageFormatProperties(Stack* stack, bool pushReturn) {
auto pImageFormatProperties = stack->pop<VkImageFormatProperties*>();
auto flags = stack->pop<uint32_t>();
auto usage = stack->pop<uint32_t>();
auto tiling = stack->pop<VkImageTiling>();
auto type = stack->pop<VkImageType>();
auto format = stack->pop<VkFormat>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceImageFormatProperties(%zu, %u, %u, %u, %" PRIu32 ", %" PRIu32 ", %p)", physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceImageFormatProperties) {
VkResult return_value = mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceImageFormatProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceImageFormatProperties");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceProperties(Stack* stack, bool pushReturn) {
auto pProperties = stack->pop<VkPhysicalDeviceProperties*>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceProperties(%zu, %p)", physicalDevice, pProperties);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceProperties) {
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceProperties(physicalDevice, pProperties);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceProperties");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceQueueFamilyProperties(Stack* stack, bool pushReturn) {
auto pQueueFamilyProperties = stack->pop<VkQueueFamilyProperties*>();
auto pQueueFamilyPropertyCount = stack->pop<uint32_t*>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceQueueFamilyProperties(%zu, %p, %p)", physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceQueueFamilyProperties) {
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceQueueFamilyProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceQueueFamilyProperties");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceMemoryProperties(Stack* stack, bool pushReturn) {
auto pMemoryProperties = stack->pop<VkPhysicalDeviceMemoryProperties*>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceMemoryProperties(%zu, %p)", physicalDevice, pMemoryProperties);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceMemoryProperties) {
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceMemoryProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceMemoryProperties");
return false;
}
}
bool Vulkan::callVkGetInstanceProcAddr(Stack* stack, bool pushReturn) {
auto pName = stack->pop<const char*>();
auto instance = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetInstanceProcAddr(%zu, %s)", instance, pName);
if (mVkInstanceFunctionStubs.find(instance) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[instance].vkGetInstanceProcAddr) {
PFN_vkVoidFunction return_value = mVkInstanceFunctionStubs[instance].vkGetInstanceProcAddr(instance, pName);
GAPID_INFO("Returned: %p", return_value);
if (pushReturn) {
stack->push<PFN_vkVoidFunction>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetInstanceProcAddr");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetInstanceProcAddr");
return false;
}
}
bool Vulkan::callVkGetDeviceProcAddr(Stack* stack, bool pushReturn) {
auto pName = stack->pop<const char*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetDeviceProcAddr(%zu, %s)", device, pName);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetDeviceProcAddr) {
PFN_vkVoidFunction return_value = mVkDeviceFunctionStubs[device].vkGetDeviceProcAddr(device, pName);
GAPID_INFO("Returned: %p", return_value);
if (pushReturn) {
stack->push<PFN_vkVoidFunction>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetDeviceProcAddr");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetDeviceProcAddr");
return false;
}
}
bool Vulkan::callVkCreateDevice(Stack* stack, bool pushReturn) {
auto pDevice = stack->pop<VkDevice*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkDeviceCreateInfo*>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateDevice(%zu, %p, %p, %p)", physicalDevice, pCreateInfo, pAllocator, pDevice);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkCreateDevice) {
VkResult return_value = mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateDevice");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateDevice");
return false;
}
}
bool Vulkan::callVkDestroyDevice(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyDevice(%zu, %p)", device, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyDevice) {
mVkDeviceFunctionStubs[device].vkDestroyDevice(device, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyDevice");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyDevice");
return false;
}
}
bool Vulkan::callVkEnumerateInstanceExtensionProperties(Stack* stack, bool pushReturn) {
auto pProperties = stack->pop<VkExtensionProperties*>();
auto pPropertyCount = stack->pop<uint32_t*>();
auto pLayerName = stack->pop<const char*>();
if (stack->isValid()) {
GAPID_INFO("vkEnumerateInstanceExtensionProperties(%s, %p, %p)", pLayerName, pPropertyCount, pProperties);
if (mFunctionStubs.vkEnumerateInstanceExtensionProperties != nullptr) {
VkResult return_value = mFunctionStubs.vkEnumerateInstanceExtensionProperties(pLayerName, pPropertyCount, pProperties);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkEnumerateInstanceExtensionProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkEnumerateInstanceExtensionProperties");
return false;
}
}
bool Vulkan::callVkEnumerateDeviceExtensionProperties(Stack* stack, bool pushReturn) {
auto pProperties = stack->pop<VkExtensionProperties*>();
auto pPropertyCount = stack->pop<uint32_t*>();
auto pLayerName = stack->pop<const char*>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkEnumerateDeviceExtensionProperties(%zu, %s, %p, %p)", physicalDevice, pLayerName, pPropertyCount, pProperties);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkEnumerateDeviceExtensionProperties) {
VkResult return_value = mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkEnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pPropertyCount, pProperties);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkEnumerateDeviceExtensionProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkEnumerateDeviceExtensionProperties");
return false;
}
}
bool Vulkan::callVkEnumerateInstanceLayerProperties(Stack* stack, bool pushReturn) {
auto pProperties = stack->pop<VkLayerProperties*>();
auto pPropertyCount = stack->pop<uint32_t*>();
if (stack->isValid()) {
GAPID_INFO("vkEnumerateInstanceLayerProperties(%p, %p)", pPropertyCount, pProperties);
if (mFunctionStubs.vkEnumerateInstanceLayerProperties != nullptr) {
VkResult return_value = mFunctionStubs.vkEnumerateInstanceLayerProperties(pPropertyCount, pProperties);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkEnumerateInstanceLayerProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkEnumerateInstanceLayerProperties");
return false;
}
}
bool Vulkan::callVkEnumerateDeviceLayerProperties(Stack* stack, bool pushReturn) {
auto pProperties = stack->pop<VkLayerProperties*>();
auto pPropertyCount = stack->pop<uint32_t*>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkEnumerateDeviceLayerProperties(%zu, %p, %p)", physicalDevice, pPropertyCount, pProperties);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkEnumerateDeviceLayerProperties) {
VkResult return_value = mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkEnumerateDeviceLayerProperties(physicalDevice, pPropertyCount, pProperties);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkEnumerateDeviceLayerProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkEnumerateDeviceLayerProperties");
return false;
}
}
bool Vulkan::callVkGetDeviceQueue(Stack* stack, bool pushReturn) {
auto pQueue = stack->pop<VkQueue*>();
auto queueIndex = stack->pop<uint32_t>();
auto queueFamilyIndex = stack->pop<uint32_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetDeviceQueue(%zu, %" PRIu32 ", %" PRIu32 ", %p)", device, queueFamilyIndex, queueIndex, pQueue);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetDeviceQueue) {
mVkDeviceFunctionStubs[device].vkGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetDeviceQueue");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetDeviceQueue");
return false;
}
}
bool Vulkan::callVkQueueSubmit(Stack* stack, bool pushReturn) {
auto fence = stack->pop<uint64_t>();
auto pSubmits = stack->pop<VkSubmitInfo*>();
auto submitCount = stack->pop<uint32_t>();
auto queue = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkQueueSubmit(%zu, %" PRIu32 ", %p, %" PRIu64 ")", queue, submitCount, pSubmits, fence);
if (mIndirectMaps.VkQueuesToVkDevices.find(queue) != mIndirectMaps.VkQueuesToVkDevices.end() &&
mVkDeviceFunctionStubs.find(mIndirectMaps.VkQueuesToVkDevices[queue]) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[mIndirectMaps.VkQueuesToVkDevices[queue]].vkQueueSubmit) {
VkResult return_value = mVkDeviceFunctionStubs[mIndirectMaps.VkQueuesToVkDevices[queue]].vkQueueSubmit(queue, submitCount, pSubmits, fence);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkQueueSubmit");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkQueueSubmit");
return false;
}
}
bool Vulkan::callVkQueueWaitIdle(Stack* stack, bool pushReturn) {
auto queue = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkQueueWaitIdle(%zu)", queue);
if (mIndirectMaps.VkQueuesToVkDevices.find(queue) != mIndirectMaps.VkQueuesToVkDevices.end() &&
mVkDeviceFunctionStubs.find(mIndirectMaps.VkQueuesToVkDevices[queue]) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[mIndirectMaps.VkQueuesToVkDevices[queue]].vkQueueWaitIdle) {
VkResult return_value = mVkDeviceFunctionStubs[mIndirectMaps.VkQueuesToVkDevices[queue]].vkQueueWaitIdle(queue);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkQueueWaitIdle");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkQueueWaitIdle");
return false;
}
}
bool Vulkan::callVkDeviceWaitIdle(Stack* stack, bool pushReturn) {
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDeviceWaitIdle(%zu)", device);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDeviceWaitIdle) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkDeviceWaitIdle(device);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkDeviceWaitIdle");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDeviceWaitIdle");
return false;
}
}
bool Vulkan::callVkAllocateMemory(Stack* stack, bool pushReturn) {
auto pMemory = stack->pop<VkDeviceMemory*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pAllocateInfo = stack->pop<VkMemoryAllocateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkAllocateMemory(%zu, %p, %p, %p)", device, pAllocateInfo, pAllocator, pMemory);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkAllocateMemory) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkAllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkAllocateMemory");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkAllocateMemory");
return false;
}
}
bool Vulkan::callVkFreeMemory(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto memory = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkFreeMemory(%zu, %" PRIu64 ", %p)", device, memory, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkFreeMemory) {
mVkDeviceFunctionStubs[device].vkFreeMemory(device, memory, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkFreeMemory");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkFreeMemory");
return false;
}
}
bool Vulkan::callVkMapMemory(Stack* stack, bool pushReturn) {
auto ppData = stack->pop<void**>();
auto flags = stack->pop<uint32_t>();
auto size = stack->pop<uint64_t>();
auto offset = stack->pop<uint64_t>();
auto memory = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkMapMemory(%zu, %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %p)", device, memory, offset, size, flags, ppData);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkMapMemory) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkMapMemory(device, memory, offset, size, flags, ppData);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkMapMemory");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkMapMemory");
return false;
}
}
bool Vulkan::callVkUnmapMemory(Stack* stack, bool pushReturn) {
auto memory = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkUnmapMemory(%zu, %" PRIu64 ")", device, memory);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkUnmapMemory) {
mVkDeviceFunctionStubs[device].vkUnmapMemory(device, memory);
} else {
GAPID_WARNING("Attempted to call unsupported function vkUnmapMemory");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkUnmapMemory");
return false;
}
}
bool Vulkan::callVkFlushMappedMemoryRanges(Stack* stack, bool pushReturn) {
auto pMemoryRanges = stack->pop<VkMappedMemoryRange*>();
auto memoryRangeCount = stack->pop<uint32_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkFlushMappedMemoryRanges(%zu, %" PRIu32 ", %p)", device, memoryRangeCount, pMemoryRanges);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkFlushMappedMemoryRanges) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkFlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkFlushMappedMemoryRanges");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkFlushMappedMemoryRanges");
return false;
}
}
bool Vulkan::callVkInvalidateMappedMemoryRanges(Stack* stack, bool pushReturn) {
auto pMemoryRanges = stack->pop<VkMappedMemoryRange*>();
auto memoryRangeCount = stack->pop<uint32_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkInvalidateMappedMemoryRanges(%zu, %" PRIu32 ", %p)", device, memoryRangeCount, pMemoryRanges);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkInvalidateMappedMemoryRanges) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkInvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkInvalidateMappedMemoryRanges");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkInvalidateMappedMemoryRanges");
return false;
}
}
bool Vulkan::callVkGetDeviceMemoryCommitment(Stack* stack, bool pushReturn) {
auto pCommittedMemoryInBytes = stack->pop<VkDeviceSize*>();
auto memory = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetDeviceMemoryCommitment(%zu, %" PRIu64 ", %p)", device, memory, pCommittedMemoryInBytes);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetDeviceMemoryCommitment) {
mVkDeviceFunctionStubs[device].vkGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetDeviceMemoryCommitment");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetDeviceMemoryCommitment");
return false;
}
}
bool Vulkan::callVkBindBufferMemory(Stack* stack, bool pushReturn) {
auto memoryOffset = stack->pop<uint64_t>();
auto memory = stack->pop<uint64_t>();
auto buffer = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkBindBufferMemory(%zu, %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", device, buffer, memory, memoryOffset);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkBindBufferMemory) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkBindBufferMemory(device, buffer, memory, memoryOffset);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkBindBufferMemory");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkBindBufferMemory");
return false;
}
}
bool Vulkan::callVkBindImageMemory(Stack* stack, bool pushReturn) {
auto memoryOffset = stack->pop<uint64_t>();
auto memory = stack->pop<uint64_t>();
auto image = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkBindImageMemory(%zu, %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", device, image, memory, memoryOffset);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkBindImageMemory) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkBindImageMemory(device, image, memory, memoryOffset);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkBindImageMemory");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkBindImageMemory");
return false;
}
}
bool Vulkan::callVkGetBufferMemoryRequirements(Stack* stack, bool pushReturn) {
auto pMemoryRequirements = stack->pop<VkMemoryRequirements*>();
auto buffer = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetBufferMemoryRequirements(%zu, %" PRIu64 ", %p)", device, buffer, pMemoryRequirements);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetBufferMemoryRequirements) {
mVkDeviceFunctionStubs[device].vkGetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetBufferMemoryRequirements");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetBufferMemoryRequirements");
return false;
}
}
bool Vulkan::callVkGetImageMemoryRequirements(Stack* stack, bool pushReturn) {
auto pMemoryRequirements = stack->pop<VkMemoryRequirements*>();
auto image = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetImageMemoryRequirements(%zu, %" PRIu64 ", %p)", device, image, pMemoryRequirements);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetImageMemoryRequirements) {
mVkDeviceFunctionStubs[device].vkGetImageMemoryRequirements(device, image, pMemoryRequirements);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetImageMemoryRequirements");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetImageMemoryRequirements");
return false;
}
}
bool Vulkan::callVkGetImageSparseMemoryRequirements(Stack* stack, bool pushReturn) {
auto pSparseMemoryRequirements = stack->pop<VkSparseImageMemoryRequirements*>();
auto pSparseMemoryRequirementCount = stack->pop<uint32_t*>();
auto image = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetImageSparseMemoryRequirements(%zu, %" PRIu64 ", %p, %p)", device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetImageSparseMemoryRequirements) {
mVkDeviceFunctionStubs[device].vkGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetImageSparseMemoryRequirements");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetImageSparseMemoryRequirements");
return false;
}
}
bool Vulkan::callVkGetPhysicalDeviceSparseImageFormatProperties(Stack* stack, bool pushReturn) {
auto pProperties = stack->pop<VkSparseImageFormatProperties*>();
auto pPropertyCount = stack->pop<uint32_t*>();
auto tiling = stack->pop<VkImageTiling>();
auto usage = stack->pop<uint32_t>();
auto samples = stack->pop<VkSampleCountFlagBits>();
auto type = stack->pop<VkImageType>();
auto format = stack->pop<VkFormat>();
auto physicalDevice = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPhysicalDeviceSparseImageFormatProperties(%zu, %u, %u, %u, %" PRIu32 ", %u, %p, %p)", physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
if (mIndirectMaps.VkPhysicalDevicesToVkInstances.find(physicalDevice) != mIndirectMaps.VkPhysicalDevicesToVkInstances.end() &&
mVkInstanceFunctionStubs.find(mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]) != mVkInstanceFunctionStubs.end() &&
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceSparseImageFormatProperties) {
mVkInstanceFunctionStubs[mIndirectMaps.VkPhysicalDevicesToVkInstances[physicalDevice]].vkGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPhysicalDeviceSparseImageFormatProperties");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPhysicalDeviceSparseImageFormatProperties");
return false;
}
}
bool Vulkan::callVkQueueBindSparse(Stack* stack, bool pushReturn) {
auto fence = stack->pop<uint64_t>();
auto pBindInfo = stack->pop<VkBindSparseInfo*>();
auto bindInfoCount = stack->pop<uint32_t>();
auto queue = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkQueueBindSparse(%zu, %" PRIu32 ", %p, %" PRIu64 ")", queue, bindInfoCount, pBindInfo, fence);
if (mIndirectMaps.VkQueuesToVkDevices.find(queue) != mIndirectMaps.VkQueuesToVkDevices.end() &&
mVkDeviceFunctionStubs.find(mIndirectMaps.VkQueuesToVkDevices[queue]) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[mIndirectMaps.VkQueuesToVkDevices[queue]].vkQueueBindSparse) {
VkResult return_value = mVkDeviceFunctionStubs[mIndirectMaps.VkQueuesToVkDevices[queue]].vkQueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkQueueBindSparse");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkQueueBindSparse");
return false;
}
}
bool Vulkan::callVkCreateFence(Stack* stack, bool pushReturn) {
auto pFence = stack->pop<VkFence*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkFenceCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateFence(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pFence);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateFence) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateFence(device, pCreateInfo, pAllocator, pFence);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateFence");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateFence");
return false;
}
}
bool Vulkan::callVkDestroyFence(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto fence = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyFence(%zu, %" PRIu64 ", %p)", device, fence, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyFence) {
mVkDeviceFunctionStubs[device].vkDestroyFence(device, fence, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyFence");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyFence");
return false;
}
}
bool Vulkan::callVkResetFences(Stack* stack, bool pushReturn) {
auto pFences = stack->pop<VkFence*>();
auto fenceCount = stack->pop<uint32_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkResetFences(%zu, %" PRIu32 ", %p)", device, fenceCount, pFences);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkResetFences) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkResetFences(device, fenceCount, pFences);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkResetFences");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkResetFences");
return false;
}
}
bool Vulkan::callVkGetFenceStatus(Stack* stack, bool pushReturn) {
auto fence = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetFenceStatus(%zu, %" PRIu64 ")", device, fence);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetFenceStatus) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkGetFenceStatus(device, fence);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetFenceStatus");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetFenceStatus");
return false;
}
}
bool Vulkan::callVkWaitForFences(Stack* stack, bool pushReturn) {
auto timeout = stack->pop<uint64_t>();
auto waitAll = stack->pop<uint32_t>();
auto pFences = stack->pop<VkFence*>();
auto fenceCount = stack->pop<uint32_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkWaitForFences(%zu, %" PRIu32 ", %p, %" PRIu32 ", %" PRIu64 ")", device, fenceCount, pFences, waitAll, timeout);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkWaitForFences) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkWaitForFences(device, fenceCount, pFences, waitAll, timeout);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkWaitForFences");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkWaitForFences");
return false;
}
}
bool Vulkan::callVkCreateSemaphore(Stack* stack, bool pushReturn) {
auto pSemaphore = stack->pop<VkSemaphore*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkSemaphoreCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateSemaphore(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pSemaphore);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateSemaphore) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateSemaphore");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateSemaphore");
return false;
}
}
bool Vulkan::callVkDestroySemaphore(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto semaphore = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroySemaphore(%zu, %" PRIu64 ", %p)", device, semaphore, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroySemaphore) {
mVkDeviceFunctionStubs[device].vkDestroySemaphore(device, semaphore, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroySemaphore");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroySemaphore");
return false;
}
}
bool Vulkan::callVkCreateEvent(Stack* stack, bool pushReturn) {
auto pEvent = stack->pop<VkEvent*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkEventCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateEvent(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pEvent);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateEvent) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateEvent(device, pCreateInfo, pAllocator, pEvent);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateEvent");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateEvent");
return false;
}
}
bool Vulkan::callVkDestroyEvent(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto event = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyEvent(%zu, %" PRIu64 ", %p)", device, event, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyEvent) {
mVkDeviceFunctionStubs[device].vkDestroyEvent(device, event, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyEvent");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyEvent");
return false;
}
}
bool Vulkan::callVkGetEventStatus(Stack* stack, bool pushReturn) {
auto event = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetEventStatus(%zu, %" PRIu64 ")", device, event);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetEventStatus) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkGetEventStatus(device, event);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetEventStatus");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetEventStatus");
return false;
}
}
bool Vulkan::callVkSetEvent(Stack* stack, bool pushReturn) {
auto event = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkSetEvent(%zu, %" PRIu64 ")", device, event);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkSetEvent) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkSetEvent(device, event);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkSetEvent");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkSetEvent");
return false;
}
}
bool Vulkan::callVkResetEvent(Stack* stack, bool pushReturn) {
auto event = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkResetEvent(%zu, %" PRIu64 ")", device, event);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkResetEvent) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkResetEvent(device, event);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkResetEvent");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkResetEvent");
return false;
}
}
bool Vulkan::callVkCreateQueryPool(Stack* stack, bool pushReturn) {
auto pQueryPool = stack->pop<VkQueryPool*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkQueryPoolCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateQueryPool(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pQueryPool);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateQueryPool) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateQueryPool");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateQueryPool");
return false;
}
}
bool Vulkan::callVkDestroyQueryPool(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto queryPool = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyQueryPool(%zu, %" PRIu64 ", %p)", device, queryPool, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyQueryPool) {
mVkDeviceFunctionStubs[device].vkDestroyQueryPool(device, queryPool, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyQueryPool");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyQueryPool");
return false;
}
}
bool Vulkan::callVkGetQueryPoolResults(Stack* stack, bool pushReturn) {
auto flags = stack->pop<uint32_t>();
auto stride = stack->pop<uint64_t>();
auto pData = stack->pop<void*>();
auto dataSize = static_cast<size_val>(stack->pop<size_val>());
auto queryCount = stack->pop<uint32_t>();
auto firstQuery = stack->pop<uint32_t>();
auto queryPool = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetQueryPoolResults(%zu, %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %zu, %p, %" PRIu64 ", %" PRIu32 ")", device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetQueryPoolResults) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkGetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetQueryPoolResults");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetQueryPoolResults");
return false;
}
}
bool Vulkan::callVkCreateBuffer(Stack* stack, bool pushReturn) {
auto pBuffer = stack->pop<VkBuffer*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkBufferCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateBuffer(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pBuffer);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateBuffer) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateBuffer");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateBuffer");
return false;
}
}
bool Vulkan::callVkDestroyBuffer(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto buffer = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyBuffer(%zu, %" PRIu64 ", %p)", device, buffer, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyBuffer) {
mVkDeviceFunctionStubs[device].vkDestroyBuffer(device, buffer, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyBuffer");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyBuffer");
return false;
}
}
bool Vulkan::callVkCreateBufferView(Stack* stack, bool pushReturn) {
auto pView = stack->pop<VkBufferView*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkBufferViewCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateBufferView(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pView);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateBufferView) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateBufferView(device, pCreateInfo, pAllocator, pView);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateBufferView");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateBufferView");
return false;
}
}
bool Vulkan::callVkDestroyBufferView(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto bufferView = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyBufferView(%zu, %" PRIu64 ", %p)", device, bufferView, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyBufferView) {
mVkDeviceFunctionStubs[device].vkDestroyBufferView(device, bufferView, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyBufferView");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyBufferView");
return false;
}
}
bool Vulkan::callVkCreateImage(Stack* stack, bool pushReturn) {
auto pImage = stack->pop<VkImage*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkImageCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateImage(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pImage);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateImage) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateImage(device, pCreateInfo, pAllocator, pImage);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateImage");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateImage");
return false;
}
}
bool Vulkan::callVkDestroyImage(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto image = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyImage(%zu, %" PRIu64 ", %p)", device, image, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyImage) {
mVkDeviceFunctionStubs[device].vkDestroyImage(device, image, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyImage");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyImage");
return false;
}
}
bool Vulkan::callVkGetImageSubresourceLayout(Stack* stack, bool pushReturn) {
auto pLayout = stack->pop<VkSubresourceLayout*>();
auto pSubresource = stack->pop<VkImageSubresource*>();
auto image = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetImageSubresourceLayout(%zu, %" PRIu64 ", %p, %p)", device, image, pSubresource, pLayout);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetImageSubresourceLayout) {
mVkDeviceFunctionStubs[device].vkGetImageSubresourceLayout(device, image, pSubresource, pLayout);
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetImageSubresourceLayout");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetImageSubresourceLayout");
return false;
}
}
bool Vulkan::callVkCreateImageView(Stack* stack, bool pushReturn) {
auto pView = stack->pop<VkImageView*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkImageViewCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateImageView(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pView);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateImageView) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateImageView(device, pCreateInfo, pAllocator, pView);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateImageView");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateImageView");
return false;
}
}
bool Vulkan::callVkDestroyImageView(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto imageView = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyImageView(%zu, %" PRIu64 ", %p)", device, imageView, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyImageView) {
mVkDeviceFunctionStubs[device].vkDestroyImageView(device, imageView, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyImageView");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyImageView");
return false;
}
}
bool Vulkan::callVkCreateShaderModule(Stack* stack, bool pushReturn) {
auto pShaderModule = stack->pop<VkShaderModule*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkShaderModuleCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateShaderModule(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pShaderModule);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateShaderModule) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateShaderModule");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateShaderModule");
return false;
}
}
bool Vulkan::callVkDestroyShaderModule(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto shaderModule = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyShaderModule(%zu, %" PRIu64 ", %p)", device, shaderModule, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyShaderModule) {
mVkDeviceFunctionStubs[device].vkDestroyShaderModule(device, shaderModule, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyShaderModule");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyShaderModule");
return false;
}
}
bool Vulkan::callVkCreatePipelineCache(Stack* stack, bool pushReturn) {
auto pPipelineCache = stack->pop<VkPipelineCache*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkPipelineCacheCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreatePipelineCache(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pPipelineCache);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreatePipelineCache) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreatePipelineCache");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreatePipelineCache");
return false;
}
}
bool Vulkan::callVkDestroyPipelineCache(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pipelineCache = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyPipelineCache(%zu, %" PRIu64 ", %p)", device, pipelineCache, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyPipelineCache) {
mVkDeviceFunctionStubs[device].vkDestroyPipelineCache(device, pipelineCache, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyPipelineCache");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyPipelineCache");
return false;
}
}
bool Vulkan::callVkGetPipelineCacheData(Stack* stack, bool pushReturn) {
auto pData = stack->pop<void*>();
auto pDataSize = stack->pop<size_val*>();
auto pipelineCache = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkGetPipelineCacheData(%zu, %" PRIu64 ", %p, %p)", device, pipelineCache, pDataSize, pData);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkGetPipelineCacheData) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkGetPipelineCacheData(device, pipelineCache, pDataSize, pData);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkGetPipelineCacheData");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkGetPipelineCacheData");
return false;
}
}
bool Vulkan::callVkMergePipelineCaches(Stack* stack, bool pushReturn) {
auto pSrcCaches = stack->pop<VkPipelineCache*>();
auto srcCacheCount = stack->pop<uint32_t>();
auto dstCache = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkMergePipelineCaches(%zu, %" PRIu64 ", %" PRIu32 ", %p)", device, dstCache, srcCacheCount, pSrcCaches);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkMergePipelineCaches) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkMergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkMergePipelineCaches");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkMergePipelineCaches");
return false;
}
}
bool Vulkan::callVkCreateGraphicsPipelines(Stack* stack, bool pushReturn) {
auto pPipelines = stack->pop<VkPipeline*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfos = stack->pop<VkGraphicsPipelineCreateInfo*>();
auto createInfoCount = stack->pop<uint32_t>();
auto pipelineCache = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateGraphicsPipelines(%zu, %" PRIu64 ", %" PRIu32 ", %p, %p, %p)", device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateGraphicsPipelines) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateGraphicsPipelines");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateGraphicsPipelines");
return false;
}
}
bool Vulkan::callVkCreateComputePipelines(Stack* stack, bool pushReturn) {
auto pPipelines = stack->pop<VkPipeline*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfos = stack->pop<VkComputePipelineCreateInfo*>();
auto createInfoCount = stack->pop<uint32_t>();
auto pipelineCache = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateComputePipelines(%zu, %" PRIu64 ", %" PRIu32 ", %p, %p, %p)", device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateComputePipelines) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreateComputePipelines");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreateComputePipelines");
return false;
}
}
bool Vulkan::callVkDestroyPipeline(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pipeline = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyPipeline(%zu, %" PRIu64 ", %p)", device, pipeline, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyPipeline) {
mVkDeviceFunctionStubs[device].vkDestroyPipeline(device, pipeline, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyPipeline");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyPipeline");
return false;
}
}
bool Vulkan::callVkCreatePipelineLayout(Stack* stack, bool pushReturn) {
auto pPipelineLayout = stack->pop<VkPipelineLayout*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkPipelineLayoutCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreatePipelineLayout(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pPipelineLayout);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreatePipelineLayout) {
VkResult return_value = mVkDeviceFunctionStubs[device].vkCreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
GAPID_INFO("Returned: %u", return_value);
if (pushReturn) {
stack->push<VkResult>(return_value);
}
} else {
GAPID_WARNING("Attempted to call unsupported function vkCreatePipelineLayout");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkCreatePipelineLayout");
return false;
}
}
bool Vulkan::callVkDestroyPipelineLayout(Stack* stack, bool pushReturn) {
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pipelineLayout = stack->pop<uint64_t>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkDestroyPipelineLayout(%zu, %" PRIu64 ", %p)", device, pipelineLayout, pAllocator);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkDestroyPipelineLayout) {
mVkDeviceFunctionStubs[device].vkDestroyPipelineLayout(device, pipelineLayout, pAllocator);
} else {
GAPID_WARNING("Attempted to call unsupported function vkDestroyPipelineLayout");
}
return true;
} else {
GAPID_WARNING("Error during calling function vkDestroyPipelineLayout");
return false;
}
}
bool Vulkan::callVkCreateSampler(Stack* stack, bool pushReturn) {
auto pSampler = stack->pop<VkSampler*>();
auto pAllocator = stack->pop<VkAllocationCallbacks*>();
auto pCreateInfo = stack->pop<VkSamplerCreateInfo*>();
auto device = static_cast<size_val>(stack->pop<size_val>());
if (stack->isValid()) {
GAPID_INFO("vkCreateSampler(%zu, %p, %p, %p)", device, pCreateInfo, pAllocator, pSampler);
if (mVkDeviceFunctionStubs.find(device) != mVkDeviceFunctionStubs.end() &&
mVkDeviceFunctionStubs[device].vkCreateSampler) {
VkResult return_value = mVkDeviceFunctionStubs[device].