bool swapchain_enabled = false;
bool display_swapchain_enabled = false;
bool amd_negative_viewport_height_enabled = false;
+
+ VkLayerDispatchTable dispatch_table = {};
};
static std::unordered_map<void *, layer_data *> layer_data_map;
static std::unordered_map<void *, instance_layer_data *> instance_layer_data_map;
-static device_table_map pc_device_table_map;
static void init_parameter_validation(instance_layer_data *my_data, const VkAllocationCallbacks *pAllocator) {
assert(my_device_data != nullptr);
my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice);
- initDeviceTable(*pDevice, fpGetDeviceProcAddr, pc_device_table_map);
+ layer_init_device_dispatch_table(*pDevice, &my_device_data->dispatch_table, fpGetDeviceProcAddr);
CheckDeviceRegisterExtensions(pCreateInfo, *pDevice);
fprintf(stderr, "Device: 0x%p, key: 0x%p\n", device, key);
#endif
- get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device, pAllocator);
- pc_device_table_map.erase(key);
+ my_data->dispatch_table.DestroyDevice(device, pAllocator);
layer_data_map.erase(key);
}
}
if (!skip) {
PreGetDeviceQueue(device, queueFamilyIndex, queueIndex);
- get_dispatch_table(pc_device_table_map, device)->GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
+ my_data->dispatch_table.GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
}
}
skip |= parameter_validation_vkQueueSubmit(my_data->report_data, submitCount, pSubmits, fence);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, queue)->QueueSubmit(queue, submitCount, pSubmits, fence);
+ result = my_data->dispatch_table.QueueSubmit(queue, submitCount, pSubmits, fence);
validate_result(my_data->report_data, "vkQueueSubmit", result);
}
layer_data *my_data = get_my_data_ptr(get_dispatch_key(queue), layer_data_map);
assert(my_data != NULL);
- VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitIdle(queue);
+ VkResult result = my_data->dispatch_table.QueueWaitIdle(queue);
validate_result(my_data->report_data, "vkQueueWaitIdle", result);
layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
assert(my_data != NULL);
- VkResult result = get_dispatch_table(pc_device_table_map, device)->DeviceWaitIdle(device);
+ VkResult result = my_data->dispatch_table.DeviceWaitIdle(device);
validate_result(my_data->report_data, "vkDeviceWaitIdle", result);
skip |= parameter_validation_vkAllocateMemory(my_data->report_data, pAllocateInfo, pAllocator, pMemory);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
+ result = my_data->dispatch_table.AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
validate_result(my_data->report_data, "vkAllocateMemory", result);
}
skip |= parameter_validation_vkFreeMemory(my_data->report_data, memory, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->FreeMemory(device, memory, pAllocator);
+ my_data->dispatch_table.FreeMemory(device, memory, pAllocator);
}
}
skip |= parameter_validation_vkMapMemory(my_data->report_data, memory, offset, size, flags, ppData);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->MapMemory(device, memory, offset, size, flags, ppData);
+ result = my_data->dispatch_table.MapMemory(device, memory, offset, size, flags, ppData);
validate_result(my_data->report_data, "vkMapMemory", result);
}
skip |= parameter_validation_vkUnmapMemory(my_data->report_data, memory);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->UnmapMemory(device, memory);
+ my_data->dispatch_table.UnmapMemory(device, memory);
}
}
skip |= parameter_validation_vkFlushMappedMemoryRanges(my_data->report_data, memoryRangeCount, pMemoryRanges);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
+ result = my_data->dispatch_table.FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
validate_result(my_data->report_data, "vkFlushMappedMemoryRanges", result);
}
if (!skip) {
result =
- get_dispatch_table(pc_device_table_map, device)->InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
+ my_data->dispatch_table.InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
validate_result(my_data->report_data, "vkInvalidateMappedMemoryRanges", result);
}
skip |= parameter_validation_vkGetDeviceMemoryCommitment(my_data->report_data, memory, pCommittedMemoryInBytes);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
+ my_data->dispatch_table.GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
}
}
skip |= parameter_validation_vkBindBufferMemory(my_data->report_data, buffer, memory, memoryOffset);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->BindBufferMemory(device, buffer, memory, memoryOffset);
+ result = my_data->dispatch_table.BindBufferMemory(device, buffer, memory, memoryOffset);
validate_result(my_data->report_data, "vkBindBufferMemory", result);
}
skip |= parameter_validation_vkBindImageMemory(my_data->report_data, image, memory, memoryOffset);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->BindImageMemory(device, image, memory, memoryOffset);
+ result = my_data->dispatch_table.BindImageMemory(device, image, memory, memoryOffset);
validate_result(my_data->report_data, "vkBindImageMemory", result);
}
skip |= parameter_validation_vkGetBufferMemoryRequirements(my_data->report_data, buffer, pMemoryRequirements);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
+ my_data->dispatch_table.GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
}
}
skip |= parameter_validation_vkGetImageMemoryRequirements(my_data->report_data, image, pMemoryRequirements);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->GetImageMemoryRequirements(device, image, pMemoryRequirements);
+ my_data->dispatch_table.GetImageMemoryRequirements(device, image, pMemoryRequirements);
}
}
pSparseMemoryRequirements);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)
- ->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
+ my_data->dispatch_table.GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
PostGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
}
skip |= parameter_validation_vkQueueBindSparse(my_data->report_data, bindInfoCount, pBindInfo, fence);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
+ result = my_data->dispatch_table.QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
validate_result(my_data->report_data, "vkQueueBindSparse", result);
}
skip |= parameter_validation_vkCreateFence(my_data->report_data, pCreateInfo, pAllocator, pFence);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateFence(device, pCreateInfo, pAllocator, pFence);
+ result = my_data->dispatch_table.CreateFence(device, pCreateInfo, pAllocator, pFence);
validate_result(my_data->report_data, "vkCreateFence", result);
}
skip |= parameter_validation_vkDestroyFence(my_data->report_data, fence, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyFence(device, fence, pAllocator);
+ my_data->dispatch_table.DestroyFence(device, fence, pAllocator);
}
}
skip |= parameter_validation_vkResetFences(my_data->report_data, fenceCount, pFences);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->ResetFences(device, fenceCount, pFences);
+ result = my_data->dispatch_table.ResetFences(device, fenceCount, pFences);
validate_result(my_data->report_data, "vkResetFences", result);
}
skip |= parameter_validation_vkGetFenceStatus(my_data->report_data, fence);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->GetFenceStatus(device, fence);
+ result = my_data->dispatch_table.GetFenceStatus(device, fence);
validate_result(my_data->report_data, "vkGetFenceStatus", result);
}
skip |= parameter_validation_vkWaitForFences(my_data->report_data, fenceCount, pFences, waitAll, timeout);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout);
+ result = my_data->dispatch_table.WaitForFences(device, fenceCount, pFences, waitAll, timeout);
validate_result(my_data->report_data, "vkWaitForFences", result);
}
skip |= parameter_validation_vkCreateSemaphore(my_data->report_data, pCreateInfo, pAllocator, pSemaphore);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
+ result = my_data->dispatch_table.CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
validate_result(my_data->report_data, "vkCreateSemaphore", result);
}
skip |= parameter_validation_vkDestroySemaphore(my_data->report_data, semaphore, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroySemaphore(device, semaphore, pAllocator);
+ my_data->dispatch_table.DestroySemaphore(device, semaphore, pAllocator);
}
}
skip |= parameter_validation_vkCreateEvent(my_data->report_data, pCreateInfo, pAllocator, pEvent);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateEvent(device, pCreateInfo, pAllocator, pEvent);
+ result = my_data->dispatch_table.CreateEvent(device, pCreateInfo, pAllocator, pEvent);
validate_result(my_data->report_data, "vkCreateEvent", result);
}
skip |= parameter_validation_vkDestroyEvent(my_data->report_data, event, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyEvent(device, event, pAllocator);
+ my_data->dispatch_table.DestroyEvent(device, event, pAllocator);
}
}
skip |= parameter_validation_vkGetEventStatus(my_data->report_data, event);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->GetEventStatus(device, event);
+ result = my_data->dispatch_table.GetEventStatus(device, event);
validate_result(my_data->report_data, "vkGetEventStatus", result);
}
skip |= parameter_validation_vkSetEvent(my_data->report_data, event);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->SetEvent(device, event);
+ result = my_data->dispatch_table.SetEvent(device, event);
validate_result(my_data->report_data, "vkSetEvent", result);
}
skip |= parameter_validation_vkResetEvent(my_data->report_data, event);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->ResetEvent(device, event);
+ result = my_data->dispatch_table.ResetEvent(device, event);
validate_result(my_data->report_data, "vkResetEvent", result);
}
}
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
+ result = device_data->dispatch_table.CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
validate_result(report_data, "vkCreateQueryPool", result);
}
skip |= parameter_validation_vkDestroyQueryPool(my_data->report_data, queryPool, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyQueryPool(device, queryPool, pAllocator);
+ my_data->dispatch_table.DestroyQueryPool(device, queryPool, pAllocator);
}
}
pData, stride, flags);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)
- ->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
+ result = my_data->dispatch_table.GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
validate_result(my_data->report_data, "vkGetQueryPoolResults", result);
}
}
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
+ result = device_data->dispatch_table.CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
validate_result(report_data, "vkCreateBuffer", result);
}
skip |= parameter_validation_vkDestroyBuffer(my_data->report_data, buffer, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyBuffer(device, buffer, pAllocator);
+ my_data->dispatch_table.DestroyBuffer(device, buffer, pAllocator);
}
}
skip |= parameter_validation_vkCreateBufferView(my_data->report_data, pCreateInfo, pAllocator, pView);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateBufferView(device, pCreateInfo, pAllocator, pView);
+ result = my_data->dispatch_table.CreateBufferView(device, pCreateInfo, pAllocator, pView);
validate_result(my_data->report_data, "vkCreateBufferView", result);
}
skip |= parameter_validation_vkDestroyBufferView(my_data->report_data, bufferView, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyBufferView(device, bufferView, pAllocator);
+ my_data->dispatch_table.DestroyBufferView(device, bufferView, pAllocator);
}
}
}
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateImage(device, pCreateInfo, pAllocator, pImage);
+ result = device_data->dispatch_table.CreateImage(device, pCreateInfo, pAllocator, pImage);
validate_result(report_data, "vkCreateImage", result);
}
skip |= parameter_validation_vkDestroyImage(my_data->report_data, image, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyImage(device, image, pAllocator);
+ my_data->dispatch_table.DestroyImage(device, image, pAllocator);
}
}
if (!skip) {
PreGetImageSubresourceLayout(device, pSubresource);
- get_dispatch_table(pc_device_table_map, device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout);
+ my_data->dispatch_table.GetImageSubresourceLayout(device, image, pSubresource, pLayout);
}
}
}
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateImageView(device, pCreateInfo, pAllocator, pView);
+ result = my_data->dispatch_table.CreateImageView(device, pCreateInfo, pAllocator, pView);
validate_result(my_data->report_data, "vkCreateImageView", result);
}
skip |= parameter_validation_vkDestroyImageView(my_data->report_data, imageView, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyImageView(device, imageView, pAllocator);
+ my_data->dispatch_table.DestroyImageView(device, imageView, pAllocator);
}
}
if (!skip) {
result =
- get_dispatch_table(pc_device_table_map, device)->CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule);
+ my_data->dispatch_table.CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule);
validate_result(my_data->report_data, "vkCreateShaderModule", result);
}
skip |= parameter_validation_vkDestroyShaderModule(my_data->report_data, shaderModule, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyShaderModule(device, shaderModule, pAllocator);
+ my_data->dispatch_table.DestroyShaderModule(device, shaderModule, pAllocator);
}
}
if (!skip) {
result =
- get_dispatch_table(pc_device_table_map, device)->CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
+ my_data->dispatch_table.CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
validate_result(my_data->report_data, "vkCreatePipelineCache", result);
}
skip |= parameter_validation_vkDestroyPipelineCache(my_data->report_data, pipelineCache, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyPipelineCache(device, pipelineCache, pAllocator);
+ my_data->dispatch_table.DestroyPipelineCache(device, pipelineCache, pAllocator);
}
}
skip |= parameter_validation_vkGetPipelineCacheData(my_data->report_data, pipelineCache, pDataSize, pData);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
+ result = my_data->dispatch_table.GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
validate_result(my_data->report_data, "vkGetPipelineCacheData", result);
}
skip |= parameter_validation_vkMergePipelineCaches(my_data->report_data, dstCache, srcCacheCount, pSrcCaches);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
+ result = my_data->dispatch_table.MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
validate_result(my_data->report_data, "vkMergePipelineCaches", result);
}
if (!skip) {
PreCreateGraphicsPipelines(device, pCreateInfos);
- result = get_dispatch_table(pc_device_table_map, device)
- ->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
+ result = device_data->dispatch_table.CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
validate_result(report_data, "vkCreateGraphicsPipelines", result);
}
if (!skip) {
PreCreateComputePipelines(device, pCreateInfos);
- result = get_dispatch_table(pc_device_table_map, device)
- ->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
+ result = my_data->dispatch_table.CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
validate_result(my_data->report_data, "vkCreateComputePipelines", result);
}
skip |= parameter_validation_vkDestroyPipeline(my_data->report_data, pipeline, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyPipeline(device, pipeline, pAllocator);
+ my_data->dispatch_table.DestroyPipeline(device, pipeline, pAllocator);
}
}
if (!skip) {
result =
- get_dispatch_table(pc_device_table_map, device)->CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
+ my_data->dispatch_table.CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
validate_result(my_data->report_data, "vkCreatePipelineLayout", result);
}
skip |= parameter_validation_vkDestroyPipelineLayout(my_data->report_data, pipelineLayout, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyPipelineLayout(device, pipelineLayout, pAllocator);
+ my_data->dispatch_table.DestroyPipelineLayout(device, pipelineLayout, pAllocator);
}
}
}
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateSampler(device, pCreateInfo, pAllocator, pSampler);
+ result = device_data->dispatch_table.CreateSampler(device, pCreateInfo, pAllocator, pSampler);
validate_result(report_data, "vkCreateSampler", result);
}
skip |= parameter_validation_vkDestroySampler(my_data->report_data, sampler, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroySampler(device, sampler, pAllocator);
+ my_data->dispatch_table.DestroySampler(device, sampler, pAllocator);
}
}
}
if (!skip) {
- result =
- get_dispatch_table(pc_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
+ result = device_data->dispatch_table.CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
validate_result(report_data, "vkCreateDescriptorSetLayout", result);
}
skip |= parameter_validation_vkDestroyDescriptorSetLayout(my_data->report_data, descriptorSetLayout, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
+ my_data->dispatch_table.DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
}
}
if (!skip) {
result =
- get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
+ my_data->dispatch_table.CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
validate_result(my_data->report_data, "vkCreateDescriptorPool", result);
}
skip |= parameter_validation_vkDestroyDescriptorPool(my_data->report_data, descriptorPool, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorPool(device, descriptorPool, pAllocator);
+ my_data->dispatch_table.DestroyDescriptorPool(device, descriptorPool, pAllocator);
}
}
skip |= parameter_validation_vkResetDescriptorPool(my_data->report_data, descriptorPool, flags);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool, flags);
+ result = my_data->dispatch_table.ResetDescriptorPool(device, descriptorPool, flags);
validate_result(my_data->report_data, "vkResetDescriptorPool", result);
}
skip |= parameter_validation_vkAllocateDescriptorSets(my_data->report_data, pAllocateInfo, pDescriptorSets);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
+ result = my_data->dispatch_table.AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
validate_result(my_data->report_data, "vkAllocateDescriptorSets", result);
}
pDescriptorSets, true, true);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)
- ->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
+ result = device_data->dispatch_table.FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
validate_result(report_data, "vkFreeDescriptorSets", result);
}
}
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)
- ->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
+ device_data->dispatch_table.UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
}
}
skip |= parameter_validation_vkCreateFramebuffer(my_data->report_data, pCreateInfo, pAllocator, pFramebuffer);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
+ result = my_data->dispatch_table.CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
validate_result(my_data->report_data, "vkCreateFramebuffer", result);
}
skip |= parameter_validation_vkDestroyFramebuffer(my_data->report_data, framebuffer, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyFramebuffer(device, framebuffer, pAllocator);
+ my_data->dispatch_table.DestroyFramebuffer(device, framebuffer, pAllocator);
}
}
skip |= PreCreateRenderPass(my_data, pCreateInfo);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
+ result = my_data->dispatch_table.CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
validate_result(my_data->report_data, "vkCreateRenderPass", result);
}
skip |= parameter_validation_vkDestroyRenderPass(my_data->report_data, renderPass, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyRenderPass(device, renderPass, pAllocator);
+ my_data->dispatch_table.DestroyRenderPass(device, renderPass, pAllocator);
}
}
skip |= parameter_validation_vkGetRenderAreaGranularity(my_data->report_data, renderPass, pGranularity);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->GetRenderAreaGranularity(device, renderPass, pGranularity);
+ my_data->dispatch_table.GetRenderAreaGranularity(device, renderPass, pGranularity);
}
}
skip |= parameter_validation_vkCreateCommandPool(my_data->report_data, pCreateInfo, pAllocator, pCommandPool);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
+ result = my_data->dispatch_table.CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
validate_result(my_data->report_data, "vkCreateCommandPool", result);
}
skip |= parameter_validation_vkDestroyCommandPool(my_data->report_data, commandPool, pAllocator);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroyCommandPool(device, commandPool, pAllocator);
+ my_data->dispatch_table.DestroyCommandPool(device, commandPool, pAllocator);
}
}
skip |= parameter_validation_vkResetCommandPool(my_data->report_data, commandPool, flags);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->ResetCommandPool(device, commandPool, flags);
+ result = my_data->dispatch_table.ResetCommandPool(device, commandPool, flags);
validate_result(my_data->report_data, "vkResetCommandPool", result);
}
skip |= parameter_validation_vkAllocateCommandBuffers(my_data->report_data, pAllocateInfo, pCommandBuffers);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
+ result = my_data->dispatch_table.AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
validate_result(my_data->report_data, "vkAllocateCommandBuffers", result);
}
pCommandBuffers, true, true);
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)
- ->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
+ device_data->dispatch_table.FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
}
}
bool PreBeginCommandBuffer(layer_data *dev_data, VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) {
bool skip = false;
+ // TODO: this makes no sense.
layer_data *phy_dev_data = get_my_data_ptr(get_dispatch_key(dev_data->physical_device), layer_data_map);
const VkCommandBufferInheritanceInfo *pInfo = pBeginInfo->pInheritanceInfo;
skip |= PreBeginCommandBuffer(device_data, commandBuffer, pBeginInfo);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, commandBuffer)->BeginCommandBuffer(commandBuffer, pBeginInfo);
+ result = device_data->dispatch_table.BeginCommandBuffer(commandBuffer, pBeginInfo);
validate_result(report_data, "vkBeginCommandBuffer", result);
}
layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
assert(my_data != NULL);
- VkResult result = get_dispatch_table(pc_device_table_map, commandBuffer)->EndCommandBuffer(commandBuffer);
+ VkResult result = my_data->dispatch_table.EndCommandBuffer(commandBuffer);
validate_result(my_data->report_data, "vkEndCommandBuffer", result);
bool skip = parameter_validation_vkResetCommandBuffer(my_data->report_data, flags);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, commandBuffer)->ResetCommandBuffer(commandBuffer, flags);
+ result = my_data->dispatch_table.ResetCommandBuffer(commandBuffer, flags);
validate_result(my_data->report_data, "vkResetCommandBuffer", result);
}
skip |= parameter_validation_vkCmdBindPipeline(my_data->report_data, pipelineBindPoint, pipeline);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
+ my_data->dispatch_table.CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
}
}
skip |= preCmdSetViewport(my_data, viewportCount, pViewports);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
+ my_data->dispatch_table.CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
}
}
}
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
+ my_data->dispatch_table.CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
}
}
VKAPI_ATTR void VKAPI_CALL CmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetLineWidth(commandBuffer, lineWidth);
+ layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
+ my_data->dispatch_table.CmdSetLineWidth(commandBuffer, lineWidth);
}
VKAPI_ATTR void VKAPI_CALL CmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp,
float depthBiasSlopeFactor) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
+ layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
+ my_data->dispatch_table.CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
}
VKAPI_ATTR void VKAPI_CALL CmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) {
skip |= parameter_validation_vkCmdSetBlendConstants(my_data->report_data, blendConstants);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetBlendConstants(commandBuffer, blendConstants);
+ my_data->dispatch_table.CmdSetBlendConstants(commandBuffer, blendConstants);
}
}
VKAPI_ATTR void VKAPI_CALL CmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
+ layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
+ my_data->dispatch_table.CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
}
VKAPI_ATTR void VKAPI_CALL CmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
skip |= parameter_validation_vkCmdSetStencilCompareMask(my_data->report_data, faceMask, compareMask);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
+ my_data->dispatch_table.CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
}
}
skip |= parameter_validation_vkCmdSetStencilWriteMask(my_data->report_data, faceMask, writeMask);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
+ my_data->dispatch_table.CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
}
}
skip |= parameter_validation_vkCmdSetStencilReference(my_data->report_data, faceMask, reference);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetStencilReference(commandBuffer, faceMask, reference);
+ my_data->dispatch_table.CmdSetStencilReference(commandBuffer, faceMask, reference);
}
}
pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets,
+ my_data->dispatch_table.CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets,
dynamicOffsetCount, pDynamicOffsets);
}
}
skip |= parameter_validation_vkCmdBindIndexBuffer(my_data->report_data, buffer, offset, indexType);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
+ my_data->dispatch_table.CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
}
}
skip |= parameter_validation_vkCmdBindVertexBuffers(my_data->report_data, firstBinding, bindingCount, pBuffers, pOffsets);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
+ my_data->dispatch_table.CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
}
}
VKAPI_ATTR void VKAPI_CALL CmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount,
uint32_t firstVertex, uint32_t firstInstance) {
+ layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
PreCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
+ my_data->dispatch_table.CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
}
VKAPI_ATTR void VKAPI_CALL CmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount,
uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
+ layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
+ my_data->dispatch_table.CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
}
VKAPI_ATTR void VKAPI_CALL CmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count,
skip |= parameter_validation_vkCmdDrawIndirect(my_data->report_data, buffer, offset, count, stride);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDrawIndirect(commandBuffer, buffer, offset, count, stride);
+ my_data->dispatch_table.CmdDrawIndirect(commandBuffer, buffer, offset, count, stride);
}
}
skip |= parameter_validation_vkCmdDrawIndexedIndirect(my_data->report_data, buffer, offset, count, stride);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, count, stride);
+ my_data->dispatch_table.CmdDrawIndexedIndirect(commandBuffer, buffer, offset, count, stride);
}
}
VKAPI_ATTR void VKAPI_CALL CmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDispatch(commandBuffer, x, y, z);
+ layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
+ my_data->dispatch_table.CmdDispatch(commandBuffer, x, y, z);
}
VKAPI_ATTR void VKAPI_CALL CmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) {
skip |= parameter_validation_vkCmdDispatchIndirect(my_data->report_data, buffer, offset);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDispatchIndirect(commandBuffer, buffer, offset);
+ my_data->dispatch_table.CmdDispatchIndirect(commandBuffer, buffer, offset);
}
}
skip |= parameter_validation_vkCmdCopyBuffer(my_data->report_data, srcBuffer, dstBuffer, regionCount, pRegions);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
+ my_data->dispatch_table.CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
}
}
if (!skip) {
PreCmdCopyImage(commandBuffer, pRegions);
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
+ my_data->dispatch_table.CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
}
}
if (!skip) {
PreCmdBlitImage(commandBuffer, pRegions);
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
+ my_data->dispatch_table.CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
}
}
if (!skip) {
PreCmdCopyBufferToImage(commandBuffer, pRegions);
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
+ my_data->dispatch_table.CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
}
}
if (!skip) {
PreCmdCopyImageToBuffer(commandBuffer, pRegions);
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
+ my_data->dispatch_table.CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
}
}
}
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
+ my_data->dispatch_table.CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
}
}
}
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
+ my_data->dispatch_table.CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
}
}
skip |= parameter_validation_vkCmdClearColorImage(my_data->report_data, image, imageLayout, pColor, rangeCount, pRanges);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
+ my_data->dispatch_table.CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
}
}
rangeCount, pRanges);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
+ my_data->dispatch_table.CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
}
}
skip |= parameter_validation_vkCmdClearAttachments(my_data->report_data, attachmentCount, pAttachments, rectCount, pRects);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
+ my_data->dispatch_table.CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
}
}
if (!skip) {
PreCmdResolveImage(commandBuffer, pRegions);
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
+ my_data->dispatch_table.CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
}
}
skip |= parameter_validation_vkCmdSetEvent(my_data->report_data, event, stageMask);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetEvent(commandBuffer, event, stageMask);
+ my_data->dispatch_table.CmdSetEvent(commandBuffer, event, stageMask);
}
}
skip |= parameter_validation_vkCmdResetEvent(my_data->report_data, event, stageMask);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdResetEvent(commandBuffer, event, stageMask);
+ my_data->dispatch_table.CmdResetEvent(commandBuffer, event, stageMask);
}
}
pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers,
+ my_data->dispatch_table.CmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers,
bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
}
}
pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers,
+ my_data->dispatch_table.CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers,
bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
}
}
skip |= parameter_validation_vkCmdBeginQuery(my_data->report_data, queryPool, slot, flags);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBeginQuery(commandBuffer, queryPool, slot, flags);
+ my_data->dispatch_table.CmdBeginQuery(commandBuffer, queryPool, slot, flags);
}
}
skip |= parameter_validation_vkCmdEndQuery(my_data->report_data, queryPool, slot);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdEndQuery(commandBuffer, queryPool, slot);
+ my_data->dispatch_table.CmdEndQuery(commandBuffer, queryPool, slot);
}
}
skip |= parameter_validation_vkCmdResetQueryPool(my_data->report_data, queryPool, firstQuery, queryCount);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
+ my_data->dispatch_table.CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
}
}
skip |= parameter_validation_vkCmdWriteTimestamp(my_data->report_data, pipelineStage, queryPool, query);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query);
+ my_data->dispatch_table.CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query);
PostCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query);
}
dstOffset, stride, flags);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
+ my_data->dispatch_table.CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
}
}
skip |= parameter_validation_vkCmdPushConstants(my_data->report_data, layout, stageFlags, offset, size, pValues);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
+ my_data->dispatch_table.CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
}
}
skip |= parameter_validation_vkCmdBeginRenderPass(my_data->report_data, pRenderPassBegin, contents);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
+ my_data->dispatch_table.CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
}
}
skip |= parameter_validation_vkCmdNextSubpass(my_data->report_data, contents);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdNextSubpass(commandBuffer, contents);
+ my_data->dispatch_table.CmdNextSubpass(commandBuffer, contents);
}
}
VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass(VkCommandBuffer commandBuffer) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdEndRenderPass(commandBuffer);
+ layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
+ my_data->dispatch_table.CmdEndRenderPass(commandBuffer);
}
VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount,
skip |= parameter_validation_vkCmdExecuteCommands(my_data->report_data, commandBufferCount, pCommandBuffers);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)
- ->CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
+ my_data->dispatch_table.CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
}
}
skip |= parameter_validation_vkCreateSwapchainKHR(my_data->report_data, pCreateInfo, pAllocator, pSwapchain);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
+ result = my_data->dispatch_table.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
validate_result(my_data->report_data, "vkCreateSwapchainKHR", result);
}
parameter_validation_vkGetSwapchainImagesKHR(my_data->report_data, swapchain, pSwapchainImageCount, pSwapchainImages);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)
- ->GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages);
+ result = my_data->dispatch_table.GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages);
validate_result(my_data->report_data, "vkGetSwapchainImagesKHR", result);
}
parameter_validation_vkAcquireNextImageKHR(my_data->report_data, swapchain, timeout, semaphore, fence, pImageIndex);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)
- ->AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
+ result = my_data->dispatch_table.AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
validate_result(my_data->report_data, "vkAcquireNextImageKHR", result);
}
skip |= parameter_validation_vkQueuePresentKHR(my_data->report_data, pPresentInfo);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, queue)->QueuePresentKHR(queue, pPresentInfo);
+ result = my_data->dispatch_table.QueuePresentKHR(queue, pPresentInfo);
validate_result(my_data->report_data, "vkQueuePresentKHR", result);
}
/* No generated validation function for this call */
if (!skip) {
- get_dispatch_table(pc_device_table_map, device)->DestroySwapchainKHR(device, swapchain, pAllocator);
+ my_data->dispatch_table.DestroySwapchainKHR(device, swapchain, pAllocator);
}
}
pSwapchains);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)
- ->CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains);
+ result = my_data->dispatch_table.CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains);
validate_result(my_data->report_data, "vkCreateSharedSwapchainsKHR", result);
}
skip |= parameter_validation_vkDebugMarkerSetObjectTagEXT(my_data->report_data, pTagInfo);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->DebugMarkerSetObjectTagEXT(device, pTagInfo);
+ result = my_data->dispatch_table.DebugMarkerSetObjectTagEXT(device, pTagInfo);
validate_result(my_data->report_data, "vkDebugMarkerSetObjectTagEXT", result);
}
skip |= parameter_validation_vkDebugMarkerSetObjectNameEXT(my_data->report_data, pNameInfo);
if (!skip) {
- VkResult result = get_dispatch_table(pc_device_table_map, device)->DebugMarkerSetObjectNameEXT(device, pNameInfo);
+ VkResult result = my_data->dispatch_table.DebugMarkerSetObjectNameEXT(device, pNameInfo);
validate_result(my_data->report_data, "vkDebugMarkerSetObjectNameEXT", result);
}
skip |= parameter_validation_vkCmdDebugMarkerBeginEXT(my_data->report_data, pMarkerInfo);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo);
+ my_data->dispatch_table.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo);
}
}
skip |= parameter_validation_vkCmdDebugMarkerInsertEXT(my_data->report_data, pMarkerInfo);
if (!skip) {
- get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo);
+ my_data->dispatch_table.CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo);
}
}
skip |= parameter_validation_vkGetMemoryWin32HandleNV(my_data->report_data, memory, handleType, pHandle);
if (!skip) {
- result = get_dispatch_table(pc_device_table_map, device)->GetMemoryWin32HandleNV(device, memory, handleType, pHandle);
+ result = my_data->dispatch_table.GetMemoryWin32HandleNV(device, memory, handleType, pHandle);
}
return result;
if (proc)
return proc;
- if (get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr == NULL)
- return NULL;
- return get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr(device, funcName);
+ if (!data->dispatch_table.GetDeviceProcAddr)
+ return nullptr;
+ return data->dispatch_table.GetDeviceProcAddr(device, funcName);
}
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetInstanceProcAddr(VkInstance instance, const char *funcName) {