From d0211d1f1443da42171fa4ccb36eb9ee01a6cc50 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Sat, 30 Dec 2023 13:15:37 +0100 Subject: [PATCH] Replaced per-sample validation define with global define in base class Toggling validation via command line arguments is the preferred way anyway Define was also added as a CMake option --- CMakeLists.txt | 6 ++++++ base/vulkanexamplebase.cpp | 7 +++++-- base/vulkanexamplebase.h | 3 ++- examples/bloom/bloom.cpp | 3 +-- examples/computecloth/computecloth.cpp | 3 +-- examples/computecullandlod/computecullandlod.cpp | 3 +-- examples/computenbody/computenbody.cpp | 3 +-- examples/computeparticles/computeparticles.cpp | 3 +-- examples/computeraytracing/computeraytracing.cpp | 3 +-- examples/computeshader/computeshader.cpp | 3 +-- examples/conditionalrender/conditionalrender.cpp | 3 +-- examples/conservativeraster/conservativeraster.cpp | 3 +-- examples/debugprintf/debugprintf.cpp | 3 +-- examples/debugutils/debugutils.cpp | 4 +--- examples/deferred/deferred.cpp | 3 +-- examples/deferredmultisampling/deferredmultisampling.cpp | 3 +-- examples/deferredshadows/deferredshadows.cpp | 3 +-- examples/descriptorbuffer/descriptorbuffer.cpp | 3 +-- examples/descriptorindexing/descriptorindexing.cpp | 3 +-- examples/descriptorsets/descriptorsets.cpp | 3 +-- examples/displacement/displacement.cpp | 3 +-- examples/distancefieldfonts/distancefieldfonts.cpp | 3 +-- examples/dynamicrendering/dynamicrendering.cpp | 3 +-- examples/dynamicstate/dynamicstate.cpp | 3 +-- examples/dynamicuniformbuffer/dynamicuniformbuffer.cpp | 3 +-- examples/gears/gears.cpp | 3 +-- examples/geometryshader/geometryshader.cpp | 3 +-- examples/gltfloading/gltfloading.cpp | 3 +-- examples/gltfscenerendering/gltfscenerendering.cpp | 2 +- examples/gltfscenerendering/gltfscenerendering.h | 1 - examples/gltfskinning/gltfskinning.cpp | 3 +-- examples/gltfskinning/gltfskinning.h | 1 - .../graphicspipelinelibrary/graphicspipelinelibrary.cpp | 4 +--- examples/hdr/hdr.cpp | 4 +--- examples/imgui/main.cpp | 4 +--- examples/indirectdraw/indirectdraw.cpp | 4 +--- examples/inlineuniformblocks/inlineuniformblocks.cpp | 4 +--- examples/inputattachments/inputattachments.cpp | 4 +--- examples/instancing/instancing.cpp | 3 +-- examples/meshshader/meshshader.cpp | 4 +--- examples/multisampling/multisampling.cpp | 4 +--- examples/multithreading/multithreading.cpp | 4 +--- examples/multiview/multiview.cpp | 4 +--- examples/negativeviewportheight/negativeviewportheight.cpp | 4 +--- examples/occlusionquery/occlusionquery.cpp | 4 +--- examples/offscreen/offscreen.cpp | 4 +--- examples/oit/oit.cpp | 3 +-- examples/parallaxmapping/parallaxmapping.cpp | 4 +--- examples/particlesystem/particlesystem.cpp | 3 +-- examples/pbrbasic/pbrbasic.cpp | 3 +-- examples/pbribl/pbribl.cpp | 3 +-- examples/pbrtexture/pbrtexture.cpp | 4 +--- examples/pipelines/pipelines.cpp | 4 +--- examples/pipelinestatistics/pipelinestatistics.cpp | 3 +-- examples/pushconstants/pushconstants.cpp | 4 +--- examples/pushdescriptors/pushdescriptors.cpp | 4 +--- examples/radialblur/radialblur.cpp | 4 +--- examples/rayquery/rayquery.cpp | 2 -- examples/screenshot/screenshot.cpp | 4 +--- examples/shaderobjects/shaderobjects.cpp | 4 +--- examples/shadowmapping/shadowmapping.cpp | 4 +--- examples/shadowmappingcascade/shadowmappingcascade.cpp | 4 +--- examples/shadowmappingomni/shadowmappingomni.cpp | 4 +--- .../specializationconstants/specializationconstants.cpp | 4 +--- examples/sphericalenvmapping/sphericalenvmapping.cpp | 4 +--- examples/ssao/ssao.cpp | 4 +--- examples/stencilbuffer/stencilbuffer.cpp | 4 +--- examples/subpasses/subpasses.cpp | 4 +--- examples/terraintessellation/terraintessellation.cpp | 4 +--- examples/tessellation/tessellation.cpp | 4 +--- examples/textoverlay/textoverlay.cpp | 4 +--- examples/texture/texture.cpp | 4 +--- examples/texture3d/texture3d.cpp | 4 +--- examples/texturearray/texturearray.cpp | 4 +--- examples/texturecubemap/texturecubemap.cpp | 4 +--- examples/texturecubemaparray/texturecubemaparray.cpp | 4 +--- examples/texturemipmapgen/texturemipmapgen.cpp | 4 +--- examples/texturesparseresidency/texturesparseresidency.cpp | 2 +- examples/texturesparseresidency/texturesparseresidency.h | 2 -- examples/triangle/triangle.cpp | 4 +--- examples/variablerateshading/variablerateshading.cpp | 2 +- examples/variablerateshading/variablerateshading.h | 2 -- examples/vertexattributes/vertexattributes.cpp | 2 +- examples/vertexattributes/vertexattributes.h | 2 -- examples/viewportarray/viewportarray.cpp | 4 +--- examples/vulkanscene/vulkanscene.cpp | 4 +--- 86 files changed, 90 insertions(+), 205 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec1cb056..b98e53d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ OPTION(USE_DIRECTFB_WSI "Build the project using DirectFB swapchain" OFF) OPTION(USE_WAYLAND_WSI "Build the project using Wayland swapchain" OFF) OPTION(USE_HEADLESS "Build the project using headless extension swapchain" OFF) OPTION(USE_RELATIVE_ASSET_PATH "Load assets (shaders, models, textures) from a fixed path relative to the binar" OFF) +OPTION(FORCE_VALIDATION "Forces validation on for all samples at compile time (prefer using the -v / --validation command line arguments)" OFF) set(RESOURCE_INSTALL_DIR "" CACHE PATH "Path to install resources to (leave empty for running uninstalled)") @@ -128,6 +129,11 @@ else() endif() endif() +# Force validation at compile time +if (FORCE_VALIDATION) + add_definitions(-DFORCE_VALIDATION) +endif() + # Compiler specific stuff IF(MSVC) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index a9c10a21..1a7ecdbf 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -779,7 +779,7 @@ void VulkanExampleBase::submitFrame() VK_CHECK_RESULT(vkQueueWaitIdle(queue)); } -VulkanExampleBase::VulkanExampleBase(bool enableValidation) +VulkanExampleBase::VulkanExampleBase() { #if !defined(VK_USE_PLATFORM_ANDROID_KHR) // Check for a valid asset path @@ -796,7 +796,10 @@ VulkanExampleBase::VulkanExampleBase(bool enableValidation) } #endif - settings.validation = enableValidation; + // Validation for all samples can be forced at compile time using the FORCE_VALIDATION define +#if defined(FORCE_VALIDATION) + settings.validation = true; +#endif // Command line arguments commandLineParser.add("help", { "--help" }, 0, "Show help"); diff --git a/base/vulkanexamplebase.h b/base/vulkanexamplebase.h index 71f15a83..ac73ed22 100644 --- a/base/vulkanexamplebase.h +++ b/base/vulkanexamplebase.h @@ -276,7 +276,8 @@ public: bool quit = false; #endif - VulkanExampleBase(bool enableValidation = false); + /** @brief Default base class constructor */ + VulkanExampleBase(); virtual ~VulkanExampleBase(); /** @brief Setup the vulkan instance, enable required extensions and connect to the physical device (GPU) */ bool initVulkan(); diff --git a/examples/bloom/bloom.cpp b/examples/bloom/bloom.cpp index 7750e2ef..7cd3d994 100644 --- a/examples/bloom/bloom.cpp +++ b/examples/bloom/bloom.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false // Offscreen frame buffer properties #define FB_DIM 256 @@ -93,7 +92,7 @@ public: std::array framebuffers; } offscreenPass; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Bloom (offscreen rendering)"; timerSpeed *= 0.5f; diff --git a/examples/computecloth/computecloth.cpp b/examples/computecloth/computecloth.cpp index 87b2bb0f..59176415 100644 --- a/examples/computecloth/computecloth.cpp +++ b/examples/computecloth/computecloth.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -89,7 +88,7 @@ public: glm::vec2 size = glm::vec2(5.0f); } cloth; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Compute shader cloth simulation"; camera.type = Camera::CameraType::lookat; diff --git a/examples/computecullandlod/computecullandlod.cpp b/examples/computecullandlod/computecullandlod.cpp index d7000e1d..0d5c4ba9 100644 --- a/examples/computecullandlod/computecullandlod.cpp +++ b/examples/computecullandlod/computecullandlod.cpp @@ -11,7 +11,6 @@ #include "VulkanglTFModel.h" #include "frustum.hpp" -#define ENABLE_VALIDATION false // Total number of objects (^3) in the scene #if defined(__ANDROID__) @@ -89,7 +88,7 @@ public: uint32_t objectCount = 0; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Vulkan Example - Compute cull and lod"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/computenbody/computenbody.cpp b/examples/computenbody/computenbody.cpp index dec0a00f..ec503d13 100644 --- a/examples/computenbody/computenbody.cpp +++ b/examples/computenbody/computenbody.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false #if defined(__ANDROID__) // Lower particle count on Android for performance reasons #define PARTICLES_PER_ATTRACTOR 3 * 1024 @@ -79,7 +78,7 @@ public: glm::vec4 vel; // xyz = velocity, w = gradient texture position }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Compute shader N-body system"; camera.type = Camera::CameraType::lookat; diff --git a/examples/computeparticles/computeparticles.cpp b/examples/computeparticles/computeparticles.cpp index 87f91a6d..7e6b9cdb 100644 --- a/examples/computeparticles/computeparticles.cpp +++ b/examples/computeparticles/computeparticles.cpp @@ -11,7 +11,6 @@ #include "vulkanexamplebase.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false #if defined(__ANDROID__) // Lower particle count on Android for performance reasons #define PARTICLE_COUNT 128 * 1024 @@ -75,7 +74,7 @@ public: glm::vec4 gradientPos; // Texture coordinates for the gradient ramp map }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Compute shader particle system"; } diff --git a/examples/computeraytracing/computeraytracing.cpp b/examples/computeraytracing/computeraytracing.cpp index 60031a6a..48a3d4b0 100644 --- a/examples/computeraytracing/computeraytracing.cpp +++ b/examples/computeraytracing/computeraytracing.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false #if defined(__ANDROID__) #define TEX_DIM 1024 @@ -79,7 +78,7 @@ public: glm::ivec3 _pad; }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Compute shader ray tracing"; compute.ubo.aspectRatio = (float)width / (float)height; diff --git a/examples/computeshader/computeshader.cpp b/examples/computeshader/computeshader.cpp index 496d519f..d634fa80 100644 --- a/examples/computeshader/computeshader.cpp +++ b/examples/computeshader/computeshader.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false // Vertex layout for this example struct Vertex { @@ -67,7 +66,7 @@ public: std::vector shaderNames; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Compute shader image load/store"; camera.type = Camera::CameraType::lookat; diff --git a/examples/conditionalrender/conditionalrender.cpp b/examples/conditionalrender/conditionalrender.cpp index 2cc6bdf4..3d256f83 100644 --- a/examples/conditionalrender/conditionalrender.cpp +++ b/examples/conditionalrender/conditionalrender.cpp @@ -14,7 +14,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -40,7 +39,7 @@ public: VkDescriptorSetLayout descriptorSetLayout; VkDescriptorSet descriptorSet; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Conditional rendering"; camera.type = Camera::CameraType::lookat; diff --git a/examples/conservativeraster/conservativeraster.cpp b/examples/conservativeraster/conservativeraster.cpp index c2d7b518..5b8d9515 100644 --- a/examples/conservativeraster/conservativeraster.cpp +++ b/examples/conservativeraster/conservativeraster.cpp @@ -12,7 +12,6 @@ #include "vulkanexamplebase.h" -#define ENABLE_VALIDATION false #define FB_COLOR_FORMAT VK_FORMAT_R8G8B8A8_UNORM #define ZOOM_FACTOR 16 @@ -84,7 +83,7 @@ public: VkDescriptorImageInfo descriptor; } offscreenPass; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Conservative rasterization"; diff --git a/examples/debugprintf/debugprintf.cpp b/examples/debugprintf/debugprintf.cpp index 77f5140e..0345836d 100644 --- a/examples/debugprintf/debugprintf.cpp +++ b/examples/debugprintf/debugprintf.cpp @@ -17,7 +17,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -36,7 +35,7 @@ public: VkDescriptorSetLayout descriptorSetLayout{ VK_NULL_HANDLE }; VkDescriptorSet descriptorSet{ VK_NULL_HANDLE }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Debug output with shader printf"; camera.setRotation(glm::vec3(-4.35f, 16.25f, 0.0f)); diff --git a/examples/debugutils/debugutils.cpp b/examples/debugutils/debugutils.cpp index c8627094..e02fbc59 100644 --- a/examples/debugutils/debugutils.cpp +++ b/examples/debugutils/debugutils.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -79,7 +77,7 @@ public: PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT{ nullptr }; PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT{ nullptr }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Debugging with VK_EXT_debug_utils"; camera.setRotation(glm::vec3(-4.35f, 16.25f, 0.0f)); diff --git a/examples/deferred/deferred.cpp b/examples/deferred/deferred.cpp index fb1c3ebd..5aa4f3e5 100644 --- a/examples/deferred/deferred.cpp +++ b/examples/deferred/deferred.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false // Texture properties #define TEX_DIM 2048 @@ -100,7 +99,7 @@ public: // Semaphore used to synchronize between offscreen and final scene rendering VkSemaphore offscreenSemaphore = VK_NULL_HANDLE; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Deferred shading"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/deferredmultisampling/deferredmultisampling.cpp b/examples/deferredmultisampling/deferredmultisampling.cpp index 16ba69ed..25b3c024 100644 --- a/examples/deferredmultisampling/deferredmultisampling.cpp +++ b/examples/deferredmultisampling/deferredmultisampling.cpp @@ -10,7 +10,6 @@ #include "VulkanFrameBuffer.hpp" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false #if defined(__ANDROID__) // Use max. screen dimension as deferred framebuffer size @@ -90,7 +89,7 @@ public: // Semaphore used to synchronize between offscreen and final scene rendering VkSemaphore offscreenSemaphore = VK_NULL_HANDLE; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Multi sampled deferred shading"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/deferredshadows/deferredshadows.cpp b/examples/deferredshadows/deferredshadows.cpp index 5cd24caa..3b295fb2 100644 --- a/examples/deferredshadows/deferredshadows.cpp +++ b/examples/deferredshadows/deferredshadows.cpp @@ -11,7 +11,6 @@ #include "VulkanglTFModel.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false // Shadowmap properties #if defined(__ANDROID__) @@ -129,7 +128,7 @@ public: // Semaphore used to synchronize between offscreen and final scene rendering VkSemaphore offscreenSemaphore = VK_NULL_HANDLE; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Deferred shading with shadows"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/descriptorbuffer/descriptorbuffer.cpp b/examples/descriptorbuffer/descriptorbuffer.cpp index b435eff1..e3197ba4 100644 --- a/examples/descriptorbuffer/descriptorbuffer.cpp +++ b/examples/descriptorbuffer/descriptorbuffer.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -63,7 +62,7 @@ public: return vkGetBufferDeviceAddressKHR(vulkanDevice->logicalDevice, &bufferDeviceAI); } - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Descriptor buffers (VK_EXT_descriptor_buffer)"; camera.type = Camera::CameraType::lookat; diff --git a/examples/descriptorindexing/descriptorindexing.cpp b/examples/descriptorindexing/descriptorindexing.cpp index 78ec03cb..c2d45f7a 100644 --- a/examples/descriptorindexing/descriptorindexing.cpp +++ b/examples/descriptorindexing/descriptorindexing.cpp @@ -13,7 +13,6 @@ #include "vulkanexamplebase.h" -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -45,7 +44,7 @@ public: int32_t textureIndex; }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Descriptor indexing"; camera.type = Camera::CameraType::lookat; diff --git a/examples/descriptorsets/descriptorsets.cpp b/examples/descriptorsets/descriptorsets.cpp index de55c75d..e656a9e0 100644 --- a/examples/descriptorsets/descriptorsets.cpp +++ b/examples/descriptorsets/descriptorsets.cpp @@ -11,7 +11,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -38,7 +37,7 @@ public: VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Using descriptor Sets"; camera.type = Camera::CameraType::lookat; diff --git a/examples/displacement/displacement.cpp b/examples/displacement/displacement.cpp index 2ae6b0ff..fb96c4bd 100644 --- a/examples/displacement/displacement.cpp +++ b/examples/displacement/displacement.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -48,7 +47,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Tessellation shader displacement"; camera.type = Camera::CameraType::lookat; diff --git a/examples/distancefieldfonts/distancefieldfonts.cpp b/examples/distancefieldfonts/distancefieldfonts.cpp index 2b9e939c..57588e1e 100644 --- a/examples/distancefieldfonts/distancefieldfonts.cpp +++ b/examples/distancefieldfonts/distancefieldfonts.cpp @@ -11,7 +11,6 @@ #include "vulkanexamplebase.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false // Vertex layout for this example struct Vertex { @@ -93,7 +92,7 @@ public: VkPipelineLayout pipelineLayout; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Distance field font rendering"; camera.type = Camera::CameraType::lookat; diff --git a/examples/dynamicrendering/dynamicrendering.cpp b/examples/dynamicrendering/dynamicrendering.cpp index f3ae6642..19ff7e11 100644 --- a/examples/dynamicrendering/dynamicrendering.cpp +++ b/examples/dynamicrendering/dynamicrendering.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -33,7 +32,7 @@ public: VkDescriptorSet descriptorSet{ VK_NULL_HANDLE }; VkDescriptorSetLayout descriptorSetLayout{ VK_NULL_HANDLE }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Dynamic rendering"; camera.type = Camera::CameraType::lookat; diff --git a/examples/dynamicstate/dynamicstate.cpp b/examples/dynamicstate/dynamicstate.cpp index 688c8913..bd188ef4 100644 --- a/examples/dynamicstate/dynamicstate.cpp +++ b/examples/dynamicstate/dynamicstate.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false class VulkanExample: public VulkanExampleBase { @@ -69,7 +68,7 @@ public: bool colorBlendEnable = false; } dynamicState3; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Dynamic state"; camera.type = Camera::CameraType::lookat; diff --git a/examples/dynamicuniformbuffer/dynamicuniformbuffer.cpp b/examples/dynamicuniformbuffer/dynamicuniformbuffer.cpp index 5e450838..8695d733 100644 --- a/examples/dynamicuniformbuffer/dynamicuniformbuffer.cpp +++ b/examples/dynamicuniformbuffer/dynamicuniformbuffer.cpp @@ -19,7 +19,6 @@ #include "vulkanexamplebase.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false #define OBJECT_INSTANCES 125 // Vertex layout for this example @@ -94,7 +93,7 @@ public: size_t dynamicAlignment; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Dynamic uniform buffers"; camera.type = Camera::CameraType::lookat; diff --git a/examples/gears/gears.cpp b/examples/gears/gears.cpp index e116852a..277bbf5c 100644 --- a/examples/gears/gears.cpp +++ b/examples/gears/gears.cpp @@ -9,7 +9,6 @@ #include "vulkangear.h" #include "vulkanexamplebase.h" -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -26,7 +25,7 @@ public: VkPipelineLayout pipelineLayout{ VK_NULL_HANDLE }; VkDescriptorSetLayout descriptorSetLayout{ VK_NULL_HANDLE }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Vulkan gears"; camera.type = Camera::CameraType::lookat; diff --git a/examples/geometryshader/geometryshader.cpp b/examples/geometryshader/geometryshader.cpp index e2c23a63..9fdfb00c 100644 --- a/examples/geometryshader/geometryshader.cpp +++ b/examples/geometryshader/geometryshader.cpp @@ -10,7 +10,6 @@ #include "VulkanglTFModel.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false class VulkanExample : public VulkanExampleBase { @@ -44,7 +43,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Geometry shader normal debugging"; camera.type = Camera::CameraType::lookat; diff --git a/examples/gltfloading/gltfloading.cpp b/examples/gltfloading/gltfloading.cpp index ca072c96..1cc2808e 100644 --- a/examples/gltfloading/gltfloading.cpp +++ b/examples/gltfloading/gltfloading.cpp @@ -27,7 +27,6 @@ #include "vulkanexamplebase.h" -#define ENABLE_VALIDATION false // Contains everything required to render a glTF model in Vulkan // This class is heavily simplified (compared to glTF's feature set) but retains the basic glTF structure @@ -408,7 +407,7 @@ public: VkDescriptorSetLayout textures; } descriptorSetLayouts; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "glTF model rendering"; camera.type = Camera::CameraType::lookat; diff --git a/examples/gltfscenerendering/gltfscenerendering.cpp b/examples/gltfscenerendering/gltfscenerendering.cpp index be30f6ad..648126ed 100644 --- a/examples/gltfscenerendering/gltfscenerendering.cpp +++ b/examples/gltfscenerendering/gltfscenerendering.cpp @@ -284,7 +284,7 @@ void VulkanglTFScene::draw(VkCommandBuffer commandBuffer, VkPipelineLayout pipel Vulkan Example class */ -VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) +VulkanExample::VulkanExample() : VulkanExampleBase() { title = "glTF scene rendering"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/gltfscenerendering/gltfscenerendering.h b/examples/gltfscenerendering/gltfscenerendering.h index b29c90b1..2afc4045 100644 --- a/examples/gltfscenerendering/gltfscenerendering.h +++ b/examples/gltfscenerendering/gltfscenerendering.h @@ -24,7 +24,6 @@ #include "vulkanexamplebase.h" -#define ENABLE_VALIDATION false // Contains everything required to render a basic glTF scene in Vulkan // This class is heavily simplified (compared to glTF's feature set) but retains the basic glTF structure diff --git a/examples/gltfskinning/gltfskinning.cpp b/examples/gltfskinning/gltfskinning.cpp index aa6b70c5..1c81fce3 100644 --- a/examples/gltfskinning/gltfskinning.cpp +++ b/examples/gltfskinning/gltfskinning.cpp @@ -637,8 +637,7 @@ void VulkanglTFModel::draw(VkCommandBuffer commandBuffer, VkPipelineLayout pipel */ -VulkanExample::VulkanExample() : - VulkanExampleBase(ENABLE_VALIDATION) +VulkanExample::VulkanExample() : VulkanExampleBase() { title = "glTF vertex skinning"; camera.type = Camera::CameraType::lookat; diff --git a/examples/gltfskinning/gltfskinning.h b/examples/gltfskinning/gltfskinning.h index 67f9c070..a8e08942 100644 --- a/examples/gltfskinning/gltfskinning.h +++ b/examples/gltfskinning/gltfskinning.h @@ -38,7 +38,6 @@ #include "vulkanexamplebase.h" #include -#define ENABLE_VALIDATION false // Contains everything required to render a glTF model in Vulkan // This class is heavily simplified (compared to glTF's feature set) but retains the basic glTF structure diff --git a/examples/graphicspipelinelibrary/graphicspipelinelibrary.cpp b/examples/graphicspipelinelibrary/graphicspipelinelibrary.cpp index 797c9338..946dbb82 100644 --- a/examples/graphicspipelinelibrary/graphicspipelinelibrary.cpp +++ b/examples/graphicspipelinelibrary/graphicspipelinelibrary.cpp @@ -11,8 +11,6 @@ #include #include -#define ENABLE_VALIDATION false - class VulkanExample: public VulkanExampleBase { public: @@ -58,7 +56,7 @@ public: std::vector colors{}; float rotation{ 0.0f }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Graphics pipeline library"; camera.type = Camera::CameraType::lookat; diff --git a/examples/hdr/hdr.cpp b/examples/hdr/hdr.cpp index a49c0b47..9601f08c 100644 --- a/examples/hdr/hdr.cpp +++ b/examples/hdr/hdr.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -100,7 +98,7 @@ public: std::vector objectNames; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "High dynamic range rendering"; camera.type = Camera::CameraType::lookat; diff --git a/examples/imgui/main.cpp b/examples/imgui/main.cpp index cc80ef52..0a1c6a6f 100644 --- a/examples/imgui/main.cpp +++ b/examples/imgui/main.cpp @@ -10,8 +10,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - // Options and values to display/toggle from the UI struct UISettings { bool displayModels = true; @@ -561,7 +559,7 @@ public: VkDescriptorSetLayout descriptorSetLayout; VkDescriptorSet descriptorSet; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Vulkan Example - ImGui"; camera.type = Camera::CameraType::lookat; diff --git a/examples/indirectdraw/indirectdraw.cpp b/examples/indirectdraw/indirectdraw.cpp index 4baee4aa..59e14746 100644 --- a/examples/indirectdraw/indirectdraw.cpp +++ b/examples/indirectdraw/indirectdraw.cpp @@ -24,8 +24,6 @@ #define VERTEX_BUFFER_BIND_ID 0 #define INSTANCE_BUFFER_BIND_ID 1 -#define ENABLE_VALIDATION false - // Number of instances per object #if defined(__ANDROID__) #define OBJECT_INSTANCE_COUNT 1024 @@ -91,7 +89,7 @@ public: // Store the indirect draw commands containing index offsets and instance count per object std::vector indirectCommands; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Indirect rendering"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/inlineuniformblocks/inlineuniformblocks.cpp b/examples/inlineuniformblocks/inlineuniformblocks.cpp index 5e0adcf7..559ce7d3 100644 --- a/examples/inlineuniformblocks/inlineuniformblocks.cpp +++ b/examples/inlineuniformblocks/inlineuniformblocks.cpp @@ -13,8 +13,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - float rnd() { return static_cast(rand()) / static_cast(RAND_MAX); } @@ -65,7 +63,7 @@ public: VkDescriptorSetLayout object; } descriptorSetLayouts; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Inline uniform blocks"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/inputattachments/inputattachments.cpp b/examples/inputattachments/inputattachments.cpp index 65b301cc..ec651d3f 100644 --- a/examples/inputattachments/inputattachments.cpp +++ b/examples/inputattachments/inputattachments.cpp @@ -13,8 +13,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -71,7 +69,7 @@ public: const VkFormat colorFormat = VK_FORMAT_R8G8B8A8_UNORM; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Input attachments"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/instancing/instancing.cpp b/examples/instancing/instancing.cpp index a6585d82..bb625688 100644 --- a/examples/instancing/instancing.cpp +++ b/examples/instancing/instancing.cpp @@ -11,7 +11,6 @@ #define VERTEX_BUFFER_BIND_ID 0 #define INSTANCE_BUFFER_BIND_ID 1 -#define ENABLE_VALIDATION false #if defined(__ANDROID__) #define INSTANCE_COUNT 4096 #else @@ -72,7 +71,7 @@ public: VkDescriptorSet planet; } descriptorSets; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Instanced mesh rendering"; camera.type = Camera::CameraType::lookat; diff --git a/examples/meshshader/meshshader.cpp b/examples/meshshader/meshshader.cpp index 8d0aafad..a9fdb95a 100644 --- a/examples/meshshader/meshshader.cpp +++ b/examples/meshshader/meshshader.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -32,7 +30,7 @@ public: VkPhysicalDeviceMeshShaderFeaturesEXT enabledMeshShaderFeatures{}; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Mesh shaders"; timerSpeed *= 0.25f; diff --git a/examples/multisampling/multisampling.cpp b/examples/multisampling/multisampling.cpp index 4272ae2f..32c9039b 100644 --- a/examples/multisampling/multisampling.cpp +++ b/examples/multisampling/multisampling.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - struct { struct { VkImage image; @@ -50,7 +48,7 @@ public: VkDescriptorSetLayout descriptorSetLayout; VkExtent2D attachmentSize; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Multisampling"; camera.type = Camera::CameraType::lookat; diff --git a/examples/multithreading/multithreading.cpp b/examples/multithreading/multithreading.cpp index 24b7beb7..4af6d555 100644 --- a/examples/multithreading/multithreading.cpp +++ b/examples/multithreading/multithreading.cpp @@ -13,8 +13,6 @@ #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -95,7 +93,7 @@ public: std::default_random_engine rndEngine; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Multi threaded command buffer"; camera.type = Camera::CameraType::lookat; diff --git a/examples/multiview/multiview.cpp b/examples/multiview/multiview.cpp index 5c9907e3..7b9fd6db 100644 --- a/examples/multiview/multiview.cpp +++ b/examples/multiview/multiview.cpp @@ -11,8 +11,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -58,7 +56,7 @@ public: const float zNear = 0.1f; const float zFar = 256.0f; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Multiview rendering"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/negativeviewportheight/negativeviewportheight.cpp b/examples/negativeviewportheight/negativeviewportheight.cpp index 594b412c..473c4eb1 100644 --- a/examples/negativeviewportheight/negativeviewportheight.cpp +++ b/examples/negativeviewportheight/negativeviewportheight.cpp @@ -10,8 +10,6 @@ #include "vulkanexamplebase.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -49,7 +47,7 @@ public: } } quad; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Negative Viewport height"; // [POI] VK_KHR_MAINTENANCE1 is required for using negative viewport heights diff --git a/examples/occlusionquery/occlusionquery.cpp b/examples/occlusionquery/occlusionquery.cpp index 0d0da2df..2801ccca 100644 --- a/examples/occlusionquery/occlusionquery.cpp +++ b/examples/occlusionquery/occlusionquery.cpp @@ -10,8 +10,6 @@ #include "VulkanglTFModel.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -59,7 +57,7 @@ public: // Passed query samples uint64_t passedSamples[2] = { 1,1 }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Occlusion queries"; camera.type = Camera::CameraType::lookat; diff --git a/examples/offscreen/offscreen.cpp b/examples/offscreen/offscreen.cpp index 6c96bf34..fccd6f60 100644 --- a/examples/offscreen/offscreen.cpp +++ b/examples/offscreen/offscreen.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - // Offscreen frame buffer properties #define FB_DIM 512 #define FB_COLOR_FORMAT VK_FORMAT_R8G8B8A8_UNORM @@ -79,7 +77,7 @@ public: glm::vec3 modelPosition = glm::vec3(0.0f, -1.0f, 0.0f); glm::vec3 modelRotation = glm::vec3(0.0f); - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Offscreen rendering"; timerSpeed *= 0.25f; diff --git a/examples/oit/oit.cpp b/examples/oit/oit.cpp index bc7f3fae..0a23f816 100644 --- a/examples/oit/oit.cpp +++ b/examples/oit/oit.cpp @@ -10,7 +10,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false #define NODE_COUNT 20 class VulkanExample : public VulkanExampleBase @@ -74,7 +73,7 @@ public: VkDescriptorSet color; } descriptorSets; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Order independent transparency rendering"; camera.type = Camera::CameraType::lookat; diff --git a/examples/parallaxmapping/parallaxmapping.cpp b/examples/parallaxmapping/parallaxmapping.cpp index d9af12e8..a9806ff0 100644 --- a/examples/parallaxmapping/parallaxmapping.cpp +++ b/examples/parallaxmapping/parallaxmapping.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -62,7 +60,7 @@ public: "Parallax occlusion mapping", }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Parallax Mapping"; timerSpeed *= 0.5f; diff --git a/examples/particlesystem/particlesystem.cpp b/examples/particlesystem/particlesystem.cpp index 3493a5db..ab4f3ba7 100644 --- a/examples/particlesystem/particlesystem.cpp +++ b/examples/particlesystem/particlesystem.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false #define PARTICLE_COUNT 512 #define PARTICLE_SIZE 10.0f @@ -97,7 +96,7 @@ public: std::default_random_engine rndEngine; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "CPU based particle system"; camera.type = Camera::CameraType::lookat; diff --git a/examples/pbrbasic/pbrbasic.cpp b/examples/pbrbasic/pbrbasic.cpp index 05e0ed06..7ad90678 100644 --- a/examples/pbrbasic/pbrbasic.cpp +++ b/examples/pbrbasic/pbrbasic.cpp @@ -12,7 +12,6 @@ #include "VulkanglTFModel.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false #define GRID_DIM 7 #define OBJ_DIM 0.05f @@ -70,7 +69,7 @@ public: std::vector materialNames; std::vector objectNames; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Physical based shading basics"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/pbribl/pbribl.cpp b/examples/pbribl/pbribl.cpp index 6a6d9177..48802ab5 100644 --- a/examples/pbribl/pbribl.cpp +++ b/examples/pbribl/pbribl.cpp @@ -11,7 +11,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false #define GRID_DIM 7 struct Material { @@ -89,7 +88,7 @@ public: std::vector materialNames; std::vector objectNames; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "PBR with image based lighting"; diff --git a/examples/pbrtexture/pbrtexture.cpp b/examples/pbrtexture/pbrtexture.cpp index 485a6deb..47d274a7 100644 --- a/examples/pbrtexture/pbrtexture.cpp +++ b/examples/pbrtexture/pbrtexture.cpp @@ -11,8 +11,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -69,7 +67,7 @@ public: VkPipelineLayout pipelineLayout; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Textured PBR with IBL"; diff --git a/examples/pipelines/pipelines.cpp b/examples/pipelines/pipelines.cpp index 07126190..1792fe5d 100644 --- a/examples/pipelines/pipelines.cpp +++ b/examples/pipelines/pipelines.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample: public VulkanExampleBase { public: @@ -35,7 +33,7 @@ public: VkPipeline toon; } pipelines; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Pipeline state objects"; camera.type = Camera::CameraType::lookat; diff --git a/examples/pipelinestatistics/pipelinestatistics.cpp b/examples/pipelinestatistics/pipelinestatistics.cpp index e79918ab..753cb405 100644 --- a/examples/pipelinestatistics/pipelinestatistics.cpp +++ b/examples/pipelinestatistics/pipelinestatistics.cpp @@ -9,7 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false #define OBJ_DIM 0.05f class VulkanExample : public VulkanExampleBase @@ -51,7 +50,7 @@ public: int32_t gridSize = 3; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Pipeline statistics"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/pushconstants/pushconstants.cpp b/examples/pushconstants/pushconstants.cpp index 714a26f2..8163a0f6 100644 --- a/examples/pushconstants/pushconstants.cpp +++ b/examples/pushconstants/pushconstants.cpp @@ -17,8 +17,6 @@ #include "VulkanglTFModel.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false - float rnd() { return static_cast(rand()) / static_cast(RAND_MAX); @@ -49,7 +47,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Push constants"; camera.type = Camera::CameraType::lookat; diff --git a/examples/pushdescriptors/pushdescriptors.cpp b/examples/pushdescriptors/pushdescriptors.cpp index 483ccf45..82497650 100644 --- a/examples/pushdescriptors/pushdescriptors.cpp +++ b/examples/pushdescriptors/pushdescriptors.cpp @@ -16,8 +16,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -49,7 +47,7 @@ public: VkPipelineLayout pipelineLayout; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Push descriptors"; camera.type = Camera::CameraType::lookat; diff --git a/examples/radialblur/radialblur.cpp b/examples/radialblur/radialblur.cpp index c2a5f733..3da0024a 100644 --- a/examples/radialblur/radialblur.cpp +++ b/examples/radialblur/radialblur.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - // Offscreen frame buffer properties #define FB_DIM 512 #define FB_COLOR_FORMAT VK_FORMAT_R8G8B8A8_UNORM @@ -81,7 +79,7 @@ public: VkDescriptorImageInfo descriptor; } offscreenPass; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Full screen radial blur effect"; camera.type = Camera::CameraType::lookat; diff --git a/examples/rayquery/rayquery.cpp b/examples/rayquery/rayquery.cpp index a2a7e2f1..b261e0c4 100644 --- a/examples/rayquery/rayquery.cpp +++ b/examples/rayquery/rayquery.cpp @@ -10,8 +10,6 @@ #include "VulkanglTFModel.h" #include "VulkanRaytracingSample.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanRaytracingSample { public: diff --git a/examples/screenshot/screenshot.cpp b/examples/screenshot/screenshot.cpp index b48c326f..ed78a2f9 100644 --- a/examples/screenshot/screenshot.cpp +++ b/examples/screenshot/screenshot.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -31,7 +29,7 @@ public: bool screenshotSaved = false; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Saving framebuffer to screenshot"; camera.type = Camera::CameraType::lookat; diff --git a/examples/shaderobjects/shaderobjects.cpp b/examples/shaderobjects/shaderobjects.cpp index d32b7bdc..4e4378fa 100644 --- a/examples/shaderobjects/shaderobjects.cpp +++ b/examples/shaderobjects/shaderobjects.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample: public VulkanExampleBase { public: @@ -65,7 +63,7 @@ public: // VK_EXT_vertex_input_dynamic_state PFN_vkCmdSetVertexInputEXT vkCmdSetVertexInputEXT; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Shader objects (VK_EXT_shader_object)"; camera.type = Camera::CameraType::lookat; diff --git a/examples/shadowmapping/shadowmapping.cpp b/examples/shadowmapping/shadowmapping.cpp index 9efad772..40a4d88e 100644 --- a/examples/shadowmapping/shadowmapping.cpp +++ b/examples/shadowmapping/shadowmapping.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - // 16 bits of depth is enough for such a small scene #define DEPTH_FORMAT VK_FORMAT_D16_UNORM @@ -97,7 +95,7 @@ public: VkDescriptorImageInfo descriptor; } offscreenPass; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Projected shadow mapping"; camera.type = Camera::CameraType::lookat; diff --git a/examples/shadowmappingcascade/shadowmappingcascade.cpp b/examples/shadowmappingcascade/shadowmappingcascade.cpp index a5d2e462..39bdc6cf 100644 --- a/examples/shadowmappingcascade/shadowmappingcascade.cpp +++ b/examples/shadowmappingcascade/shadowmappingcascade.cpp @@ -20,8 +20,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - #if defined(__ANDROID__) #define SHADOWMAP_DIM 2048 #else @@ -132,7 +130,7 @@ public: }; std::array cascades; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Cascaded shadow mapping"; timerSpeed *= 0.025f; diff --git a/examples/shadowmappingomni/shadowmappingomni.cpp b/examples/shadowmappingomni/shadowmappingomni.cpp index 5ee8a331..a99b3c1f 100644 --- a/examples/shadowmappingomni/shadowmappingomni.cpp +++ b/examples/shadowmappingomni/shadowmappingomni.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - // Texture properties #define TEX_DIM 1024 #define TEX_FILTER VK_FILTER_LINEAR @@ -91,7 +89,7 @@ public: VkFormat fbDepthFormat; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Point light shadows (cubemap)"; camera.type = Camera::CameraType::lookat; diff --git a/examples/specializationconstants/specializationconstants.cpp b/examples/specializationconstants/specializationconstants.cpp index e8442517..f4dc9572 100644 --- a/examples/specializationconstants/specializationconstants.cpp +++ b/examples/specializationconstants/specializationconstants.cpp @@ -11,8 +11,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample: public VulkanExampleBase { public: @@ -37,7 +35,7 @@ public: VkPipeline textured; } pipelines; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Specialization constants"; camera.type = Camera::CameraType::lookat; diff --git a/examples/sphericalenvmapping/sphericalenvmapping.cpp b/examples/sphericalenvmapping/sphericalenvmapping.cpp index 5b2c7a93..f6af384e 100644 --- a/examples/sphericalenvmapping/sphericalenvmapping.cpp +++ b/examples/sphericalenvmapping/sphericalenvmapping.cpp @@ -14,8 +14,6 @@ #include "VulkanglTFModel.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -36,7 +34,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Spherical Environment Mapping"; camera.type = Camera::CameraType::lookat; diff --git a/examples/ssao/ssao.cpp b/examples/ssao/ssao.cpp index abcde467..6587ce5f 100644 --- a/examples/ssao/ssao.cpp +++ b/examples/ssao/ssao.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - #define SSAO_KERNEL_SIZE 64 #define SSAO_RADIUS 0.3f @@ -121,7 +119,7 @@ public: // One sampler for the frame buffer color attachments VkSampler colorSampler; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Screen space ambient occlusion"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/stencilbuffer/stencilbuffer.cpp b/examples/stencilbuffer/stencilbuffer.cpp index 6ce72bb7..d0b71271 100644 --- a/examples/stencilbuffer/stencilbuffer.cpp +++ b/examples/stencilbuffer/stencilbuffer.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -35,7 +33,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Stencil buffer outlines"; timerSpeed *= 0.25f; diff --git a/examples/subpasses/subpasses.cpp b/examples/subpasses/subpasses.cpp index 7e052ca2..a8514b46 100644 --- a/examples/subpasses/subpasses.cpp +++ b/examples/subpasses/subpasses.cpp @@ -19,8 +19,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -89,7 +87,7 @@ public: int32_t height; } attachments; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Subpasses"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/terraintessellation/terraintessellation.cpp b/examples/terraintessellation/terraintessellation.cpp index 0eab2db3..021bc4e0 100644 --- a/examples/terraintessellation/terraintessellation.cpp +++ b/examples/terraintessellation/terraintessellation.cpp @@ -12,8 +12,6 @@ #include #include -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -98,7 +96,7 @@ public: // View frustum passed to tessellation control shader for culling vks::Frustum frustum; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Dynamic terrain tessellation"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/tessellation/tessellation.cpp b/examples/tessellation/tessellation.cpp index 4ddf53f6..c039c75d 100644 --- a/examples/tessellation/tessellation.cpp +++ b/examples/tessellation/tessellation.cpp @@ -12,8 +12,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -47,7 +45,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Tessellation shader (PN Triangles)"; camera.type = Camera::CameraType::lookat; diff --git a/examples/textoverlay/textoverlay.cpp b/examples/textoverlay/textoverlay.cpp index 282ba7a6..c894d421 100644 --- a/examples/textoverlay/textoverlay.cpp +++ b/examples/textoverlay/textoverlay.cpp @@ -12,8 +12,6 @@ #include "VulkanglTFModel.h" #include "../external/stb/stb_font_consolas_24_latin1.inl" -#define ENABLE_VALIDATION false - // Max. number of chars the text overlay buffer can hold #define TEXTOVERLAY_MAX_CHAR_COUNT 2048 @@ -636,7 +634,7 @@ public: VkDescriptorSetLayout descriptorSetLayout; VkDescriptorSet descriptorSet; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Vulkan Example - Text overlay"; camera.type = Camera::CameraType::lookat; diff --git a/examples/texture/texture.cpp b/examples/texture/texture.cpp index 8bc5ed12..fe1cb723 100644 --- a/examples/texture/texture.cpp +++ b/examples/texture/texture.cpp @@ -11,8 +11,6 @@ #include #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false - // Vertex layout for this example struct Vertex { float pos[3]; @@ -62,7 +60,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Texture loading"; camera.type = Camera::CameraType::lookat; diff --git a/examples/texture3d/texture3d.cpp b/examples/texture3d/texture3d.cpp index ab330b0e..d02a4ab1 100644 --- a/examples/texture3d/texture3d.cpp +++ b/examples/texture3d/texture3d.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #define VERTEX_BUFFER_BIND_ID 0 -#define ENABLE_VALIDATION false - // Vertex layout for this example struct Vertex { float pos[3]; @@ -168,7 +166,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "3D textures"; camera.type = Camera::CameraType::lookat; diff --git a/examples/texturearray/texturearray.cpp b/examples/texturearray/texturearray.cpp index fd56c20c..414007da 100644 --- a/examples/texturearray/texturearray.cpp +++ b/examples/texturearray/texturearray.cpp @@ -10,8 +10,6 @@ #include #include -#define ENABLE_VALIDATION false - #define MAX_LAYERS 8 // Vertex layout for this example @@ -58,7 +56,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Texture arrays"; camera.type = Camera::CameraType::lookat; diff --git a/examples/texturecubemap/texturecubemap.cpp b/examples/texturecubemap/texturecubemap.cpp index ab88aba3..a398153c 100644 --- a/examples/texturecubemap/texturecubemap.cpp +++ b/examples/texturecubemap/texturecubemap.cpp @@ -11,8 +11,6 @@ #include #include -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -53,7 +51,7 @@ public: std::vector objectNames; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Cube map textures"; camera.type = Camera::CameraType::lookat; diff --git a/examples/texturecubemaparray/texturecubemaparray.cpp b/examples/texturecubemaparray/texturecubemaparray.cpp index eed45c3d..74a6cf3c 100644 --- a/examples/texturecubemaparray/texturecubemaparray.cpp +++ b/examples/texturecubemaparray/texturecubemaparray.cpp @@ -11,8 +11,6 @@ #include #include -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -54,7 +52,7 @@ public: std::vector objectNames; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Cube map textures"; camera.type = Camera::CameraType::lookat; diff --git a/examples/texturemipmapgen/texturemipmapgen.cpp b/examples/texturemipmapgen/texturemipmapgen.cpp index 561bd6db..2691c4a6 100644 --- a/examples/texturemipmapgen/texturemipmapgen.cpp +++ b/examples/texturemipmapgen/texturemipmapgen.cpp @@ -11,8 +11,6 @@ #include #include -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -46,7 +44,7 @@ public: VkDescriptorSet descriptorSet; VkDescriptorSetLayout descriptorSetLayout; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Runtime mip map generation"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/texturesparseresidency/texturesparseresidency.cpp b/examples/texturesparseresidency/texturesparseresidency.cpp index 5602013c..68aef032 100644 --- a/examples/texturesparseresidency/texturesparseresidency.cpp +++ b/examples/texturesparseresidency/texturesparseresidency.cpp @@ -146,7 +146,7 @@ void VirtualTexture::destroy() /* Vulkan Example class */ -VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) +VulkanExample::VulkanExample() : VulkanExampleBase() { title = "Sparse texture residency"; std::cout.imbue(std::locale("")); diff --git a/examples/texturesparseresidency/texturesparseresidency.h b/examples/texturesparseresidency/texturesparseresidency.h index 5da19e18..07be5a91 100644 --- a/examples/texturesparseresidency/texturesparseresidency.h +++ b/examples/texturesparseresidency/texturesparseresidency.h @@ -13,8 +13,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - // Virtual texture page as a part of the partially resident texture // Contains memory bindings, offsets and status information struct VirtualTexturePage diff --git a/examples/triangle/triangle.cpp b/examples/triangle/triangle.cpp index 9a401c39..59f6f0a7 100644 --- a/examples/triangle/triangle.cpp +++ b/examples/triangle/triangle.cpp @@ -27,8 +27,6 @@ #include #include "vulkanexamplebase.h" -// Set to "true" to enable Vulkan's validation layers (see vulkandebug.cpp for details) -#define ENABLE_VALIDATION false // We want to keep GPU and CPU busy. To do that we may start building a new command buffer while the previous one is still being executed // This number defines how many frames may be worked on simultaneously at once // Increasing this number may improve performance but will also introduce additional latency @@ -115,7 +113,7 @@ public: // To select the correct sync objects, we need to keep track of the current frame uint32_t currentFrame{ 0 }; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Vulkan Example - Basic indexed triangle"; // To keep things simple, we don't use the UI overlay from the framework diff --git a/examples/variablerateshading/variablerateshading.cpp b/examples/variablerateshading/variablerateshading.cpp index fe41b4e8..53eb1c74 100644 --- a/examples/variablerateshading/variablerateshading.cpp +++ b/examples/variablerateshading/variablerateshading.cpp @@ -8,7 +8,7 @@ #include "variablerateshading.h" -VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) +VulkanExample::VulkanExample() : VulkanExampleBase() { title = "Variable rate shading"; apiVersion = VK_API_VERSION_1_1; diff --git a/examples/variablerateshading/variablerateshading.h b/examples/variablerateshading/variablerateshading.h index 9d2167c8..32602e02 100644 --- a/examples/variablerateshading/variablerateshading.h +++ b/examples/variablerateshading/variablerateshading.h @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: diff --git a/examples/vertexattributes/vertexattributes.cpp b/examples/vertexattributes/vertexattributes.cpp index 2eabaf08..491b1d3e 100644 --- a/examples/vertexattributes/vertexattributes.cpp +++ b/examples/vertexattributes/vertexattributes.cpp @@ -141,7 +141,7 @@ void VulkanExample::loadSceneNode(const tinygltf::Node& inputNode, const tinyglt } } -VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) +VulkanExample::VulkanExample() : VulkanExampleBase() { title = "Separate/interleaved vertex attribute buffers"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/vertexattributes/vertexattributes.h b/examples/vertexattributes/vertexattributes.h index 1630ee5d..ebfd508f 100644 --- a/examples/vertexattributes/vertexattributes.h +++ b/examples/vertexattributes/vertexattributes.h @@ -18,8 +18,6 @@ #include "vulkanexamplebase.h" -#define ENABLE_VALIDATION false - struct PushConstBlock { glm::mat4 nodeMatrix; uint32_t alphaMask; diff --git a/examples/viewportarray/viewportarray.cpp b/examples/viewportarray/viewportarray.cpp index 387b2e65..4396d857 100644 --- a/examples/viewportarray/viewportarray.cpp +++ b/examples/viewportarray/viewportarray.cpp @@ -9,8 +9,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -36,7 +34,7 @@ public: const float zNear = 0.1f; const float zFar = 256.0f; - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Viewport arrays"; camera.type = Camera::CameraType::firstperson; diff --git a/examples/vulkanscene/vulkanscene.cpp b/examples/vulkanscene/vulkanscene.cpp index 839cb5a9..66792164 100644 --- a/examples/vulkanscene/vulkanscene.cpp +++ b/examples/vulkanscene/vulkanscene.cpp @@ -11,8 +11,6 @@ #include "vulkanexamplebase.h" #include "VulkanglTFModel.h" -#define ENABLE_VALIDATION false - class VulkanExample : public VulkanExampleBase { public: @@ -52,7 +50,7 @@ public: glm::vec4 lightPos = glm::vec4(1.0f, 4.0f, 0.0f, 0.0f); - VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) + VulkanExample() : VulkanExampleBase() { title = "Vulkan Demo Scene - (c) by Sascha Willems"; camera.type = Camera::CameraType::lookat;