aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-09-29 14:39:08 +1300
committerChris Forbes <chrisforbes@google.com>2016-10-04 08:59:27 +1300
commit15a6bd0a04d215798c2d585517cb10f009beea49 (patch)
tree8dff0f812964b820580c4c4542e6cde33ea3d5b6
parenta71f2245a4f6f6649e5a8ecb17fe4be8d22d357c (diff)
downloadusermoji-15a6bd0a04d215798c2d585517cb10f009beea49.tar.xz
layers: Remove allocator consistency check from swapchain
This is now covered by object_tracker Signed-off-by: Chris Forbes <chrisforbes@google.com>
-rw-r--r--layers/swapchain.cpp20
-rw-r--r--layers/swapchain.h7
-rw-r--r--layers/vk_validation_layer_details.md1
3 files changed, 0 insertions, 28 deletions
diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp
index 8f002ced..2d4927ac 100644
--- a/layers/swapchain.cpp
+++ b/layers/swapchain.cpp
@@ -382,7 +382,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateAndroidSurfaceKHR(VkInstance instance, cons
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].usedAllocatorToCreate = (pAllocator != NULL);
my_data->surfaceMap[*pSurface].numQueueFamilyIndexSupport = 0;
my_data->surfaceMap[*pSurface].pQueueFamilyIndexSupport = NULL;
// Point to the associated SwpInstance:
@@ -433,7 +432,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateMirSurfaceKHR(VkInstance instance, const Vk
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].usedAllocatorToCreate = (pAllocator != NULL);
my_data->surfaceMap[*pSurface].numQueueFamilyIndexSupport = 0;
my_data->surfaceMap[*pSurface].pQueueFamilyIndexSupport = NULL;
// Point to the associated SwpInstance:
@@ -519,7 +517,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateWaylandSurfaceKHR(VkInstance instance, cons
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].usedAllocatorToCreate = (pAllocator != NULL);
my_data->surfaceMap[*pSurface].numQueueFamilyIndexSupport = 0;
my_data->surfaceMap[*pSurface].pQueueFamilyIndexSupport = NULL;
// Point to the associated SwpInstance:
@@ -606,7 +603,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateWin32SurfaceKHR(VkInstance instance, const
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].usedAllocatorToCreate = (pAllocator != NULL);
my_data->surfaceMap[*pSurface].numQueueFamilyIndexSupport = 0;
my_data->surfaceMap[*pSurface].pQueueFamilyIndexSupport = NULL;
// Point to the associated SwpInstance:
@@ -691,7 +687,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateXcbSurfaceKHR(VkInstance instance, const Vk
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].usedAllocatorToCreate = (pAllocator != NULL);
my_data->surfaceMap[*pSurface].numQueueFamilyIndexSupport = 0;
my_data->surfaceMap[*pSurface].pQueueFamilyIndexSupport = NULL;
// Point to the associated SwpInstance:
@@ -778,7 +773,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateXlibSurfaceKHR(VkInstance instance, const V
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].usedAllocatorToCreate = (pAllocator != NULL);
my_data->surfaceMap[*pSurface].numQueueFamilyIndexSupport = 0;
my_data->surfaceMap[*pSurface].pQueueFamilyIndexSupport = NULL;
// Point to the associated SwpInstance:
@@ -1089,7 +1083,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayPlaneSurfaceKHR(VkInstance instance,
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].usedAllocatorToCreate = (pAllocator != NULL);
my_data->surfaceMap[*pSurface].numQueueFamilyIndexSupport = 0;
my_data->surfaceMap[*pSurface].pQueueFamilyIndexSupport = NULL;
// Point to the associated SwpInstance:
@@ -1151,12 +1144,6 @@ VKAPI_ATTR void VKAPI_CALL DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR s
}
pSurface->swapchains.clear();
}
- if ((pAllocator != NULL) != pSurface->usedAllocatorToCreate) {
- skip_call |=
- log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT,
- reinterpret_cast<uint64_t>(instance), __LINE__, SWAPCHAIN_INCOMPATIBLE_ALLOCATOR, swapchain_layer_name,
- "vkDestroySurfaceKHR() called with incompatible pAllocator from when the object was created.");
- }
my_data->surfaceMap.erase(surface);
}
lock.unlock();
@@ -1903,7 +1890,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSwapchainKHR(VkDevice device, const VkSwapc
}
my_data->swapchainMap[*pSwapchain].pDevice = pDevice;
my_data->swapchainMap[*pSwapchain].imageCount = 0;
- my_data->swapchainMap[*pSwapchain].usedAllocatorToCreate = (pAllocator != NULL);
// Store a pointer to the surface
SwpPhysicalDevice *pPhysicalDevice = pDevice->pPhysicalDevice;
SwpInstance *pInstance = (pPhysicalDevice) ? pPhysicalDevice->pInstance : NULL;
@@ -1968,12 +1954,6 @@ VKAPI_ATTR void VKAPI_CALL DestroySwapchainKHR(VkDevice device, VkSwapchainKHR s
if (pSwapchain->imageCount) {
pSwapchain->images.clear();
}
- if ((pAllocator != NULL) != pSwapchain->usedAllocatorToCreate) {
- skip_call |=
- log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
- reinterpret_cast<uint64_t>(device), __LINE__, SWAPCHAIN_INCOMPATIBLE_ALLOCATOR, swapchain_layer_name,
- "vkDestroySwapchainKHR() called with incompatible pAllocator from when the object was created.");
- }
my_data->swapchainMap.erase(swapchain);
}
lock.unlock();
diff --git a/layers/swapchain.h b/layers/swapchain.h
index 22dbb6fd..2f63a614 100644
--- a/layers/swapchain.h
+++ b/layers/swapchain.h
@@ -64,7 +64,6 @@ enum SWAPCHAIN_ERROR {
SWAPCHAIN_WRONG_STYPE, // The sType for a struct has the wrong value
SWAPCHAIN_WRONG_NEXT, // The pNext for a struct is not NULL
SWAPCHAIN_ZERO_VALUE, // A value should be non-zero
- SWAPCHAIN_INCOMPATIBLE_ALLOCATOR, // pAllocator must be compatible (i.e. NULL or not) when object is created and destroyed
SWAPCHAIN_DID_NOT_QUERY_QUEUE_FAMILIES, // A function using a queueFamilyIndex was called before
// vkGetPhysicalDeviceQueueFamilyProperties() was called
SWAPCHAIN_QUEUE_FAMILY_INDEX_TOO_LARGE, // A queueFamilyIndex value is not less than pQueueFamilyPropertyCount returned by
@@ -150,9 +149,6 @@ struct SwpSurface {
// remembered:
unordered_map<VkSwapchainKHR, SwpSwapchain *> swapchains;
- // 'true' if pAllocator was non-NULL when vkCreate*SurfaceKHR was called:
- bool usedAllocatorToCreate;
-
// Value of pQueueFamilyPropertyCount that was returned by the
// vkGetPhysicalDeviceQueueFamilyProperties() function:
uint32_t numQueueFamilyIndexSupport;
@@ -257,9 +253,6 @@ struct SwpSwapchain {
// remembered:
uint32_t imageCount;
unordered_map<int, SwpImage> images;
-
- // 'true' if pAllocator was non-NULL when vkCreateSwapchainKHR was called:
- bool usedAllocatorToCreate;
};
// Create one of these for each VkQueue within a VkDevice:
diff --git a/layers/vk_validation_layer_details.md b/layers/vk_validation_layer_details.md
index b1481124..d0514333 100644
--- a/layers/vk_validation_layer_details.md
+++ b/layers/vk_validation_layer_details.md
@@ -357,7 +357,6 @@ This layer is a work in progress. VK_LAYER_LUNARG_swapchain layer is intended to
| Valid sType | Validates that a struct has correct value for sType | WRONG_STYPE | vkCreateSwapchainKHR vkQueuePresentKHR | VkWsiEnabledLayerTest.TestEnabledWsi | None |
| Valid pNext | Validates that a struct has NULL for the value of pNext | WRONG_NEXT | vkCreateSwapchainKHR vkQueuePresentKHR | VkWsiEnabledLayerTest.TestEnabledWsi | None |
| Non-zero value | Validates that a required value should be non-zero | ZERO_VALUE | vkQueuePresentKHR | TODO | None |
-| Compatible Allocator | Validates that pAllocator is compatible (i.e. NULL or not) when an object is created and destroyed | INCOMPATIBLE_ALLOCATOR | vkDestroySurfaceKHR | TODO | None |
| Valid use of queueFamilyIndex | Validates that a queueFamilyIndex not used before vkGetPhysicalDeviceQueueFamilyProperties() was called | DID_NOT_QUERY_QUEUE_FAMILIES | vkGetPhysicalDeviceSurfaceSupportKHR | TODO | None |
| Valid queueFamilyIndex value | Validates that a queueFamilyIndex value is less-than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties | QUEUE_FAMILY_INDEX_TOO_LARGE | vkGetPhysicalDeviceSurfaceSupportKHR | TODO | None |
| Supported combination of queue and surface | Validates that the surface associated with a swapchain was seen to support the queueFamilyIndex of a given queue | SURFACE_NOT_SUPPORTED_WITH_QUEUE | vkQueuePresentKHR | TODO | None |