diff --git a/base/VulkanModel.hpp b/base/VulkanModel.hpp index 20c8ea10..b2cad6fc 100644 --- a/base/VulkanModel.hpp +++ b/base/VulkanModel.hpp @@ -186,7 +186,7 @@ namespace vks pScene = Importer.ReadFile(filename.c_str(), flags); if (!pScene) { std::string error = Importer.GetErrorString(); - vks::tools::exitFatal(error + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", "Error"); + vks::tools::exitFatal(error + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", -1); } #endif diff --git a/base/VulkanSwapChain.hpp b/base/VulkanSwapChain.hpp index 40ce6338..9f9f80c4 100644 --- a/base/VulkanSwapChain.hpp +++ b/base/VulkanSwapChain.hpp @@ -136,7 +136,7 @@ public: #endif if (err != VK_SUCCESS) { - vks::tools::exitFatal("Could not create surface!", "Fatal error"); + vks::tools::exitFatal("Could not create surface!", err); } // Get available queue family properties @@ -194,13 +194,13 @@ public: // Exit if either a graphics or a presenting queue hasn't been found if (graphicsQueueNodeIndex == UINT32_MAX || presentQueueNodeIndex == UINT32_MAX) { - vks::tools::exitFatal("Could not find a graphics and/or presenting queue!", "Fatal error"); + vks::tools::exitFatal("Could not find a graphics and/or presenting queue!", -1); } // todo : Add support for separate graphics and presenting queue if (graphicsQueueNodeIndex != presentQueueNodeIndex) { - vks::tools::exitFatal("Separate graphics and presenting queues are not supported yet!", "Fatal error"); + vks::tools::exitFatal("Separate graphics and presenting queues are not supported yet!", -1); } queueNodeIndex = graphicsQueueNodeIndex; @@ -563,7 +563,7 @@ public: if(!foundMode) { - vks::tools::exitFatal("Can't find a display and a display mode!", "Fatal error"); + vks::tools::exitFatal("Can't find a display and a display mode!", -1); return; } @@ -600,7 +600,7 @@ public: if(bestPlaneIndex == UINT32_MAX) { - vks::tools::exitFatal("Can't find a plane for displaying!", "Fatal error"); + vks::tools::exitFatal("Can't find a plane for displaying!", -1); return; } @@ -639,9 +639,8 @@ public: surfaceInfo.imageExtent.height = height; VkResult result = vkCreateDisplayPlaneSurfaceKHR(instance, &surfaceInfo, NULL, &surface); - if(result !=VK_SUCCESS) - { - vks::tools::exitFatal("Failed to create surface!", "Fatal error"); + if (result !=VK_SUCCESS) { + vks::tools::exitFatal("Failed to create surface!", result); } delete[] pDisplays; diff --git a/base/VulkanTexture.hpp b/base/VulkanTexture.hpp index 48d24a68..e294c7cf 100644 --- a/base/VulkanTexture.hpp +++ b/base/VulkanTexture.hpp @@ -93,7 +93,7 @@ namespace vks // So they need to be loaded via the asset manager AAsset* asset = AAssetManager_open(androidApp->activity->assetManager, filename.c_str(), AASSET_MODE_STREAMING); if (!asset) { - vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", "Error"); + vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", -1); } size_t size = AAsset_getLength(asset); assert(size > 0); @@ -107,7 +107,7 @@ namespace vks free(textureData); #else if (!vks::tools::fileExists(filename)) { - vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", "Error"); + vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", -1); } gli::texture2d tex2D(gli::load(filename.c_str())); #endif @@ -573,7 +573,7 @@ namespace vks // So they need to be loaded via the asset manager AAsset* asset = AAssetManager_open(androidApp->activity->assetManager, filename.c_str(), AASSET_MODE_STREAMING); if (!asset) { - vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", "Error"); + vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", -1); } size_t size = AAsset_getLength(asset); assert(size > 0); @@ -587,7 +587,7 @@ namespace vks free(textureData); #else if (!vks::tools::fileExists(filename)) { - vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", "Error"); + vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", -1); } gli::texture2d_array tex2DArray(gli::load(filename)); #endif @@ -785,7 +785,7 @@ namespace vks // So they need to be loaded via the asset manager AAsset* asset = AAssetManager_open(androidApp->activity->assetManager, filename.c_str(), AASSET_MODE_STREAMING); if (!asset) { - vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", "Error"); + vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", -1); } size_t size = AAsset_getLength(asset); assert(size > 0); @@ -799,7 +799,7 @@ namespace vks free(textureData); #else if (!vks::tools::fileExists(filename)) { - vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", "Error"); + vks::tools::exitFatal("Could not load texture from " + filename + "\n\nThe file may be part of the additional asset pack.\n\nRun \"download_assets.py\" in the repository root to download the latest version.", -1); } gli::texture_cube texCube(gli::load(filename)); #endif diff --git a/base/VulkanTools.cpp b/base/VulkanTools.cpp index ae6c034e..12f6c101 100644 --- a/base/VulkanTools.cpp +++ b/base/VulkanTools.cpp @@ -262,17 +262,22 @@ namespace vks 1, &imageMemoryBarrier); } - void exitFatal(std::string message, std::string caption, bool silent) + void exitFatal(std::string message, int32_t exitCode) { #if defined(_WIN32) if (!errorModeSilent) { - MessageBox(NULL, message.c_str(), caption.c_str(), MB_OK | MB_ICONERROR); + MessageBox(NULL, message.c_str(), NULL, MB_OK | MB_ICONERROR); } #elif defined(__ANDROID__) LOGE("Fatal error: %s", message.c_str()); #endif std::cerr << message << "\n"; - exit(1); + exit(exitCode); + } + + void exitFatal(std::string message, VkResult resultCode) + { + exitFatal(message, (int32_t)resultCode); } std::string readTextFile(const char *fileName) diff --git a/base/VulkanTools.h b/base/VulkanTools.h index 6076f813..f7885987 100644 --- a/base/VulkanTools.h +++ b/base/VulkanTools.h @@ -114,7 +114,8 @@ namespace vks VkImageSubresourceRange subresourceRange); // Display error message and exit on fatal error - void exitFatal(std::string message, std::string caption, bool silent = false); + void exitFatal(std::string message, int32_t exitCode); + void exitFatal(std::string message, VkResult resultCode); // Load a SPIR-V shader (binary) #if defined(__ANDROID__) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index bfcd451e..3460456a 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -831,7 +831,7 @@ void VulkanExampleBase::initVulkan() // Vulkan instance err = createInstance(settings.validation); if (err) { - vks::tools::exitFatal("Could not create Vulkan instance : \n" + vks::tools::errorString(err), "Fatal error", !benchmark.active); + vks::tools::exitFatal("Could not create Vulkan instance : \n" + vks::tools::errorString(err), err); } #if defined(VK_USE_PLATFORM_ANDROID_KHR) @@ -857,7 +857,7 @@ void VulkanExampleBase::initVulkan() std::vector physicalDevices(gpuCount); err = vkEnumeratePhysicalDevices(instance, &gpuCount, physicalDevices.data()); if (err) { - vks::tools::exitFatal("Could not enumerate physical devices : \n" + vks::tools::errorString(err), "Fatal error", !benchmark.active); + vks::tools::exitFatal("Could not enumerate physical devices : \n" + vks::tools::errorString(err), err); } // GPU selection @@ -932,7 +932,7 @@ void VulkanExampleBase::initVulkan() vulkanDevice = new vks::VulkanDevice(physicalDevice); VkResult res = vulkanDevice->createLogicalDevice(enabledFeatures, enabledExtensions); if (res != VK_SUCCESS) { - vks::tools::exitFatal("Could not create Vulkan device: \n" + vks::tools::errorString(res), "Fatal error", benchmark.active); + vks::tools::exitFatal("Could not create Vulkan device: \n" + vks::tools::errorString(res), res); } device = vulkanDevice->logicalDevice; diff --git a/examples/deferred/deferred.cpp b/examples/deferred/deferred.cpp index ea4b2e0f..2c9dcce3 100644 --- a/examples/deferred/deferred.cpp +++ b/examples/deferred/deferred.cpp @@ -520,7 +520,7 @@ public: texFormat = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } textures.model.colorMap.loadFromFile(getAssetPath() + "models/armor/color" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); diff --git a/examples/deferredmultisampling/deferredmultisampling.cpp b/examples/deferredmultisampling/deferredmultisampling.cpp index 2687d82a..75dcf292 100644 --- a/examples/deferredmultisampling/deferredmultisampling.cpp +++ b/examples/deferredmultisampling/deferredmultisampling.cpp @@ -600,7 +600,7 @@ public: texFormat = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } textures.model.colorMap.loadFromFile(getAssetPath() + "models/armor/color" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); diff --git a/examples/deferredshadows/deferredshadows.cpp b/examples/deferredshadows/deferredshadows.cpp index 199c8659..084e7c24 100644 --- a/examples/deferredshadows/deferredshadows.cpp +++ b/examples/deferredshadows/deferredshadows.cpp @@ -238,7 +238,7 @@ public: enabledFeatures.geometryShader = VK_TRUE; } else { - vks::tools::exitFatal("Selected GPU does not support geometry shaders!", "Feature not supported"); + vks::tools::exitFatal("Selected GPU does not support geometry shaders!", VK_ERROR_FEATURE_NOT_PRESENT); } // Enable anisotropic filtering if supported if (deviceFeatures.samplerAnisotropy) { @@ -458,7 +458,7 @@ public: texFormat = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } textures.model.colorMap.loadFromFile(getAssetPath() + "models/armor/color" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); diff --git a/examples/displacement/displacement.cpp b/examples/displacement/displacement.cpp index b40a2299..b61e249e 100644 --- a/examples/displacement/displacement.cpp +++ b/examples/displacement/displacement.cpp @@ -113,7 +113,7 @@ public: enabledFeatures.tessellationShader = VK_TRUE; } else { - vks::tools::exitFatal("Selected GPU does not support tessellation shaders!", "Feature not supported"); + vks::tools::exitFatal("Selected GPU does not support tessellation shaders!", VK_ERROR_FEATURE_NOT_PRESENT); } // Fill mode non solid is required for wireframe display if (deviceFeatures.fillModeNonSolid) { @@ -138,7 +138,7 @@ public: textures.colorHeightMap.loadFromFile(getAssetPath() + "textures/stonefloor03_color_etc2_unorm.ktx", VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, vulkanDevice, queue); } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/examples/geometryshader/geometryshader.cpp b/examples/geometryshader/geometryshader.cpp index 1e63ad35..4a615e50 100644 --- a/examples/geometryshader/geometryshader.cpp +++ b/examples/geometryshader/geometryshader.cpp @@ -103,7 +103,7 @@ public: enabledFeatures.geometryShader = VK_TRUE; } else { - vks::tools::exitFatal("Selected GPU does not support geometry shaders!", "Feature not supported"); + vks::tools::exitFatal("Selected GPU does not support geometry shaders!", VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/examples/indirectdraw/indirectdraw.cpp b/examples/indirectdraw/indirectdraw.cpp index decd2635..9e8a5ddd 100644 --- a/examples/indirectdraw/indirectdraw.cpp +++ b/examples/indirectdraw/indirectdraw.cpp @@ -270,7 +270,7 @@ public: texFormat = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } textures.plants.loadFromFile(getAssetPath() + "textures/texturearray_plants" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); diff --git a/examples/instancing/instancing.cpp b/examples/instancing/instancing.cpp index ba88024a..6d87ef99 100644 --- a/examples/instancing/instancing.cpp +++ b/examples/instancing/instancing.cpp @@ -221,7 +221,7 @@ public: texFormat = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } textures.rocks.loadFromFile(getAssetPath() + "textures/texturearray_rocks" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); diff --git a/examples/mesh/mesh.cpp b/examples/mesh/mesh.cpp index a8a90cf3..438c823d 100644 --- a/examples/mesh/mesh.cpp +++ b/examples/mesh/mesh.cpp @@ -364,7 +364,7 @@ public: textures.colorMap.loadFromFile(getAssetPath() + "models/voyager/voyager_etc2_unorm.ktx", VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, vulkanDevice, queue); } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/examples/multisampling/multisampling.cpp b/examples/multisampling/multisampling.cpp index 5a436dd8..91c3f051 100644 --- a/examples/multisampling/multisampling.cpp +++ b/examples/multisampling/multisampling.cpp @@ -443,7 +443,7 @@ public: textures.colorMap.loadFromFile(getAssetPath() + "models/voyager/voyager_etc2_unorm.ktx", VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, vulkanDevice, queue); } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/examples/offscreen/offscreen.cpp b/examples/offscreen/offscreen.cpp index 32996a09..73f7ad58 100644 --- a/examples/offscreen/offscreen.cpp +++ b/examples/offscreen/offscreen.cpp @@ -483,7 +483,7 @@ public: textures.colorMap.loadFromFile(getAssetPath() + "textures/darkmetal_etc2_unorm.ktx", VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, vulkanDevice, queue); } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/examples/parallaxmapping/parallaxmapping.cpp b/examples/parallaxmapping/parallaxmapping.cpp index 69769bd2..15b44614 100644 --- a/examples/parallaxmapping/parallaxmapping.cpp +++ b/examples/parallaxmapping/parallaxmapping.cpp @@ -132,7 +132,7 @@ public: textures.colorMap.loadFromFile(getAssetPath() + "textures/rocks_color_etc2_unorm.ktx", VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, vulkanDevice, queue); } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/examples/particlefire/particlefire.cpp b/examples/particlefire/particlefire.cpp index 990ae8d4..e013c47d 100644 --- a/examples/particlefire/particlefire.cpp +++ b/examples/particlefire/particlefire.cpp @@ -347,7 +347,7 @@ public: texFormat = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } // Particles diff --git a/examples/pipelinestatistics/pipelinestatistics.cpp b/examples/pipelinestatistics/pipelinestatistics.cpp index 6d4d06e6..95d9419a 100644 --- a/examples/pipelinestatistics/pipelinestatistics.cpp +++ b/examples/pipelinestatistics/pipelinestatistics.cpp @@ -102,7 +102,7 @@ public: enabledFeatures.pipelineStatisticsQuery = VK_TRUE; } else { - vks::tools::exitFatal("Selected GPU does not support pipeline statistics!", "Feature not supported"); + vks::tools::exitFatal("Selected GPU does not support pipeline statistics!", VK_ERROR_FEATURE_NOT_PRESENT); } if (deviceFeatures.fillModeNonSolid) { enabledFeatures.fillModeNonSolid = VK_TRUE; diff --git a/examples/scenerendering/scenerendering.cpp b/examples/scenerendering/scenerendering.cpp index 392836d7..e8691ca0 100644 --- a/examples/scenerendering/scenerendering.cpp +++ b/examples/scenerendering/scenerendering.cpp @@ -164,7 +164,7 @@ private: texFormat = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } aiString texturefile; diff --git a/examples/skeletalanimation/skeletalanimation.cpp b/examples/skeletalanimation/skeletalanimation.cpp index 8cd88d17..67f0fc31 100644 --- a/examples/skeletalanimation/skeletalanimation.cpp +++ b/examples/skeletalanimation/skeletalanimation.cpp @@ -683,7 +683,7 @@ public: texFormat = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } textures.colorMap.loadFromFile(getAssetPath() + "textures/goblin" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); diff --git a/examples/subpasses/subpasses.cpp b/examples/subpasses/subpasses.cpp index 60f21baf..72decbaf 100644 --- a/examples/subpasses/subpasses.cpp +++ b/examples/subpasses/subpasses.cpp @@ -548,7 +548,7 @@ public: textures.glass.loadFromFile(getAssetPath() + "textures/colored_glass_etc2_unorm.ktx", VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, vulkanDevice, queue); } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/examples/terraintessellation/terraintessellation.cpp b/examples/terraintessellation/terraintessellation.cpp index 6ac225ce..9f5b87e3 100644 --- a/examples/terraintessellation/terraintessellation.cpp +++ b/examples/terraintessellation/terraintessellation.cpp @@ -160,7 +160,7 @@ public: enabledFeatures.tessellationShader = VK_TRUE; } else { - vks::tools::exitFatal("Selected GPU does not support tessellation shaders!", "Feature not supported"); + vks::tools::exitFatal("Selected GPU does not support tessellation shaders!", VK_ERROR_FEATURE_NOT_PRESENT); } // Fill mode non solid is required for wireframe display if (deviceFeatures.fillModeNonSolid) { @@ -255,7 +255,7 @@ public: texFormat = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } textures.skySphere.loadFromFile(getAssetPath() + "textures/skysphere" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); diff --git a/examples/tessellation/tessellation.cpp b/examples/tessellation/tessellation.cpp index 668d6738..fd81a165 100644 --- a/examples/tessellation/tessellation.cpp +++ b/examples/tessellation/tessellation.cpp @@ -122,7 +122,7 @@ public: enabledFeatures.tessellationShader = VK_TRUE; } else { - vks::tools::exitFatal("Selected GPU does not support tessellation shaders!", "Feature not supported"); + vks::tools::exitFatal("Selected GPU does not support tessellation shaders!", VK_ERROR_FEATURE_NOT_PRESENT); } // Fill mode non solid is required for wireframe display if (deviceFeatures.fillModeNonSolid) { @@ -203,7 +203,7 @@ public: textures.colorMap.loadFromFile(getAssetPath() + "textures/deer_etc2_unorm.ktx", VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, vulkanDevice, queue); } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } } diff --git a/examples/textoverlay/textoverlay.cpp b/examples/textoverlay/textoverlay.cpp index 41fec758..073692cb 100644 --- a/examples/textoverlay/textoverlay.cpp +++ b/examples/textoverlay/textoverlay.cpp @@ -884,7 +884,7 @@ public: texFormat = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } textures.background.loadFromFile(getAssetPath() + "textures/skysphere" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); diff --git a/examples/texturearray/texturearray.cpp b/examples/texturearray/texturearray.cpp index 7808ee29..be4306c9 100644 --- a/examples/texturearray/texturearray.cpp +++ b/examples/texturearray/texturearray.cpp @@ -300,7 +300,7 @@ public: format = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } loadTextureArray(getAssetPath() + "textures/" + filename, format); } diff --git a/examples/texturecubemap/texturecubemap.cpp b/examples/texturecubemap/texturecubemap.cpp index cff65742..a555a881 100644 --- a/examples/texturecubemap/texturecubemap.cpp +++ b/examples/texturecubemap/texturecubemap.cpp @@ -318,7 +318,7 @@ public: format = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; } else { - vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); } loadCubemap(getAssetPath() + "textures/" + filename, format, false); diff --git a/examples/texturesparseresidency/texturesparseresidency.cpp b/examples/texturesparseresidency/texturesparseresidency.cpp index c994e423..16803928 100644 --- a/examples/texturesparseresidency/texturesparseresidency.cpp +++ b/examples/texturesparseresidency/texturesparseresidency.cpp @@ -912,9 +912,8 @@ public: { VulkanExampleBase::prepare(); // Check if the GPU supports sparse residency for 2D images - if (!vulkanDevice->features.sparseResidencyImage2D) - { - vks::tools::exitFatal("Device does not support sparse residency for 2D images!", "Feature not supported"); + if (!vulkanDevice->features.sparseResidencyImage2D) { + vks::tools::exitFatal("Device does not support sparse residency for 2D images!", VK_ERROR_FEATURE_NOT_PRESENT); } loadAssets(); generateTerrain(); diff --git a/examples/viewportarray/viewportarray.cpp b/examples/viewportarray/viewportarray.cpp index ebb23936..8b8a0854 100644 --- a/examples/viewportarray/viewportarray.cpp +++ b/examples/viewportarray/viewportarray.cpp @@ -85,14 +85,14 @@ public: enabledFeatures.geometryShader = VK_TRUE; } else { - vks::tools::exitFatal("Selected GPU does not support geometry shaders!", "Feature not supported"); + vks::tools::exitFatal("Selected GPU does not support geometry shaders!", VK_ERROR_FEATURE_NOT_PRESENT); } // Multiple viewports must be supported if (deviceFeatures.multiViewport) { enabledFeatures.multiViewport = VK_TRUE; } else { - vks::tools::exitFatal("Selected GPU does not support multi viewports!", "Feature not supported"); + vks::tools::exitFatal("Selected GPU does not support multi viewports!", VK_ERROR_FEATURE_NOT_PRESENT); } }