aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorIan Elliott <ianelliott@google.com>2016-01-05 11:24:56 -0700
committerJon Ashburn <jon@lunarg.com>2016-01-06 12:23:09 -0700
commite2404c0fb0461bcb4b68ecaf514682e64bf3bef6 (patch)
treefd1675171eb308c623739885ec423eecc0acc455 /layers
parenta7f9d66d4b1eab2da24b530a7d668f40b63bf0c3 (diff)
downloadusermoji-e2404c0fb0461bcb4b68ecaf514682e64bf3bef6.tar.xz
Bug 15383 (Swapchain): Treat VkSurfaceKHR as opaque--don't look inside it.
Diffstat (limited to 'layers')
-rw-r--r--layers/swapchain.cpp23
-rw-r--r--layers/swapchain.h3
2 files changed, 1 insertions, 25 deletions
diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp
index b4758897..c4ae6116 100644
--- a/layers/swapchain.cpp
+++ b/layers/swapchain.cpp
@@ -79,24 +79,9 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerPropertie
static VkBool32 validateSurface(layer_data *my_data, VkSurfaceKHR surface, char *fn)
{
VkBool32 skipCall = VK_FALSE;
- bool found_error = false;
-
SwpSurface *pSurface = &my_data->surfaceMap[surface];
+
if ((pSurface == NULL) || (pSurface->surface != surface)) {
- found_error = true;
- } else {
-#if !defined(__ANDROID__)
- VkIcdSurfaceBase *pIcdSurface = (VkIcdSurfaceBase *) surface;
- if (pSurface->platform != pIcdSurface->platform) {
- found_error = true;
- }
-#else // !defined(__ANDROID__)
- if (pSurface->platform != VK_ICD_WSI_PLATFORM_ANDROID) {
- found_error = true;
- }
-#endif // !defined(__ANDROID__)
- }
- if (found_error) {
skipCall |= LOG_ERROR(VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT, surface, "VkSurfaceKHR",
SWAPCHAIN_INVALID_HANDLE,
"%s() called with an invalid surface object.",
@@ -426,7 +411,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].platform = VK_ICD_WSI_PLATFORM_ANDROID;
// Point to the associated SwpInstance:
pInstance->surfaces[*pSurface] = &my_data->surfaceMap[*pSurface];
skipCall |= validateSurface(my_data, *pSurface, (char *) __FUNCTION__);
@@ -482,7 +466,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].platform = VK_ICD_WSI_PLATFORM_MIR;
// Point to the associated SwpInstance:
pInstance->surfaces[*pSurface] = &my_data->surfaceMap[*pSurface];
skipCall |= validateSurface(my_data, *pSurface, (char *) __FUNCTION__);
@@ -576,7 +559,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].platform = VK_ICD_WSI_PLATFORM_WAYLAND;
// Point to the associated SwpInstance:
pInstance->surfaces[*pSurface] = &my_data->surfaceMap[*pSurface];
skipCall |= validateSurface(my_data, *pSurface, (char *) __FUNCTION__);
@@ -670,7 +652,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].platform = VK_ICD_WSI_PLATFORM_WIN32;
// Point to the associated SwpInstance:
pInstance->surfaces[*pSurface] = &my_data->surfaceMap[*pSurface];
skipCall |= validateSurface(my_data, *pSurface, (char *) __FUNCTION__);
@@ -763,7 +744,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].platform = VK_ICD_WSI_PLATFORM_XCB;
// Point to the associated SwpInstance:
pInstance->surfaces[*pSurface] = &my_data->surfaceMap[*pSurface];
skipCall |= validateSurface(my_data, *pSurface, (char *) __FUNCTION__);
@@ -858,7 +838,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(
// Record the VkSurfaceKHR returned by the ICD:
my_data->surfaceMap[*pSurface].surface = *pSurface;
my_data->surfaceMap[*pSurface].pInstance = pInstance;
- my_data->surfaceMap[*pSurface].platform = VK_ICD_WSI_PLATFORM_XLIB;
// Point to the associated SwpInstance:
pInstance->surfaces[*pSurface] = &my_data->surfaceMap[*pSurface];
skipCall |= validateSurface(my_data, *pSurface, (char *) __FUNCTION__);
diff --git a/layers/swapchain.h b/layers/swapchain.h
index 852861bc..7bcd7a8f 100644
--- a/layers/swapchain.h
+++ b/layers/swapchain.h
@@ -215,9 +215,6 @@ struct _SwpSurface {
// VkInstance that this VkSurfaceKHR is associated with:
SwpInstance *pInstance;
- // Which platform this VkSurfaceKHR is associated with:
- VkIcdWsiPlatform platform;
-
// TODO: Add additional platform-specific info:
};