blob: a975d022e5033715c67ac77243e6bc7d7f1edf5f [file] [log] [blame]
// This file is ***GENERATED***. Do Not Edit.
// See thread_safety_generator.py for modifications.
/* Copyright (c) 2015-2019 The Khronos Group Inc.
* Copyright (c) 2015-2019 Valve Corporation
* Copyright (c) 2015-2019 LunarG, Inc.
* Copyright (c) 2015-2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author: Mark Lobodzinski <mark@lunarg.com>
*/
#include "chassis.h"
#include "thread_safety.h"
void ThreadSafety::PreCallRecordAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo,
VkCommandBuffer *pCommandBuffers) {
StartReadObjectParentInstance(device);
StartWriteObject(pAllocateInfo->commandPool);
}
void ThreadSafety::PostCallRecordAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo,
VkCommandBuffer *pCommandBuffers, VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(pAllocateInfo->commandPool);
// Record mapping from command buffer to command pool
if(pCommandBuffers) {
auto lock = write_lock_guard_t(thread_safety_lock);
auto &pool_command_buffers = pool_command_buffers_map[pAllocateInfo->commandPool];
for (uint32_t index = 0; index < pAllocateInfo->commandBufferCount; index++) {
command_pool_map.insert_or_assign(pCommandBuffers[index], pAllocateInfo->commandPool);
CreateObject(pCommandBuffers[index]);
pool_command_buffers.insert(pCommandBuffers[index]);
}
}
}
void ThreadSafety::PreCallRecordCreateDescriptorSetLayout(
VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorSetLayout* pSetLayout) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateDescriptorSetLayout(
VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorSetLayout* pSetLayout,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pSetLayout);
// Check whether any binding uses UPDATE_AFTER_BIND
bool update_after_bind = false;
const auto *flags_create_info = lvl_find_in_chain<VkDescriptorSetLayoutBindingFlagsCreateInfoEXT>(pCreateInfo->pNext);
if (flags_create_info) {
for (uint32_t i = 0; i < flags_create_info->bindingCount; ++i) {
if (flags_create_info->pBindingFlags[i] & VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT) {
update_after_bind = true;
break;
}
}
}
dsl_update_after_bind_map.insert_or_assign(*pSetLayout, update_after_bind);
}
}
void ThreadSafety::PreCallRecordAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo,
VkDescriptorSet *pDescriptorSets) {
StartReadObjectParentInstance(device);
StartWriteObject(pAllocateInfo->descriptorPool);
// Host access to pAllocateInfo::descriptorPool must be externally synchronized
}
void ThreadSafety::PostCallRecordAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo,
VkDescriptorSet *pDescriptorSets, VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(pAllocateInfo->descriptorPool);
// Host access to pAllocateInfo::descriptorPool must be externally synchronized
if (VK_SUCCESS == result) {
auto lock = write_lock_guard_t(thread_safety_lock);
auto &pool_descriptor_sets = pool_descriptor_sets_map[pAllocateInfo->descriptorPool];
for (uint32_t index0 = 0; index0 < pAllocateInfo->descriptorSetCount; index0++) {
CreateObject(pDescriptorSets[index0]);
pool_descriptor_sets.insert(pDescriptorSets[index0]);
auto iter = dsl_update_after_bind_map.find(pAllocateInfo->pSetLayouts[index0]);
if (iter != dsl_update_after_bind_map.end()) {
ds_update_after_bind_map.insert_or_assign(pDescriptorSets[index0], iter->second);
} else {
assert(0 && "descriptor set layout not found");
}
}
}
}
void ThreadSafety::PreCallRecordFreeDescriptorSets(
VkDevice device,
VkDescriptorPool descriptorPool,
uint32_t descriptorSetCount,
const VkDescriptorSet* pDescriptorSets) {
StartReadObjectParentInstance(device);
StartWriteObject(descriptorPool);
if (pDescriptorSets) {
for (uint32_t index=0; index < descriptorSetCount; index++) {
StartWriteObject(pDescriptorSets[index]);
}
}
// Host access to descriptorPool must be externally synchronized
// Host access to each member of pDescriptorSets must be externally synchronized
}
void ThreadSafety::PostCallRecordFreeDescriptorSets(
VkDevice device,
VkDescriptorPool descriptorPool,
uint32_t descriptorSetCount,
const VkDescriptorSet* pDescriptorSets,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(descriptorPool);
if (pDescriptorSets) {
for (uint32_t index=0; index < descriptorSetCount; index++) {
FinishWriteObject(pDescriptorSets[index]);
}
}
// Host access to descriptorPool must be externally synchronized
// Host access to each member of pDescriptorSets must be externally synchronized
// Host access to pAllocateInfo::descriptorPool must be externally synchronized
if (VK_SUCCESS == result) {
auto lock = write_lock_guard_t(thread_safety_lock);
auto &pool_descriptor_sets = pool_descriptor_sets_map[descriptorPool];
for (uint32_t index0 = 0; index0 < descriptorSetCount; index0++) {
DestroyObject(pDescriptorSets[index0]);
pool_descriptor_sets.erase(pDescriptorSets[index0]);
}
}
}
void ThreadSafety::PreCallRecordDestroyDescriptorPool(
VkDevice device,
VkDescriptorPool descriptorPool,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(descriptorPool);
// Host access to descriptorPool must be externally synchronized
auto lock = read_lock_guard_t(thread_safety_lock);
auto iterator = pool_descriptor_sets_map.find(descriptorPool);
// Possible to have no descriptor sets allocated from pool
if (iterator != pool_descriptor_sets_map.end()) {
for(auto descriptor_set : pool_descriptor_sets_map[descriptorPool]) {
StartWriteObject(descriptor_set);
}
}
}
void ThreadSafety::PostCallRecordDestroyDescriptorPool(
VkDevice device,
VkDescriptorPool descriptorPool,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(descriptorPool);
DestroyObject(descriptorPool);
// Host access to descriptorPool must be externally synchronized
{
auto lock = write_lock_guard_t(thread_safety_lock);
// remove references to implicitly freed descriptor sets
for(auto descriptor_set : pool_descriptor_sets_map[descriptorPool]) {
FinishWriteObject(descriptor_set);
DestroyObject(descriptor_set);
}
pool_descriptor_sets_map[descriptorPool].clear();
pool_descriptor_sets_map.erase(descriptorPool);
}
}
void ThreadSafety::PreCallRecordResetDescriptorPool(
VkDevice device,
VkDescriptorPool descriptorPool,
VkDescriptorPoolResetFlags flags) {
StartReadObjectParentInstance(device);
StartWriteObject(descriptorPool);
// Host access to descriptorPool must be externally synchronized
// any sname:VkDescriptorSet objects allocated from pname:descriptorPool must be externally synchronized between host accesses
auto lock = read_lock_guard_t(thread_safety_lock);
auto iterator = pool_descriptor_sets_map.find(descriptorPool);
// Possible to have no descriptor sets allocated from pool
if (iterator != pool_descriptor_sets_map.end()) {
for(auto descriptor_set : pool_descriptor_sets_map[descriptorPool]) {
StartWriteObject(descriptor_set);
}
}
}
void ThreadSafety::PostCallRecordResetDescriptorPool(
VkDevice device,
VkDescriptorPool descriptorPool,
VkDescriptorPoolResetFlags flags,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(descriptorPool);
// Host access to descriptorPool must be externally synchronized
// any sname:VkDescriptorSet objects allocated from pname:descriptorPool must be externally synchronized between host accesses
if (VK_SUCCESS == result) {
// remove references to implicitly freed descriptor sets
auto lock = write_lock_guard_t(thread_safety_lock);
for(auto descriptor_set : pool_descriptor_sets_map[descriptorPool]) {
FinishWriteObject(descriptor_set);
DestroyObject(descriptor_set);
}
pool_descriptor_sets_map[descriptorPool].clear();
}
}
bool ThreadSafety::DsUpdateAfterBind(VkDescriptorSet set) const
{
auto iter = ds_update_after_bind_map.find(set);
if (iter != ds_update_after_bind_map.end()) {
return iter->second;
}
return false;
}
void ThreadSafety::PreCallRecordUpdateDescriptorSets(
VkDevice device,
uint32_t descriptorWriteCount,
const VkWriteDescriptorSet* pDescriptorWrites,
uint32_t descriptorCopyCount,
const VkCopyDescriptorSet* pDescriptorCopies) {
StartReadObjectParentInstance(device);
if (pDescriptorWrites) {
for (uint32_t index=0; index < descriptorWriteCount; index++) {
auto dstSet = pDescriptorWrites[index].dstSet;
bool update_after_bind = DsUpdateAfterBind(dstSet);
if (update_after_bind) {
StartReadObject(dstSet);
} else {
StartWriteObject(dstSet);
}
}
}
if (pDescriptorCopies) {
for (uint32_t index=0; index < descriptorCopyCount; index++) {
auto dstSet = pDescriptorCopies[index].dstSet;
bool update_after_bind = DsUpdateAfterBind(dstSet);
if (update_after_bind) {
StartReadObject(dstSet);
} else {
StartWriteObject(dstSet);
}
StartReadObject(pDescriptorCopies[index].srcSet);
}
}
// Host access to pDescriptorWrites[].dstSet must be externally synchronized
// Host access to pDescriptorCopies[].dstSet must be externally synchronized
}
void ThreadSafety::PostCallRecordUpdateDescriptorSets(
VkDevice device,
uint32_t descriptorWriteCount,
const VkWriteDescriptorSet* pDescriptorWrites,
uint32_t descriptorCopyCount,
const VkCopyDescriptorSet* pDescriptorCopies) {
FinishReadObjectParentInstance(device);
if (pDescriptorWrites) {
for (uint32_t index=0; index < descriptorWriteCount; index++) {
auto dstSet = pDescriptorWrites[index].dstSet;
bool update_after_bind = DsUpdateAfterBind(dstSet);
if (update_after_bind) {
FinishReadObject(dstSet);
} else {
FinishWriteObject(dstSet);
}
}
}
if (pDescriptorCopies) {
for (uint32_t index=0; index < descriptorCopyCount; index++) {
auto dstSet = pDescriptorCopies[index].dstSet;
bool update_after_bind = DsUpdateAfterBind(dstSet);
if (update_after_bind) {
FinishReadObject(dstSet);
} else {
FinishWriteObject(dstSet);
}
FinishReadObject(pDescriptorCopies[index].srcSet);
}
}
// Host access to pDescriptorWrites[].dstSet must be externally synchronized
// Host access to pDescriptorCopies[].dstSet must be externally synchronized
}
void ThreadSafety::PreCallRecordUpdateDescriptorSetWithTemplate(
VkDevice device,
VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const void* pData) {
StartReadObjectParentInstance(device);
StartReadObject(descriptorUpdateTemplate);
bool update_after_bind = DsUpdateAfterBind(descriptorSet);
if (update_after_bind) {
StartReadObject(descriptorSet);
} else {
StartWriteObject(descriptorSet);
}
// Host access to descriptorSet must be externally synchronized
}
void ThreadSafety::PostCallRecordUpdateDescriptorSetWithTemplate(
VkDevice device,
VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const void* pData) {
FinishReadObjectParentInstance(device);
FinishReadObject(descriptorUpdateTemplate);
bool update_after_bind = DsUpdateAfterBind(descriptorSet);
if (update_after_bind) {
FinishReadObject(descriptorSet);
} else {
FinishWriteObject(descriptorSet);
}
// Host access to descriptorSet must be externally synchronized
}
void ThreadSafety::PreCallRecordUpdateDescriptorSetWithTemplateKHR(
VkDevice device,
VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const void* pData) {
StartReadObjectParentInstance(device);
StartReadObject(descriptorUpdateTemplate);
bool update_after_bind = DsUpdateAfterBind(descriptorSet);
if (update_after_bind) {
StartReadObject(descriptorSet);
} else {
StartWriteObject(descriptorSet);
}
// Host access to descriptorSet must be externally synchronized
}
void ThreadSafety::PostCallRecordUpdateDescriptorSetWithTemplateKHR(
VkDevice device,
VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const void* pData) {
FinishReadObjectParentInstance(device);
FinishReadObject(descriptorUpdateTemplate);
bool update_after_bind = DsUpdateAfterBind(descriptorSet);
if (update_after_bind) {
FinishReadObject(descriptorSet);
} else {
FinishWriteObject(descriptorSet);
}
// Host access to descriptorSet must be externally synchronized
}
void ThreadSafety::PreCallRecordFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount,
const VkCommandBuffer *pCommandBuffers) {
const bool lockCommandPool = false; // pool is already directly locked
StartReadObjectParentInstance(device);
StartWriteObject(commandPool);
if(pCommandBuffers) {
// Even though we're immediately "finishing" below, we still are testing for concurrency with any call in process
// so this isn't a no-op
// The driver may immediately reuse command buffers in another thread.
// These updates need to be done before calling down to the driver.
auto lock = write_lock_guard_t(thread_safety_lock);
auto &pool_command_buffers = pool_command_buffers_map[commandPool];
for (uint32_t index = 0; index < commandBufferCount; index++) {
StartWriteObject(pCommandBuffers[index], lockCommandPool);
FinishWriteObject(pCommandBuffers[index], lockCommandPool);
DestroyObject(pCommandBuffers[index]);
pool_command_buffers.erase(pCommandBuffers[index]);
command_pool_map.erase(pCommandBuffers[index]);
}
}
}
void ThreadSafety::PostCallRecordFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount,
const VkCommandBuffer *pCommandBuffers) {
FinishReadObjectParentInstance(device);
FinishWriteObject(commandPool);
}
void ThreadSafety::PreCallRecordCreateCommandPool(
VkDevice device,
const VkCommandPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCommandPool* pCommandPool) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateCommandPool(
VkDevice device,
const VkCommandPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCommandPool* pCommandPool,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pCommandPool);
c_VkCommandPoolContents.CreateObject(*pCommandPool);
}
}
void ThreadSafety::PreCallRecordResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) {
StartReadObjectParentInstance(device);
StartWriteObject(commandPool);
// Check for any uses of non-externally sync'd command buffers (for example from vkCmdExecuteCommands)
c_VkCommandPoolContents.StartWrite(commandPool);
// Host access to commandPool must be externally synchronized
}
void ThreadSafety::PostCallRecordResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags, VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(commandPool);
c_VkCommandPoolContents.FinishWrite(commandPool);
// Host access to commandPool must be externally synchronized
}
void ThreadSafety::PreCallRecordDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(commandPool);
// Check for any uses of non-externally sync'd command buffers (for example from vkCmdExecuteCommands)
c_VkCommandPoolContents.StartWrite(commandPool);
// Host access to commandPool must be externally synchronized
auto lock = write_lock_guard_t(thread_safety_lock);
// The driver may immediately reuse command buffers in another thread.
// These updates need to be done before calling down to the driver.
// remove references to implicitly freed command pools
for(auto command_buffer : pool_command_buffers_map[commandPool]) {
DestroyObject(command_buffer);
}
pool_command_buffers_map[commandPool].clear();
pool_command_buffers_map.erase(commandPool);
}
void ThreadSafety::PostCallRecordDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(commandPool);
DestroyObject(commandPool);
c_VkCommandPoolContents.FinishWrite(commandPool);
c_VkCommandPoolContents.DestroyObject(commandPool);
}
// GetSwapchainImages can return a non-zero count with a NULL pSwapchainImages pointer. Let's avoid crashes by ignoring
// pSwapchainImages.
void ThreadSafety::PreCallRecordGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount,
VkImage *pSwapchainImages) {
StartReadObjectParentInstance(device);
StartReadObject(swapchain);
}
void ThreadSafety::PostCallRecordGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount,
VkImage *pSwapchainImages, VkResult result) {
FinishReadObjectParentInstance(device);
FinishReadObject(swapchain);
if (pSwapchainImages != NULL) {
auto lock = write_lock_guard_t(thread_safety_lock);
auto &wrapped_swapchain_image_handles = swapchain_wrapped_image_handle_map[swapchain];
for (uint32_t i = static_cast<uint32_t>(wrapped_swapchain_image_handles.size()); i < *pSwapchainImageCount; i++) {
CreateObject(pSwapchainImages[i]);
wrapped_swapchain_image_handles.emplace_back(pSwapchainImages[i]);
}
}
}
void ThreadSafety::PreCallRecordDestroySwapchainKHR(
VkDevice device,
VkSwapchainKHR swapchain,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(swapchain);
// Host access to swapchain must be externally synchronized
auto lock = read_lock_guard_t(thread_safety_lock);
for (auto &image_handle : swapchain_wrapped_image_handle_map[swapchain]) {
StartWriteObject(image_handle);
}
}
void ThreadSafety::PostCallRecordDestroySwapchainKHR(
VkDevice device,
VkSwapchainKHR swapchain,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(swapchain);
DestroyObject(swapchain);
// Host access to swapchain must be externally synchronized
auto lock = write_lock_guard_t(thread_safety_lock);
for (auto &image_handle : swapchain_wrapped_image_handle_map[swapchain]) {
FinishWriteObject(image_handle);
DestroyObject(image_handle);
}
swapchain_wrapped_image_handle_map.erase(swapchain);
}
void ThreadSafety::PreCallRecordDestroyDevice(
VkDevice device,
const VkAllocationCallbacks* pAllocator) {
StartWriteObjectParentInstance(device);
// Host access to device must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyDevice(
VkDevice device,
const VkAllocationCallbacks* pAllocator) {
FinishWriteObjectParentInstance(device);
DestroyObjectParentInstance(device);
// Host access to device must be externally synchronized
auto lock = write_lock_guard_t(thread_safety_lock);
for (auto &queue : device_queues_map[device]) {
DestroyObject(queue);
}
device_queues_map[device].clear();
}
void ThreadSafety::PreCallRecordGetDeviceQueue(
VkDevice device,
uint32_t queueFamilyIndex,
uint32_t queueIndex,
VkQueue* pQueue) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordGetDeviceQueue(
VkDevice device,
uint32_t queueFamilyIndex,
uint32_t queueIndex,
VkQueue* pQueue) {
FinishReadObjectParentInstance(device);
CreateObject(*pQueue);
auto lock = write_lock_guard_t(thread_safety_lock);
device_queues_map[device].insert(*pQueue);
}
void ThreadSafety::PreCallRecordGetDeviceQueue2(
VkDevice device,
const VkDeviceQueueInfo2* pQueueInfo,
VkQueue* pQueue) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordGetDeviceQueue2(
VkDevice device,
const VkDeviceQueueInfo2* pQueueInfo,
VkQueue* pQueue) {
FinishReadObjectParentInstance(device);
CreateObject(*pQueue);
auto lock = write_lock_guard_t(thread_safety_lock);
device_queues_map[device].insert(*pQueue);
}
void ThreadSafety::PreCallRecordCreateInstance(
const VkInstanceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance) {
}
void ThreadSafety::PostCallRecordCreateInstance(
const VkInstanceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance,
VkResult result) {
if (result == VK_SUCCESS) {
CreateObjectParentInstance(*pInstance);
}
}
void ThreadSafety::PreCallRecordDestroyInstance(
VkInstance instance,
const VkAllocationCallbacks* pAllocator) {
StartWriteObjectParentInstance(instance);
// Host access to instance must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyInstance(
VkInstance instance,
const VkAllocationCallbacks* pAllocator) {
FinishWriteObjectParentInstance(instance);
DestroyObjectParentInstance(instance);
// Host access to instance must be externally synchronized
}
void ThreadSafety::PreCallRecordEnumeratePhysicalDevices(
VkInstance instance,
uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice* pPhysicalDevices) {
StartReadObjectParentInstance(instance);
}
void ThreadSafety::PostCallRecordEnumeratePhysicalDevices(
VkInstance instance,
uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice* pPhysicalDevices,
VkResult result) {
FinishReadObjectParentInstance(instance);
}
void ThreadSafety::PreCallRecordGetInstanceProcAddr(
VkInstance instance,
const char* pName) {
StartReadObjectParentInstance(instance);
}
void ThreadSafety::PostCallRecordGetInstanceProcAddr(
VkInstance instance,
const char* pName) {
FinishReadObjectParentInstance(instance);
}
void ThreadSafety::PreCallRecordGetDeviceProcAddr(
VkDevice device,
const char* pName) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordGetDeviceProcAddr(
VkDevice device,
const char* pName) {
FinishReadObjectParentInstance(device);
}
void ThreadSafety::PreCallRecordCreateDevice(
VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDevice* pDevice) {
}
void ThreadSafety::PostCallRecordCreateDevice(
VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDevice* pDevice,
VkResult result) {
if (result == VK_SUCCESS) {
CreateObjectParentInstance(*pDevice);
}
}
void ThreadSafety::PreCallRecordQueueSubmit(
VkQueue queue,
uint32_t submitCount,
const VkSubmitInfo* pSubmits,
VkFence fence) {
StartWriteObject(queue);
StartWriteObject(fence);
// Host access to queue must be externally synchronized
// Host access to fence must be externally synchronized
}
void ThreadSafety::PostCallRecordQueueSubmit(
VkQueue queue,
uint32_t submitCount,
const VkSubmitInfo* pSubmits,
VkFence fence,
VkResult result) {
FinishWriteObject(queue);
FinishWriteObject(fence);
// Host access to queue must be externally synchronized
// Host access to fence must be externally synchronized
}
void ThreadSafety::PreCallRecordQueueWaitIdle(
VkQueue queue) {
StartWriteObject(queue);
// Host access to queue must be externally synchronized
}
void ThreadSafety::PostCallRecordQueueWaitIdle(
VkQueue queue,
VkResult result) {
FinishWriteObject(queue);
// Host access to queue must be externally synchronized
}
void ThreadSafety::PreCallRecordDeviceWaitIdle(
VkDevice device) {
StartReadObjectParentInstance(device);
// all sname:VkQueue objects created from pname:device must be externally synchronized between host accesses
}
void ThreadSafety::PostCallRecordDeviceWaitIdle(
VkDevice device,
VkResult result) {
FinishReadObjectParentInstance(device);
// all sname:VkQueue objects created from pname:device must be externally synchronized between host accesses
}
void ThreadSafety::PreCallRecordAllocateMemory(
VkDevice device,
const VkMemoryAllocateInfo* pAllocateInfo,
const VkAllocationCallbacks* pAllocator,
VkDeviceMemory* pMemory) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordAllocateMemory(
VkDevice device,
const VkMemoryAllocateInfo* pAllocateInfo,
const VkAllocationCallbacks* pAllocator,
VkDeviceMemory* pMemory,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pMemory);
}
}
void ThreadSafety::PreCallRecordFreeMemory(
VkDevice device,
VkDeviceMemory memory,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(memory);
// Host access to memory must be externally synchronized
}
void ThreadSafety::PostCallRecordFreeMemory(
VkDevice device,
VkDeviceMemory memory,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(memory);
DestroyObject(memory);
// Host access to memory must be externally synchronized
}
void ThreadSafety::PreCallRecordMapMemory(
VkDevice device,
VkDeviceMemory memory,
VkDeviceSize offset,
VkDeviceSize size,
VkMemoryMapFlags flags,
void** ppData) {
StartReadObjectParentInstance(device);
StartWriteObject(memory);
// Host access to memory must be externally synchronized
}
void ThreadSafety::PostCallRecordMapMemory(
VkDevice device,
VkDeviceMemory memory,
VkDeviceSize offset,
VkDeviceSize size,
VkMemoryMapFlags flags,
void** ppData,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(memory);
// Host access to memory must be externally synchronized
}
void ThreadSafety::PreCallRecordUnmapMemory(
VkDevice device,
VkDeviceMemory memory) {
StartReadObjectParentInstance(device);
StartWriteObject(memory);
// Host access to memory must be externally synchronized
}
void ThreadSafety::PostCallRecordUnmapMemory(
VkDevice device,
VkDeviceMemory memory) {
FinishReadObjectParentInstance(device);
FinishWriteObject(memory);
// Host access to memory must be externally synchronized
}
void ThreadSafety::PreCallRecordFlushMappedMemoryRanges(
VkDevice device,
uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordFlushMappedMemoryRanges(
VkDevice device,
uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges,
VkResult result) {
FinishReadObjectParentInstance(device);
}
void ThreadSafety::PreCallRecordInvalidateMappedMemoryRanges(
VkDevice device,
uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordInvalidateMappedMemoryRanges(
VkDevice device,
uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges,
VkResult result) {
FinishReadObjectParentInstance(device);
}
void ThreadSafety::PreCallRecordGetDeviceMemoryCommitment(
VkDevice device,
VkDeviceMemory memory,
VkDeviceSize* pCommittedMemoryInBytes) {
StartReadObjectParentInstance(device);
StartReadObject(memory);
}
void ThreadSafety::PostCallRecordGetDeviceMemoryCommitment(
VkDevice device,
VkDeviceMemory memory,
VkDeviceSize* pCommittedMemoryInBytes) {
FinishReadObjectParentInstance(device);
FinishReadObject(memory);
}
void ThreadSafety::PreCallRecordBindBufferMemory(
VkDevice device,
VkBuffer buffer,
VkDeviceMemory memory,
VkDeviceSize memoryOffset) {
StartReadObjectParentInstance(device);
StartWriteObject(buffer);
StartReadObject(memory);
// Host access to buffer must be externally synchronized
}
void ThreadSafety::PostCallRecordBindBufferMemory(
VkDevice device,
VkBuffer buffer,
VkDeviceMemory memory,
VkDeviceSize memoryOffset,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(buffer);
FinishReadObject(memory);
// Host access to buffer must be externally synchronized
}
void ThreadSafety::PreCallRecordBindImageMemory(
VkDevice device,
VkImage image,
VkDeviceMemory memory,
VkDeviceSize memoryOffset) {
StartReadObjectParentInstance(device);
StartWriteObject(image);
StartReadObject(memory);
// Host access to image must be externally synchronized
}
void ThreadSafety::PostCallRecordBindImageMemory(
VkDevice device,
VkImage image,
VkDeviceMemory memory,
VkDeviceSize memoryOffset,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(image);
FinishReadObject(memory);
// Host access to image must be externally synchronized
}
void ThreadSafety::PreCallRecordGetBufferMemoryRequirements(
VkDevice device,
VkBuffer buffer,
VkMemoryRequirements* pMemoryRequirements) {
StartReadObjectParentInstance(device);
StartReadObject(buffer);
}
void ThreadSafety::PostCallRecordGetBufferMemoryRequirements(
VkDevice device,
VkBuffer buffer,
VkMemoryRequirements* pMemoryRequirements) {
FinishReadObjectParentInstance(device);
FinishReadObject(buffer);
}
void ThreadSafety::PreCallRecordGetImageMemoryRequirements(
VkDevice device,
VkImage image,
VkMemoryRequirements* pMemoryRequirements) {
StartReadObjectParentInstance(device);
StartReadObject(image);
}
void ThreadSafety::PostCallRecordGetImageMemoryRequirements(
VkDevice device,
VkImage image,
VkMemoryRequirements* pMemoryRequirements) {
FinishReadObjectParentInstance(device);
FinishReadObject(image);
}
void ThreadSafety::PreCallRecordGetImageSparseMemoryRequirements(
VkDevice device,
VkImage image,
uint32_t* pSparseMemoryRequirementCount,
VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
StartReadObjectParentInstance(device);
StartReadObject(image);
}
void ThreadSafety::PostCallRecordGetImageSparseMemoryRequirements(
VkDevice device,
VkImage image,
uint32_t* pSparseMemoryRequirementCount,
VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
FinishReadObjectParentInstance(device);
FinishReadObject(image);
}
void ThreadSafety::PreCallRecordQueueBindSparse(
VkQueue queue,
uint32_t bindInfoCount,
const VkBindSparseInfo* pBindInfo,
VkFence fence) {
StartWriteObject(queue);
if (pBindInfo) {
for (uint32_t index=0; index < bindInfoCount; index++) {
if (pBindInfo[index].pBufferBinds) {
for (uint32_t index2=0; index2 < pBindInfo[index].bufferBindCount; index2++) {
StartWriteObject(pBindInfo[index].pBufferBinds[index2].buffer);
}
}
if (pBindInfo[index].pImageOpaqueBinds) {
for (uint32_t index2=0; index2 < pBindInfo[index].imageOpaqueBindCount; index2++) {
StartWriteObject(pBindInfo[index].pImageOpaqueBinds[index2].image);
}
}
if (pBindInfo[index].pImageBinds) {
for (uint32_t index2=0; index2 < pBindInfo[index].imageBindCount; index2++) {
StartWriteObject(pBindInfo[index].pImageBinds[index2].image);
}
}
}
}
StartWriteObject(fence);
// Host access to queue must be externally synchronized
// Host access to pBindInfo[].pBufferBinds[].buffer,pBindInfo[].pImageOpaqueBinds[].image,pBindInfo[].pImageBinds[].image must be externally synchronized
// Host access to fence must be externally synchronized
}
void ThreadSafety::PostCallRecordQueueBindSparse(
VkQueue queue,
uint32_t bindInfoCount,
const VkBindSparseInfo* pBindInfo,
VkFence fence,
VkResult result) {
FinishWriteObject(queue);
if (pBindInfo) {
for (uint32_t index=0; index < bindInfoCount; index++) {
if (pBindInfo[index].pBufferBinds) {
for (uint32_t index2=0; index2 < pBindInfo[index].bufferBindCount; index2++) {
FinishWriteObject(pBindInfo[index].pBufferBinds[index2].buffer);
}
}
if (pBindInfo[index].pImageOpaqueBinds) {
for (uint32_t index2=0; index2 < pBindInfo[index].imageOpaqueBindCount; index2++) {
FinishWriteObject(pBindInfo[index].pImageOpaqueBinds[index2].image);
}
}
if (pBindInfo[index].pImageBinds) {
for (uint32_t index2=0; index2 < pBindInfo[index].imageBindCount; index2++) {
FinishWriteObject(pBindInfo[index].pImageBinds[index2].image);
}
}
}
}
FinishWriteObject(fence);
// Host access to queue must be externally synchronized
// Host access to pBindInfo[].pBufferBinds[].buffer,pBindInfo[].pImageOpaqueBinds[].image,pBindInfo[].pImageBinds[].image must be externally synchronized
// Host access to fence must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateFence(
VkDevice device,
const VkFenceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkFence* pFence) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateFence(
VkDevice device,
const VkFenceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkFence* pFence,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pFence);
}
}
void ThreadSafety::PreCallRecordDestroyFence(
VkDevice device,
VkFence fence,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(fence);
// Host access to fence must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyFence(
VkDevice device,
VkFence fence,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(fence);
DestroyObject(fence);
// Host access to fence must be externally synchronized
}
void ThreadSafety::PreCallRecordResetFences(
VkDevice device,
uint32_t fenceCount,
const VkFence* pFences) {
StartReadObjectParentInstance(device);
if (pFences) {
for (uint32_t index=0; index < fenceCount; index++) {
StartWriteObject(pFences[index]);
}
}
// Host access to each member of pFences must be externally synchronized
}
void ThreadSafety::PostCallRecordResetFences(
VkDevice device,
uint32_t fenceCount,
const VkFence* pFences,
VkResult result) {
FinishReadObjectParentInstance(device);
if (pFences) {
for (uint32_t index=0; index < fenceCount; index++) {
FinishWriteObject(pFences[index]);
}
}
// Host access to each member of pFences must be externally synchronized
}
void ThreadSafety::PreCallRecordGetFenceStatus(
VkDevice device,
VkFence fence) {
StartReadObjectParentInstance(device);
StartReadObject(fence);
}
void ThreadSafety::PostCallRecordGetFenceStatus(
VkDevice device,
VkFence fence,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishReadObject(fence);
}
void ThreadSafety::PreCallRecordWaitForFences(
VkDevice device,
uint32_t fenceCount,
const VkFence* pFences,
VkBool32 waitAll,
uint64_t timeout) {
StartReadObjectParentInstance(device);
if (pFences) {
for (uint32_t index = 0; index < fenceCount; index++) {
StartReadObject(pFences[index]);
}
}
}
void ThreadSafety::PostCallRecordWaitForFences(
VkDevice device,
uint32_t fenceCount,
const VkFence* pFences,
VkBool32 waitAll,
uint64_t timeout,
VkResult result) {
FinishReadObjectParentInstance(device);
if (pFences) {
for (uint32_t index = 0; index < fenceCount; index++) {
FinishReadObject(pFences[index]);
}
}
}
void ThreadSafety::PreCallRecordCreateSemaphore(
VkDevice device,
const VkSemaphoreCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSemaphore* pSemaphore) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateSemaphore(
VkDevice device,
const VkSemaphoreCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSemaphore* pSemaphore,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pSemaphore);
}
}
void ThreadSafety::PreCallRecordDestroySemaphore(
VkDevice device,
VkSemaphore semaphore,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(semaphore);
// Host access to semaphore must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroySemaphore(
VkDevice device,
VkSemaphore semaphore,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(semaphore);
DestroyObject(semaphore);
// Host access to semaphore must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateEvent(
VkDevice device,
const VkEventCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkEvent* pEvent) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateEvent(
VkDevice device,
const VkEventCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkEvent* pEvent,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pEvent);
}
}
void ThreadSafety::PreCallRecordDestroyEvent(
VkDevice device,
VkEvent event,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(event);
// Host access to event must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyEvent(
VkDevice device,
VkEvent event,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(event);
DestroyObject(event);
// Host access to event must be externally synchronized
}
void ThreadSafety::PreCallRecordGetEventStatus(
VkDevice device,
VkEvent event) {
StartReadObjectParentInstance(device);
StartReadObject(event);
}
void ThreadSafety::PostCallRecordGetEventStatus(
VkDevice device,
VkEvent event,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishReadObject(event);
}
void ThreadSafety::PreCallRecordSetEvent(
VkDevice device,
VkEvent event) {
StartReadObjectParentInstance(device);
StartWriteObject(event);
// Host access to event must be externally synchronized
}
void ThreadSafety::PostCallRecordSetEvent(
VkDevice device,
VkEvent event,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(event);
// Host access to event must be externally synchronized
}
void ThreadSafety::PreCallRecordResetEvent(
VkDevice device,
VkEvent event) {
StartReadObjectParentInstance(device);
StartWriteObject(event);
// Host access to event must be externally synchronized
}
void ThreadSafety::PostCallRecordResetEvent(
VkDevice device,
VkEvent event,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(event);
// Host access to event must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateQueryPool(
VkDevice device,
const VkQueryPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkQueryPool* pQueryPool) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateQueryPool(
VkDevice device,
const VkQueryPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkQueryPool* pQueryPool,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pQueryPool);
}
}
void ThreadSafety::PreCallRecordDestroyQueryPool(
VkDevice device,
VkQueryPool queryPool,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(queryPool);
// Host access to queryPool must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyQueryPool(
VkDevice device,
VkQueryPool queryPool,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(queryPool);
DestroyObject(queryPool);
// Host access to queryPool must be externally synchronized
}
void ThreadSafety::PreCallRecordGetQueryPoolResults(
VkDevice device,
VkQueryPool queryPool,
uint32_t firstQuery,
uint32_t queryCount,
size_t dataSize,
void* pData,
VkDeviceSize stride,
VkQueryResultFlags flags) {
StartReadObjectParentInstance(device);
StartReadObject(queryPool);
}
void ThreadSafety::PostCallRecordGetQueryPoolResults(
VkDevice device,
VkQueryPool queryPool,
uint32_t firstQuery,
uint32_t queryCount,
size_t dataSize,
void* pData,
VkDeviceSize stride,
VkQueryResultFlags flags,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishReadObject(queryPool);
}
void ThreadSafety::PreCallRecordCreateBuffer(
VkDevice device,
const VkBufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBuffer* pBuffer) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateBuffer(
VkDevice device,
const VkBufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBuffer* pBuffer,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pBuffer);
}
}
void ThreadSafety::PreCallRecordDestroyBuffer(
VkDevice device,
VkBuffer buffer,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(buffer);
// Host access to buffer must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyBuffer(
VkDevice device,
VkBuffer buffer,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(buffer);
DestroyObject(buffer);
// Host access to buffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateBufferView(
VkDevice device,
const VkBufferViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBufferView* pView) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateBufferView(
VkDevice device,
const VkBufferViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBufferView* pView,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pView);
}
}
void ThreadSafety::PreCallRecordDestroyBufferView(
VkDevice device,
VkBufferView bufferView,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(bufferView);
// Host access to bufferView must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyBufferView(
VkDevice device,
VkBufferView bufferView,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(bufferView);
DestroyObject(bufferView);
// Host access to bufferView must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateImage(
VkDevice device,
const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImage* pImage) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateImage(
VkDevice device,
const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImage* pImage,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pImage);
}
}
void ThreadSafety::PreCallRecordDestroyImage(
VkDevice device,
VkImage image,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(image);
// Host access to image must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyImage(
VkDevice device,
VkImage image,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(image);
DestroyObject(image);
// Host access to image must be externally synchronized
}
void ThreadSafety::PreCallRecordGetImageSubresourceLayout(
VkDevice device,
VkImage image,
const VkImageSubresource* pSubresource,
VkSubresourceLayout* pLayout) {
StartReadObjectParentInstance(device);
StartReadObject(image);
}
void ThreadSafety::PostCallRecordGetImageSubresourceLayout(
VkDevice device,
VkImage image,
const VkImageSubresource* pSubresource,
VkSubresourceLayout* pLayout) {
FinishReadObjectParentInstance(device);
FinishReadObject(image);
}
void ThreadSafety::PreCallRecordCreateImageView(
VkDevice device,
const VkImageViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImageView* pView) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateImageView(
VkDevice device,
const VkImageViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImageView* pView,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pView);
}
}
void ThreadSafety::PreCallRecordDestroyImageView(
VkDevice device,
VkImageView imageView,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(imageView);
// Host access to imageView must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyImageView(
VkDevice device,
VkImageView imageView,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(imageView);
DestroyObject(imageView);
// Host access to imageView must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateShaderModule(
VkDevice device,
const VkShaderModuleCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkShaderModule* pShaderModule) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateShaderModule(
VkDevice device,
const VkShaderModuleCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkShaderModule* pShaderModule,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pShaderModule);
}
}
void ThreadSafety::PreCallRecordDestroyShaderModule(
VkDevice device,
VkShaderModule shaderModule,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(shaderModule);
// Host access to shaderModule must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyShaderModule(
VkDevice device,
VkShaderModule shaderModule,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(shaderModule);
DestroyObject(shaderModule);
// Host access to shaderModule must be externally synchronized
}
void ThreadSafety::PreCallRecordCreatePipelineCache(
VkDevice device,
const VkPipelineCacheCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkPipelineCache* pPipelineCache) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreatePipelineCache(
VkDevice device,
const VkPipelineCacheCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkPipelineCache* pPipelineCache,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pPipelineCache);
}
}
void ThreadSafety::PreCallRecordDestroyPipelineCache(
VkDevice device,
VkPipelineCache pipelineCache,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(pipelineCache);
// Host access to pipelineCache must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyPipelineCache(
VkDevice device,
VkPipelineCache pipelineCache,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(pipelineCache);
DestroyObject(pipelineCache);
// Host access to pipelineCache must be externally synchronized
}
void ThreadSafety::PreCallRecordGetPipelineCacheData(
VkDevice device,
VkPipelineCache pipelineCache,
size_t* pDataSize,
void* pData) {
StartReadObjectParentInstance(device);
StartReadObject(pipelineCache);
}
void ThreadSafety::PostCallRecordGetPipelineCacheData(
VkDevice device,
VkPipelineCache pipelineCache,
size_t* pDataSize,
void* pData,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishReadObject(pipelineCache);
}
void ThreadSafety::PreCallRecordMergePipelineCaches(
VkDevice device,
VkPipelineCache dstCache,
uint32_t srcCacheCount,
const VkPipelineCache* pSrcCaches) {
StartReadObjectParentInstance(device);
StartWriteObject(dstCache);
if (pSrcCaches) {
for (uint32_t index = 0; index < srcCacheCount; index++) {
StartReadObject(pSrcCaches[index]);
}
}
// Host access to dstCache must be externally synchronized
}
void ThreadSafety::PostCallRecordMergePipelineCaches(
VkDevice device,
VkPipelineCache dstCache,
uint32_t srcCacheCount,
const VkPipelineCache* pSrcCaches,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishWriteObject(dstCache);
if (pSrcCaches) {
for (uint32_t index = 0; index < srcCacheCount; index++) {
FinishReadObject(pSrcCaches[index]);
}
}
// Host access to dstCache must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateGraphicsPipelines(
VkDevice device,
VkPipelineCache pipelineCache,
uint32_t createInfoCount,
const VkGraphicsPipelineCreateInfo* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines) {
StartReadObjectParentInstance(device);
StartReadObject(pipelineCache);
}
void ThreadSafety::PostCallRecordCreateGraphicsPipelines(
VkDevice device,
VkPipelineCache pipelineCache,
uint32_t createInfoCount,
const VkGraphicsPipelineCreateInfo* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishReadObject(pipelineCache);
if (pPipelines) {
for (uint32_t index = 0; index < createInfoCount; index++) {
if (!pPipelines[index]) continue;
CreateObject(pPipelines[index]);
}
}
}
void ThreadSafety::PreCallRecordCreateComputePipelines(
VkDevice device,
VkPipelineCache pipelineCache,
uint32_t createInfoCount,
const VkComputePipelineCreateInfo* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines) {
StartReadObjectParentInstance(device);
StartReadObject(pipelineCache);
}
void ThreadSafety::PostCallRecordCreateComputePipelines(
VkDevice device,
VkPipelineCache pipelineCache,
uint32_t createInfoCount,
const VkComputePipelineCreateInfo* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines,
VkResult result) {
FinishReadObjectParentInstance(device);
FinishReadObject(pipelineCache);
if (pPipelines) {
for (uint32_t index = 0; index < createInfoCount; index++) {
if (!pPipelines[index]) continue;
CreateObject(pPipelines[index]);
}
}
}
void ThreadSafety::PreCallRecordDestroyPipeline(
VkDevice device,
VkPipeline pipeline,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(pipeline);
// Host access to pipeline must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyPipeline(
VkDevice device,
VkPipeline pipeline,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(pipeline);
DestroyObject(pipeline);
// Host access to pipeline must be externally synchronized
}
void ThreadSafety::PreCallRecordCreatePipelineLayout(
VkDevice device,
const VkPipelineLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkPipelineLayout* pPipelineLayout) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreatePipelineLayout(
VkDevice device,
const VkPipelineLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkPipelineLayout* pPipelineLayout,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pPipelineLayout);
}
}
void ThreadSafety::PreCallRecordDestroyPipelineLayout(
VkDevice device,
VkPipelineLayout pipelineLayout,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(pipelineLayout);
// Host access to pipelineLayout must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyPipelineLayout(
VkDevice device,
VkPipelineLayout pipelineLayout,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(pipelineLayout);
DestroyObject(pipelineLayout);
// Host access to pipelineLayout must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateSampler(
VkDevice device,
const VkSamplerCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSampler* pSampler) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateSampler(
VkDevice device,
const VkSamplerCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSampler* pSampler,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pSampler);
}
}
void ThreadSafety::PreCallRecordDestroySampler(
VkDevice device,
VkSampler sampler,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(sampler);
// Host access to sampler must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroySampler(
VkDevice device,
VkSampler sampler,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(sampler);
DestroyObject(sampler);
// Host access to sampler must be externally synchronized
}
void ThreadSafety::PreCallRecordDestroyDescriptorSetLayout(
VkDevice device,
VkDescriptorSetLayout descriptorSetLayout,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(descriptorSetLayout);
// Host access to descriptorSetLayout must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyDescriptorSetLayout(
VkDevice device,
VkDescriptorSetLayout descriptorSetLayout,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(descriptorSetLayout);
DestroyObject(descriptorSetLayout);
// Host access to descriptorSetLayout must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateDescriptorPool(
VkDevice device,
const VkDescriptorPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorPool* pDescriptorPool) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateDescriptorPool(
VkDevice device,
const VkDescriptorPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorPool* pDescriptorPool,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pDescriptorPool);
}
}
void ThreadSafety::PreCallRecordCreateFramebuffer(
VkDevice device,
const VkFramebufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkFramebuffer* pFramebuffer) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateFramebuffer(
VkDevice device,
const VkFramebufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkFramebuffer* pFramebuffer,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pFramebuffer);
}
}
void ThreadSafety::PreCallRecordDestroyFramebuffer(
VkDevice device,
VkFramebuffer framebuffer,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(framebuffer);
// Host access to framebuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyFramebuffer(
VkDevice device,
VkFramebuffer framebuffer,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(framebuffer);
DestroyObject(framebuffer);
// Host access to framebuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCreateRenderPass(
VkDevice device,
const VkRenderPassCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkRenderPass* pRenderPass) {
StartReadObjectParentInstance(device);
}
void ThreadSafety::PostCallRecordCreateRenderPass(
VkDevice device,
const VkRenderPassCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkRenderPass* pRenderPass,
VkResult result) {
FinishReadObjectParentInstance(device);
if (result == VK_SUCCESS) {
CreateObject(*pRenderPass);
}
}
void ThreadSafety::PreCallRecordDestroyRenderPass(
VkDevice device,
VkRenderPass renderPass,
const VkAllocationCallbacks* pAllocator) {
StartReadObjectParentInstance(device);
StartWriteObject(renderPass);
// Host access to renderPass must be externally synchronized
}
void ThreadSafety::PostCallRecordDestroyRenderPass(
VkDevice device,
VkRenderPass renderPass,
const VkAllocationCallbacks* pAllocator) {
FinishReadObjectParentInstance(device);
FinishWriteObject(renderPass);
DestroyObject(renderPass);
// Host access to renderPass must be externally synchronized
}
void ThreadSafety::PreCallRecordGetRenderAreaGranularity(
VkDevice device,
VkRenderPass renderPass,
VkExtent2D* pGranularity) {
StartReadObjectParentInstance(device);
StartReadObject(renderPass);
}
void ThreadSafety::PostCallRecordGetRenderAreaGranularity(
VkDevice device,
VkRenderPass renderPass,
VkExtent2D* pGranularity) {
FinishReadObjectParentInstance(device);
FinishReadObject(renderPass);
}
void ThreadSafety::PreCallRecordBeginCommandBuffer(
VkCommandBuffer commandBuffer,
const VkCommandBufferBeginInfo* pBeginInfo) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
// the sname:VkCommandPool that pname:commandBuffer was allocated from must be externally synchronized between host accesses
}
void ThreadSafety::PostCallRecordBeginCommandBuffer(
VkCommandBuffer commandBuffer,
const VkCommandBufferBeginInfo* pBeginInfo,
VkResult result) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
// the sname:VkCommandPool that pname:commandBuffer was allocated from must be externally synchronized between host accesses
}
void ThreadSafety::PreCallRecordEndCommandBuffer(
VkCommandBuffer commandBuffer) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
// the sname:VkCommandPool that pname:commandBuffer was allocated from must be externally synchronized between host accesses
}
void ThreadSafety::PostCallRecordEndCommandBuffer(
VkCommandBuffer commandBuffer,
VkResult result) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
// the sname:VkCommandPool that pname:commandBuffer was allocated from must be externally synchronized between host accesses
}
void ThreadSafety::PreCallRecordResetCommandBuffer(
VkCommandBuffer commandBuffer,
VkCommandBufferResetFlags flags) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordResetCommandBuffer(
VkCommandBuffer commandBuffer,
VkCommandBufferResetFlags flags,
VkResult result) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdBindPipeline(
VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint,
VkPipeline pipeline) {
StartWriteObject(commandBuffer);
StartReadObject(pipeline);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdBindPipeline(
VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint,
VkPipeline pipeline) {
FinishWriteObject(commandBuffer);
FinishReadObject(pipeline);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetViewport(
VkCommandBuffer commandBuffer,
uint32_t firstViewport,
uint32_t viewportCount,
const VkViewport* pViewports) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetViewport(
VkCommandBuffer commandBuffer,
uint32_t firstViewport,
uint32_t viewportCount,
const VkViewport* pViewports) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetScissor(
VkCommandBuffer commandBuffer,
uint32_t firstScissor,
uint32_t scissorCount,
const VkRect2D* pScissors) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetScissor(
VkCommandBuffer commandBuffer,
uint32_t firstScissor,
uint32_t scissorCount,
const VkRect2D* pScissors) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetLineWidth(
VkCommandBuffer commandBuffer,
float lineWidth) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetLineWidth(
VkCommandBuffer commandBuffer,
float lineWidth) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetDepthBias(
VkCommandBuffer commandBuffer,
float depthBiasConstantFactor,
float depthBiasClamp,
float depthBiasSlopeFactor) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetDepthBias(
VkCommandBuffer commandBuffer,
float depthBiasConstantFactor,
float depthBiasClamp,
float depthBiasSlopeFactor) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetBlendConstants(
VkCommandBuffer commandBuffer,
const float blendConstants[4]) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetBlendConstants(
VkCommandBuffer commandBuffer,
const float blendConstants[4]) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetDepthBounds(
VkCommandBuffer commandBuffer,
float minDepthBounds,
float maxDepthBounds) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetDepthBounds(
VkCommandBuffer commandBuffer,
float minDepthBounds,
float maxDepthBounds) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetStencilCompareMask(
VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask,
uint32_t compareMask) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetStencilCompareMask(
VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask,
uint32_t compareMask) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetStencilWriteMask(
VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask,
uint32_t writeMask) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetStencilWriteMask(
VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask,
uint32_t writeMask) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetStencilReference(
VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask,
uint32_t reference) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetStencilReference(
VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask,
uint32_t reference) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdBindDescriptorSets(
VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint,
VkPipelineLayout layout,
uint32_t firstSet,
uint32_t descriptorSetCount,
const VkDescriptorSet* pDescriptorSets,
uint32_t dynamicOffsetCount,
const uint32_t* pDynamicOffsets) {
StartWriteObject(commandBuffer);
StartReadObject(layout);
if (pDescriptorSets) {
for (uint32_t index = 0; index < descriptorSetCount; index++) {
StartReadObject(pDescriptorSets[index]);
}
}
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdBindDescriptorSets(
VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint,
VkPipelineLayout layout,
uint32_t firstSet,
uint32_t descriptorSetCount,
const VkDescriptorSet* pDescriptorSets,
uint32_t dynamicOffsetCount,
const uint32_t* pDynamicOffsets) {
FinishWriteObject(commandBuffer);
FinishReadObject(layout);
if (pDescriptorSets) {
for (uint32_t index = 0; index < descriptorSetCount; index++) {
FinishReadObject(pDescriptorSets[index]);
}
}
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdBindIndexBuffer(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkIndexType indexType) {
StartWriteObject(commandBuffer);
StartReadObject(buffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdBindIndexBuffer(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkIndexType indexType) {
FinishWriteObject(commandBuffer);
FinishReadObject(buffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdBindVertexBuffers(
VkCommandBuffer commandBuffer,
uint32_t firstBinding,
uint32_t bindingCount,
const VkBuffer* pBuffers,
const VkDeviceSize* pOffsets) {
StartWriteObject(commandBuffer);
if (pBuffers) {
for (uint32_t index = 0; index < bindingCount; index++) {
StartReadObject(pBuffers[index]);
}
}
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdBindVertexBuffers(
VkCommandBuffer commandBuffer,
uint32_t firstBinding,
uint32_t bindingCount,
const VkBuffer* pBuffers,
const VkDeviceSize* pOffsets) {
FinishWriteObject(commandBuffer);
if (pBuffers) {
for (uint32_t index = 0; index < bindingCount; index++) {
FinishReadObject(pBuffers[index]);
}
}
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdDraw(
VkCommandBuffer commandBuffer,
uint32_t vertexCount,
uint32_t instanceCount,
uint32_t firstVertex,
uint32_t firstInstance) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdDraw(
VkCommandBuffer commandBuffer,
uint32_t vertexCount,
uint32_t instanceCount,
uint32_t firstVertex,
uint32_t firstInstance) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdDrawIndexed(
VkCommandBuffer commandBuffer,
uint32_t indexCount,
uint32_t instanceCount,
uint32_t firstIndex,
int32_t vertexOffset,
uint32_t firstInstance) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdDrawIndexed(
VkCommandBuffer commandBuffer,
uint32_t indexCount,
uint32_t instanceCount,
uint32_t firstIndex,
int32_t vertexOffset,
uint32_t firstInstance) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdDrawIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t drawCount,
uint32_t stride) {
StartWriteObject(commandBuffer);
StartReadObject(buffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdDrawIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t drawCount,
uint32_t stride) {
FinishWriteObject(commandBuffer);
FinishReadObject(buffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdDrawIndexedIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t drawCount,
uint32_t stride) {
StartWriteObject(commandBuffer);
StartReadObject(buffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdDrawIndexedIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t drawCount,
uint32_t stride) {
FinishWriteObject(commandBuffer);
FinishReadObject(buffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdDispatch(
VkCommandBuffer commandBuffer,
uint32_t groupCountX,
uint32_t groupCountY,
uint32_t groupCountZ) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdDispatch(
VkCommandBuffer commandBuffer,
uint32_t groupCountX,
uint32_t groupCountY,
uint32_t groupCountZ) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdDispatchIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset) {
StartWriteObject(commandBuffer);
StartReadObject(buffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdDispatchIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset) {
FinishWriteObject(commandBuffer);
FinishReadObject(buffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdCopyBuffer(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
VkBuffer dstBuffer,
uint32_t regionCount,
const VkBufferCopy* pRegions) {
StartWriteObject(commandBuffer);
StartReadObject(srcBuffer);
StartReadObject(dstBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdCopyBuffer(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
VkBuffer dstBuffer,
uint32_t regionCount,
const VkBufferCopy* pRegions) {
FinishWriteObject(commandBuffer);
FinishReadObject(srcBuffer);
FinishReadObject(dstBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdCopyImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageCopy* pRegions) {
StartWriteObject(commandBuffer);
StartReadObject(srcImage);
StartReadObject(dstImage);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdCopyImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageCopy* pRegions) {
FinishWriteObject(commandBuffer);
FinishReadObject(srcImage);
FinishReadObject(dstImage);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdBlitImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageBlit* pRegions,
VkFilter filter) {
StartWriteObject(commandBuffer);
StartReadObject(srcImage);
StartReadObject(dstImage);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdBlitImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageBlit* pRegions,
VkFilter filter) {
FinishWriteObject(commandBuffer);
FinishReadObject(srcImage);
FinishReadObject(dstImage);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdCopyBufferToImage(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkBufferImageCopy* pRegions) {
StartWriteObject(commandBuffer);
StartReadObject(srcBuffer);
StartReadObject(dstImage);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdCopyBufferToImage(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkBufferImageCopy* pRegions) {
FinishWriteObject(commandBuffer);
FinishReadObject(srcBuffer);
FinishReadObject(dstImage);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdCopyImageToBuffer(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkBuffer dstBuffer,
uint32_t regionCount,
const VkBufferImageCopy* pRegions) {
StartWriteObject(commandBuffer);
StartReadObject(srcImage);
StartReadObject(dstBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdCopyImageToBuffer(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkBuffer dstBuffer,
uint32_t regionCount,
const VkBufferImageCopy* pRegions) {
FinishWriteObject(commandBuffer);
FinishReadObject(srcImage);
FinishReadObject(dstBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdUpdateBuffer(
VkCommandBuffer commandBuffer,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize dataSize,
const void* pData) {
StartWriteObject(commandBuffer);
StartReadObject(dstBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdUpdateBuffer(
VkCommandBuffer commandBuffer,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize dataSize,
const void* pData) {
FinishWriteObject(commandBuffer);
FinishReadObject(dstBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdFillBuffer(
VkCommandBuffer commandBuffer,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize size,
uint32_t data) {
StartWriteObject(commandBuffer);
StartReadObject(dstBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdFillBuffer(
VkCommandBuffer commandBuffer,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize size,
uint32_t data) {
FinishWriteObject(commandBuffer);
FinishReadObject(dstBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdClearColorImage(
VkCommandBuffer commandBuffer,
VkImage image,
VkImageLayout imageLayout,
const VkClearColorValue* pColor,
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges) {
StartWriteObject(commandBuffer);
StartReadObject(image);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdClearColorImage(
VkCommandBuffer commandBuffer,
VkImage image,
VkImageLayout imageLayout,
const VkClearColorValue* pColor,
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges) {
FinishWriteObject(commandBuffer);
FinishReadObject(image);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdClearDepthStencilImage(
VkCommandBuffer commandBuffer,
VkImage image,
VkImageLayout imageLayout,
const VkClearDepthStencilValue* pDepthStencil,
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges) {
StartWriteObject(commandBuffer);
StartReadObject(image);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdClearDepthStencilImage(
VkCommandBuffer commandBuffer,
VkImage image,
VkImageLayout imageLayout,
const VkClearDepthStencilValue* pDepthStencil,
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges) {
FinishWriteObject(commandBuffer);
FinishReadObject(image);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdClearAttachments(
VkCommandBuffer commandBuffer,
uint32_t attachmentCount,
const VkClearAttachment* pAttachments,
uint32_t rectCount,
const VkClearRect* pRects) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdClearAttachments(
VkCommandBuffer commandBuffer,
uint32_t attachmentCount,
const VkClearAttachment* pAttachments,
uint32_t rectCount,
const VkClearRect* pRects) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdResolveImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageResolve* pRegions) {
StartWriteObject(commandBuffer);
StartReadObject(srcImage);
StartReadObject(dstImage);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdResolveImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageResolve* pRegions) {
FinishWriteObject(commandBuffer);
FinishReadObject(srcImage);
FinishReadObject(dstImage);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdSetEvent(
VkCommandBuffer commandBuffer,
VkEvent event,
VkPipelineStageFlags stageMask) {
StartWriteObject(commandBuffer);
StartReadObject(event);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdSetEvent(
VkCommandBuffer commandBuffer,
VkEvent event,
VkPipelineStageFlags stageMask) {
FinishWriteObject(commandBuffer);
FinishReadObject(event);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdResetEvent(
VkCommandBuffer commandBuffer,
VkEvent event,
VkPipelineStageFlags stageMask) {
StartWriteObject(commandBuffer);
StartReadObject(event);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdResetEvent(
VkCommandBuffer commandBuffer,
VkEvent event,
VkPipelineStageFlags stageMask) {
FinishWriteObject(commandBuffer);
FinishReadObject(event);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdWaitEvents(
VkCommandBuffer commandBuffer,
uint32_t eventCount,
const VkEvent* pEvents,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
uint32_t memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers) {
StartWriteObject(commandBuffer);
if (pEvents) {
for (uint32_t index = 0; index < eventCount; index++) {
StartReadObject(pEvents[index]);
}
}
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdWaitEvents(
VkCommandBuffer commandBuffer,
uint32_t eventCount,
const VkEvent* pEvents,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
uint32_t memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers) {
FinishWriteObject(commandBuffer);
if (pEvents) {
for (uint32_t index = 0; index < eventCount; index++) {
FinishReadObject(pEvents[index]);
}
}
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdPipelineBarrier(
VkCommandBuffer commandBuffer,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
VkDependencyFlags dependencyFlags,
uint32_t memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers) {
StartWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdPipelineBarrier(
VkCommandBuffer commandBuffer,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
VkDependencyFlags dependencyFlags,
uint32_t memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers) {
FinishWriteObject(commandBuffer);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdBeginQuery(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,
uint32_t query,
VkQueryControlFlags flags) {
StartWriteObject(commandBuffer);
StartReadObject(queryPool);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdBeginQuery(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,
uint32_t query,
VkQueryControlFlags flags) {
FinishWriteObject(commandBuffer);
FinishReadObject(queryPool);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdEndQuery(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,
uint32_t query) {
StartWriteObject(commandBuffer);
StartReadObject(queryPool);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdEndQuery(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,
uint32_t query) {
FinishWriteObject(commandBuffer);
FinishReadObject(queryPool);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PreCallRecordCmdResetQueryPool(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,
uint32_t firstQuery,
uint32_t queryCount) {
StartWriteObject(commandBuffer);
StartReadObject(queryPool);
// Host access to commandBuffer must be externally synchronized
}
void ThreadSafety::PostCallRecordCmdResetQueryPool(
VkCommandBuffer commandBuffer,