From 8d1c84b3f5198bb48457c5bd62cb9a55a6347091 Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Wed, 30 Sep 2020 12:00:32 +0200 Subject: [PATCH] Set warnings as errors for the generator, the samples, and the tests. --- CMakeLists.txt | 12 +- VulkanHppGenerator.cpp | 17 +- .../02_EnumerateDevices.cpp | 10 + .../06_InitDepthBuffer/06_InitDepthBuffer.cpp | 2 +- .../07_InitUniformBuffer.cpp | 14 +- .../09_InitDescriptorSet.cpp | 11 +- .../10_InitRenderPass/10_InitRenderPass.cpp | 11 +- .../13_InitVertexBuffer.cpp | 10 + samples/14_InitPipeline/14_InitPipeline.cpp | 10 + samples/15_DrawCube/15_DrawCube.cpp | 14 +- samples/CMakeLists.txt | 6 + samples/CopyBlitImage/CopyBlitImage.cpp | 4 +- .../DebugUtilsObjectName.cpp | 4 +- samples/DrawTexturedCube/DrawTexturedCube.cpp | 14 +- samples/DynamicUniform/DynamicUniform.cpp | 14 +- .../EnableValidationWithCallback.cpp | 10 + samples/ImmutableSampler/ImmutableSampler.cpp | 16 +- samples/InitTexture/InitTexture.cpp | 10 + samples/InputAttachment/InputAttachment.cpp | 14 +- samples/MultipleSets/MultipleSets.cpp | 16 +- samples/OcclusionQuery/OcclusionQuery.cpp | 18 +- .../PhysicalDeviceFeatures.cpp | 321 +++++++++--------- .../PhysicalDeviceGroups.cpp | 2 +- .../PhysicalDeviceProperties.cpp | 115 ++++--- samples/PipelineCache/PipelineCache.cpp | 18 +- .../PipelineDerivative/PipelineDerivative.cpp | 16 +- samples/PushConstants/PushConstants.cpp | 16 +- samples/PushDescriptors/PushDescriptors.cpp | 14 +- samples/RayTracing/CameraManipulator.cpp | 18 +- samples/RayTracing/RayTracing.cpp | 60 ++-- .../SecondaryCommandBuffer.cpp | 14 +- .../SeparateImageSampler.cpp | 16 +- .../SurfaceCapabilities.cpp | 8 +- samples/Template/Template.cpp | 14 +- samples/TexelBuffer/TexelBuffer.cpp | 4 +- samples/utils/math.cpp | 9 + samples/utils/math.hpp | 18 +- samples/utils/utils.cpp | 13 +- samples/utils/utils.hpp | 4 +- tests/CMakeLists.txt | 6 + tests/DeviceFunctions/DeviceFunctions.cpp | 9 + tests/StructureChain/StructureChain.cpp | 17 +- vulkan/vulkan.hpp | 4 + 43 files changed, 644 insertions(+), 309 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1a6bdd..eb760bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,12 +47,6 @@ else() message(WARNING " Could not find clang-format version 10 and up. Generated vulkan.hpp will not be nicely formatted.") endif() -if(MSVC) - add_compile_options(/W4 /permissive-) -else(MSVC) - add_compile_options(-Wall) -endif(MSVC) - if (NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 11) endif() @@ -118,6 +112,12 @@ add_executable(VulkanHppGenerator set_property(TARGET VulkanHppGenerator PROPERTY CXX_STANDARD 14) +if(MSVC) + target_compile_options(VulkanHppGenerator PRIVATE /W4 /WX /permissive-) +else(MSVC) + target_compile_options(VulkanHppGenerator PRIVATE -Wall -Wextra -pedantic -Werror) +endif(MSVC) + target_include_directories(VulkanHppGenerator PRIVATE ${VULKAN_HPP_TINYXML2_SRC_DIR}) option (VULKAN_HPP_RUN_GENERATOR "Run the HPP generator" OFF) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index ddf80f8..166f418 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -5586,17 +5586,6 @@ std::string std::set skippedParams = ::determineSkippedParams( returnParamIndex, vectorParamIndices ); if ( skippedParams.size() + ( commandData.handle.empty() ? 0 : 1 ) < commandData.params.size() ) { - // determine the last argument, where we might provide some default for - size_t lastArgument = INVALID_INDEX; - for ( size_t i = commandData.params.size() - 1; i < commandData.params.size(); i-- ) - { - if ( skippedParams.find( i ) == skippedParams.end() ) - { - lastArgument = i; - break; - } - } - str += " "; bool argEncountered = false; for ( size_t i = commandData.handle.empty() ? 0 : 1; i < commandData.params.size(); i++ ) @@ -7198,7 +7187,7 @@ std::map { if ( !it->len.empty() ) { - auto findIt = std::find_if( params.begin(), it, [this, ¶ms, &it]( ParamData const & pd ) { + auto findIt = std::find_if( params.begin(), it, [this, &it]( ParamData const & pd ) { return ( pd.name == it->len ) || isParamIndirect( it->len, pd ); } ); @@ -11095,6 +11084,10 @@ extern "C" __declspec( dllimport ) FARPROC __stdcall GetProcAddress( HINSTANCE h # endif #endif +#if !defined(__has_include) +# define __has_include(x) false +#endif + #if ( 201711 <= __cpp_impl_three_way_comparison ) && __has_include( ) # define VULKAN_HPP_HAS_SPACESHIP_OPERATOR #endif diff --git a/samples/02_EnumerateDevices/02_EnumerateDevices.cpp b/samples/02_EnumerateDevices/02_EnumerateDevices.cpp index 582aec7..ac201d8 100644 --- a/samples/02_EnumerateDevices/02_EnumerateDevices.cpp +++ b/samples/02_EnumerateDevices/02_EnumerateDevices.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : 02_EnumerateDevices // Enumerate physical devices +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wunused-variable" +#elif defined( __GNUC__ ) +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/utils.hpp" #include "vulkan/vulkan.hpp" diff --git a/samples/06_InitDepthBuffer/06_InitDepthBuffer.cpp b/samples/06_InitDepthBuffer/06_InitDepthBuffer.cpp index dec94ef..b9fa4b2 100644 --- a/samples/06_InitDepthBuffer/06_InitDepthBuffer.cpp +++ b/samples/06_InitDepthBuffer/06_InitDepthBuffer.cpp @@ -85,7 +85,7 @@ int main( int /*argc*/, char ** /*argv*/ ) } typeBits >>= 1; } - assert( typeIndex != ~0 ); + assert( typeIndex != uint32_t( ~0 ) ); vk::UniqueDeviceMemory depthMemory = device->allocateMemoryUnique( vk::MemoryAllocateInfo( memoryRequirements.size, typeIndex ) ); diff --git a/samples/07_InitUniformBuffer/07_InitUniformBuffer.cpp b/samples/07_InitUniformBuffer/07_InitUniformBuffer.cpp index 7f2552c..7fc8be5 100644 --- a/samples/07_InitUniformBuffer/07_InitUniformBuffer.cpp +++ b/samples/07_InitUniformBuffer/07_InitUniformBuffer.cpp @@ -15,14 +15,22 @@ // VulkanHpp Samples : 07_InitUniformBuffer // Initialize a uniform buffer +#if defined( _MSC_VER ) +# pragma warning( disable : 4127 ) // disable warning 4127: conditional expression is constant +# pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed + // to get glm/detail/type_vec?.hpp without warnings +#elif defined( __GNUC__ ) +// don't know how to switch off that warning here +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/utils.hpp" #include "vulkan/vulkan.hpp" #include -#define GLM_FORCE_RADIANS -#pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed - // to get glm/detail/type_vec?.hpp without warnings +# define GLM_FORCE_RADIANS #include static char const * AppName = "07_InitUniformBuffer"; diff --git a/samples/09_InitDescriptorSet/09_InitDescriptorSet.cpp b/samples/09_InitDescriptorSet/09_InitDescriptorSet.cpp index 681ce69..e7da2c8 100644 --- a/samples/09_InitDescriptorSet/09_InitDescriptorSet.cpp +++ b/samples/09_InitDescriptorSet/09_InitDescriptorSet.cpp @@ -15,6 +15,15 @@ // VulkanHpp Samples : 09_InitDescriptorSet // Initialize a descriptor set +#if defined( _MSC_VER ) +# pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed + // to get glm/detail/type_vec?.hpp without warnings +#elif defined( __GNUC__ ) +// don't know how to switch off that warning here +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/math.hpp" #include "../utils/utils.hpp" #include "vulkan/vulkan.hpp" @@ -22,8 +31,6 @@ #include #define GLM_FORCE_RADIANS -#pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed - // to get glm/detail/type_vec?.hpp without warnings #include static char const * AppName = "09_InitDescriptorSet"; diff --git a/samples/10_InitRenderPass/10_InitRenderPass.cpp b/samples/10_InitRenderPass/10_InitRenderPass.cpp index 8f4a2c6..e259b58 100644 --- a/samples/10_InitRenderPass/10_InitRenderPass.cpp +++ b/samples/10_InitRenderPass/10_InitRenderPass.cpp @@ -15,14 +15,21 @@ // VulkanHpp Samples : 10_InitRenderPass // Initialize a render pass +#if defined( _MSC_VER ) +# pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed + // to get glm/detail/type_vec?.hpp without warnings +#elif defined( __GNUC__ ) +// don't know how to switch off that warning here +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/utils.hpp" #include "vulkan/vulkan.hpp" #include #define GLM_FORCE_RADIANS -#pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed - // to get glm/detail/type_vec?.hpp without warnings #include static char const * AppName = "10_InitRenderPass"; diff --git a/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp b/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp index 68e98c3..bb71cfe 100644 --- a/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp +++ b/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : 13_InitVertexBuffer // Initialize vertex buffer +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/utils.hpp" #include "vulkan/vulkan.hpp" diff --git a/samples/14_InitPipeline/14_InitPipeline.cpp b/samples/14_InitPipeline/14_InitPipeline.cpp index d32725e..b229d63 100644 --- a/samples/14_InitPipeline/14_InitPipeline.cpp +++ b/samples/14_InitPipeline/14_InitPipeline.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : 14_InitPipeline // Initialize graphics pipeline +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +// no need to ignore any warnings with GCC +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" diff --git a/samples/15_DrawCube/15_DrawCube.cpp b/samples/15_DrawCube/15_DrawCube.cpp index 2c834b5..5d80cb0 100644 --- a/samples/15_DrawCube/15_DrawCube.cpp +++ b/samples/15_DrawCube/15_DrawCube.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : 15_DrawCube // Draw a cube +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -171,7 +181,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 94c7b23..5da13de 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -23,6 +23,12 @@ if(NOT (SAMPLES_BUILD_ONLY_DYNAMIC AND SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP)) find_package(Vulkan REQUIRED) endif() +if(MSVC) + add_compile_options(/W4 /WX /permissive-) +else(MSVC) + add_compile_options(-Wall -Wextra -pedantic -Werror) +endif(MSVC) + if (CMAKE_SYSTEM_NAME MATCHES "Windows") add_definitions(-DNOMINMAX -DVK_USE_PLATFORM_WIN32_KHR) elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") diff --git a/samples/CopyBlitImage/CopyBlitImage.cpp b/samples/CopyBlitImage/CopyBlitImage.cpp index 168c982..a22f993 100644 --- a/samples/CopyBlitImage/CopyBlitImage.cpp +++ b/samples/CopyBlitImage/CopyBlitImage.cpp @@ -235,7 +235,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/DebugUtilsObjectName/DebugUtilsObjectName.cpp b/samples/DebugUtilsObjectName/DebugUtilsObjectName.cpp index 13c42f4..171bc3c 100644 --- a/samples/DebugUtilsObjectName/DebugUtilsObjectName.cpp +++ b/samples/DebugUtilsObjectName/DebugUtilsObjectName.cpp @@ -63,12 +63,12 @@ int main( int /*argc*/, char ** /*argv*/ ) /* VULKAN_KEY_END */ } - catch ( vk::SystemError err ) + catch ( vk::SystemError & err ) { std::cout << "vk::SystemError: " << err.what() << std::endl; exit( -1 ); } - catch ( std::exception err ) + catch ( std::exception & err ) { std::cout << "std::exception: " << err.what() << std::endl; exit( -1 ); diff --git a/samples/DrawTexturedCube/DrawTexturedCube.cpp b/samples/DrawTexturedCube/DrawTexturedCube.cpp index d25574c..4f6005c 100644 --- a/samples/DrawTexturedCube/DrawTexturedCube.cpp +++ b/samples/DrawTexturedCube/DrawTexturedCube.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : DrawTexturedCube // Draw a textured cube +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -178,7 +188,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/DynamicUniform/DynamicUniform.cpp b/samples/DynamicUniform/DynamicUniform.cpp index e81a281..8e39a2b 100644 --- a/samples/DynamicUniform/DynamicUniform.cpp +++ b/samples/DynamicUniform/DynamicUniform.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : DynamicUniform // Draw 2 Cubes using dynamic uniform buffer +#if defined( _MSC_VER ) +# pragma warning( disable : 4127 ) // conditional expression is constant +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -223,7 +233,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/EnableValidationWithCallback/EnableValidationWithCallback.cpp b/samples/EnableValidationWithCallback/EnableValidationWithCallback.cpp index 13f1cce..2823b15 100644 --- a/samples/EnableValidationWithCallback/EnableValidationWithCallback.cpp +++ b/samples/EnableValidationWithCallback/EnableValidationWithCallback.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : EnableValidationWithCallback // Show how to enable validation layers and provide callback +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wunused-variable" +#elif defined( __GNUC__ ) +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/utils.hpp" #include "vulkan/vulkan.hpp" diff --git a/samples/ImmutableSampler/ImmutableSampler.cpp b/samples/ImmutableSampler/ImmutableSampler.cpp index 17ac69c..92f3f97 100644 --- a/samples/ImmutableSampler/ImmutableSampler.cpp +++ b/samples/ImmutableSampler/ImmutableSampler.cpp @@ -15,6 +15,18 @@ // VulkanHpp Samples : ImmutableSampler // Use an immutable sampler to texture a cube. +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -189,7 +201,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/InitTexture/InitTexture.cpp b/samples/InitTexture/InitTexture.cpp index 4f3019e..8552cdf 100644 --- a/samples/InitTexture/InitTexture.cpp +++ b/samples/InitTexture/InitTexture.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : InitTexture // Initialize texture +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wunused-variable" +#elif defined( __GNUC__ ) +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" diff --git a/samples/InputAttachment/InputAttachment.cpp b/samples/InputAttachment/InputAttachment.cpp index 45fd712..90f1cf9 100644 --- a/samples/InputAttachment/InputAttachment.cpp +++ b/samples/InputAttachment/InputAttachment.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : InputAttachment // Use an input attachment to draw a yellow triangle +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +// no need to ignore any warnings with GCC +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -275,7 +285,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/MultipleSets/MultipleSets.cpp b/samples/MultipleSets/MultipleSets.cpp index 92c0923..6f436f7 100644 --- a/samples/MultipleSets/MultipleSets.cpp +++ b/samples/MultipleSets/MultipleSets.cpp @@ -15,6 +15,18 @@ // VulkanHpp Samples : MultipleSets // Use multiple descriptor sets to draw a textured cube. +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -257,7 +269,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/OcclusionQuery/OcclusionQuery.cpp b/samples/OcclusionQuery/OcclusionQuery.cpp index 47d3b0c..408b592 100644 --- a/samples/OcclusionQuery/OcclusionQuery.cpp +++ b/samples/OcclusionQuery/OcclusionQuery.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : OcclusionQuery // Use occlusion query to determine if drawing renders any samples. +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -212,7 +222,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( rv.result ) { case vk::Result::eSuccess: break; - case vk::Result::eNotReady: std::cout << "vk::Device::getQueryPoolResults returned vk::Result::eNotReady !\n"; + case vk::Result::eNotReady: + std::cout << "vk::Device::getQueryPoolResults returned vk::Result::eNotReady !\n"; + break; default: assert( false ); // an unexpected result is returned ! } @@ -237,7 +249,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/PhysicalDeviceFeatures/PhysicalDeviceFeatures.cpp b/samples/PhysicalDeviceFeatures/PhysicalDeviceFeatures.cpp index 8aef160..9e4ca7d 100644 --- a/samples/PhysicalDeviceFeatures/PhysicalDeviceFeatures.cpp +++ b/samples/PhysicalDeviceFeatures/PhysicalDeviceFeatures.cpp @@ -15,6 +15,15 @@ // VulkanHpp Samples : PhysicalDeviceFeatures // Get the fine-grained features of the physical devices that can be supported by an implementation. +// ignore warning 4503: decorated name length exceeded, name was truncated +#if defined( _MSC_VER ) +# pragma warning( disable : 4503 ) +#elif defined( __GNUC__ ) +// don't know how to switch off that warning here +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/utils.hpp" #include "vulkan/vulkan.hpp" @@ -99,125 +108,125 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceYcbcrImageArraysFeaturesEXT>(); vk::PhysicalDeviceFeatures const & features = features2.get().features; std::cout << "\tFeatures:\n"; - std::cout << "\t\talphaToOne : " << static_cast( features.alphaToOne ) << "\n"; - std::cout << "\t\tdepthBiasClamp : " << static_cast( features.depthBiasClamp ) + std::cout << "\t\talphaToOne : " << !!features.alphaToOne << "\n"; + std::cout << "\t\tdepthBiasClamp : " << !!features.depthBiasClamp << "\n"; - std::cout << "\t\tdepthBounds : " << static_cast( features.depthBounds ) + std::cout << "\t\tdepthBounds : " << !!features.depthBounds << "\n"; - std::cout << "\t\tdepthClamp : " << static_cast( features.depthClamp ) << "\n"; + std::cout << "\t\tdepthClamp : " << !!features.depthClamp << "\n"; std::cout << "\t\tdrawIndirectFirstInstance : " - << static_cast( features.drawIndirectFirstInstance ) << "\n"; - std::cout << "\t\tdualSrcBlend : " << static_cast( features.dualSrcBlend ) + << !!features.drawIndirectFirstInstance << "\n"; + std::cout << "\t\tdualSrcBlend : " << !!features.dualSrcBlend << "\n"; - std::cout << "\t\tfillModeNonSolid : " << static_cast( features.fillModeNonSolid ) + std::cout << "\t\tfillModeNonSolid : " << !!features.fillModeNonSolid << "\n"; std::cout << "\t\tfragmentStoresAndAtomics : " - << static_cast( features.fragmentStoresAndAtomics ) << "\n"; - std::cout << "\t\tfullDrawIndexUint32 : " << static_cast( features.fullDrawIndexUint32 ) + << !!features.fragmentStoresAndAtomics << "\n"; + std::cout << "\t\tfullDrawIndexUint32 : " << !!features.fullDrawIndexUint32 << "\n"; - std::cout << "\t\tgeometryShader : " << static_cast( features.geometryShader ) + std::cout << "\t\tgeometryShader : " << !!features.geometryShader << "\n"; - std::cout << "\t\timageCubeArray : " << static_cast( features.imageCubeArray ) + std::cout << "\t\timageCubeArray : " << !!features.imageCubeArray << "\n"; - std::cout << "\t\tindependentBlend : " << static_cast( features.independentBlend ) + std::cout << "\t\tindependentBlend : " << !!features.independentBlend << "\n"; - std::cout << "\t\tinheritedQueries : " << static_cast( features.inheritedQueries ) + std::cout << "\t\tinheritedQueries : " << !!features.inheritedQueries << "\n"; - std::cout << "\t\tlargePoints : " << static_cast( features.largePoints ) + std::cout << "\t\tlargePoints : " << !!features.largePoints << "\n"; - std::cout << "\t\tlogicOp : " << static_cast( features.logicOp ) << "\n"; - std::cout << "\t\tmultiDrawIndirect : " << static_cast( features.multiDrawIndirect ) + std::cout << "\t\tlogicOp : " << !!features.logicOp << "\n"; + std::cout << "\t\tmultiDrawIndirect : " << !!features.multiDrawIndirect << "\n"; - std::cout << "\t\tmultiViewport : " << static_cast( features.multiViewport ) + std::cout << "\t\tmultiViewport : " << !!features.multiViewport << "\n"; std::cout << "\t\tocclusionQueryPrecise : " - << static_cast( features.occlusionQueryPrecise ) << "\n"; + << !!features.occlusionQueryPrecise << "\n"; std::cout << "\t\tpipelineStatisticsQuery : " - << static_cast( features.pipelineStatisticsQuery ) << "\n"; - std::cout << "\t\trobustBufferAccess : " << static_cast( features.robustBufferAccess ) + << !!features.pipelineStatisticsQuery << "\n"; + std::cout << "\t\trobustBufferAccess : " << !!features.robustBufferAccess << "\n"; - std::cout << "\t\tsamplerAnisotropy : " << static_cast( features.samplerAnisotropy ) + std::cout << "\t\tsamplerAnisotropy : " << !!features.samplerAnisotropy << "\n"; - std::cout << "\t\tsampleRateShading : " << static_cast( features.sampleRateShading ) + std::cout << "\t\tsampleRateShading : " << !!features.sampleRateShading << "\n"; - std::cout << "\t\tshaderClipDistance : " << static_cast( features.shaderClipDistance ) + std::cout << "\t\tshaderClipDistance : " << !!features.shaderClipDistance << "\n"; - std::cout << "\t\tshaderCullDistance : " << static_cast( features.shaderCullDistance ) + std::cout << "\t\tshaderCullDistance : " << !!features.shaderCullDistance << "\n"; - std::cout << "\t\tshaderFloat64 : " << static_cast( features.shaderFloat64 ) + std::cout << "\t\tshaderFloat64 : " << !!features.shaderFloat64 << "\n"; std::cout << "\t\tshaderImageGatherExtended : " - << static_cast( features.shaderImageGatherExtended ) << "\n"; - std::cout << "\t\tshaderInt16 : " << static_cast( features.shaderInt16 ) + << !!features.shaderImageGatherExtended << "\n"; + std::cout << "\t\tshaderInt16 : " << !!features.shaderInt16 << "\n"; - std::cout << "\t\tshaderInt64 : " << static_cast( features.shaderInt64 ) + std::cout << "\t\tshaderInt64 : " << !!features.shaderInt64 << "\n"; std::cout << "\t\tshaderResourceMinLod : " - << static_cast( features.shaderResourceMinLod ) << "\n"; + << !!features.shaderResourceMinLod << "\n"; std::cout << "\t\tshaderResourceResidency : " - << static_cast( features.shaderResourceResidency ) << "\n"; + << !!features.shaderResourceResidency << "\n"; std::cout << "\t\tshaderSampledImageArrayDynamicIndexing : " - << static_cast( features.shaderSampledImageArrayDynamicIndexing ) << "\n"; + << !!features.shaderSampledImageArrayDynamicIndexing << "\n"; std::cout << "\t\tshaderStorageBufferArrayDynamicIndexing : " - << static_cast( features.shaderStorageBufferArrayDynamicIndexing ) << "\n"; + << !!features.shaderStorageBufferArrayDynamicIndexing << "\n"; std::cout << "\t\tshaderStorageImageArrayDynamicIndexing : " - << static_cast( features.shaderStorageImageArrayDynamicIndexing ) << "\n"; + << !!features.shaderStorageImageArrayDynamicIndexing << "\n"; std::cout << "\t\tshaderStorageImageExtendedFormats : " - << static_cast( features.shaderStorageImageExtendedFormats ) << "\n"; + << !!features.shaderStorageImageExtendedFormats << "\n"; std::cout << "\t\tshaderStorageImageMultisample : " - << static_cast( features.shaderStorageImageMultisample ) << "\n"; + << !!features.shaderStorageImageMultisample << "\n"; std::cout << "\t\tshaderStorageImageReadWithoutFormat : " - << static_cast( features.shaderStorageImageReadWithoutFormat ) << "\n"; + << !!features.shaderStorageImageReadWithoutFormat << "\n"; std::cout << "\t\tshaderStorageImageWriteWithoutFormat : " - << static_cast( features.shaderStorageImageWriteWithoutFormat ) << "\n"; + << !!features.shaderStorageImageWriteWithoutFormat << "\n"; std::cout << "\t\tshaderTessellationAndGeometryPointSize : " - << static_cast( features.shaderTessellationAndGeometryPointSize ) << "\n"; + << !!features.shaderTessellationAndGeometryPointSize << "\n"; std::cout << "\t\tshaderUniformBufferArrayDynamicIndexing : " - << static_cast( features.shaderUniformBufferArrayDynamicIndexing ) << "\n"; - std::cout << "\t\tsparseBinding : " << static_cast( features.sparseBinding ) + << !!features.shaderUniformBufferArrayDynamicIndexing << "\n"; + std::cout << "\t\tsparseBinding : " << !!features.sparseBinding << "\n"; std::cout << "\t\tsparseResidency16Samples : " - << static_cast( features.sparseResidency16Samples ) << "\n"; + << !!features.sparseResidency16Samples << "\n"; std::cout << "\t\tsparseResidency2Samples : " - << static_cast( features.sparseResidency2Samples ) << "\n"; + << !!features.sparseResidency2Samples << "\n"; std::cout << "\t\tsparseResidency4Samples : " - << static_cast( features.sparseResidency4Samples ) << "\n"; + << !!features.sparseResidency4Samples << "\n"; std::cout << "\t\tsparseResidency8Samples : " - << static_cast( features.sparseResidency8Samples ) << "\n"; + << !!features.sparseResidency8Samples << "\n"; std::cout << "\t\tsparseResidencyAliased : " - << static_cast( features.sparseResidencyAliased ) << "\n"; + << !!features.sparseResidencyAliased << "\n"; std::cout << "\t\tsparseResidencyBuffer : " - << static_cast( features.sparseResidencyBuffer ) << "\n"; + << !!features.sparseResidencyBuffer << "\n"; std::cout << "\t\tsparseResidencyImage2D : " - << static_cast( features.sparseResidencyImage2D ) << "\n"; + << !!features.sparseResidencyImage2D << "\n"; std::cout << "\t\tsparseResidencyImage3D : " - << static_cast( features.sparseResidencyImage3D ) << "\n"; - std::cout << "\t\ttessellationShader : " << static_cast( features.tessellationShader ) + << !!features.sparseResidencyImage3D << "\n"; + std::cout << "\t\ttessellationShader : " << !!features.tessellationShader << "\n"; std::cout << "\t\ttextureCompressionASTC_LDR : " - << static_cast( features.textureCompressionASTC_LDR ) << "\n"; + << !!features.textureCompressionASTC_LDR << "\n"; std::cout << "\t\ttextureCompressionBC : " - << static_cast( features.textureCompressionBC ) << "\n"; + << !!features.textureCompressionBC << "\n"; std::cout << "\t\ttextureCompressionETC2 : " - << static_cast( features.textureCompressionETC2 ) << "\n"; + << !!features.textureCompressionETC2 << "\n"; std::cout << "\t\tvariableMultisampleRate : " - << static_cast( features.variableMultisampleRate ) << "\n"; + << !!features.variableMultisampleRate << "\n"; std::cout << "\t\tvertexPipelineStoresAndAtomics : " - << static_cast( features.vertexPipelineStoresAndAtomics ) << "\n"; - std::cout << "\t\twideLines : " << static_cast( features.wideLines ) << "\n"; + << !!features.vertexPipelineStoresAndAtomics << "\n"; + std::cout << "\t\twideLines : " << !!features.wideLines << "\n"; std::cout << "\n"; vk::PhysicalDevice16BitStorageFeatures const & sixteenBitStorageFeatures = features2.get(); std::cout << "\t16BitStorageFeatures:\n"; std::cout << "\t\tstorageBuffer16BitAccess : " - << static_cast( sixteenBitStorageFeatures.storageBuffer16BitAccess ) << "\n"; + << !!sixteenBitStorageFeatures.storageBuffer16BitAccess << "\n"; std::cout << "\t\tstorageInputOutput16 : " - << static_cast( sixteenBitStorageFeatures.storageInputOutput16 ) << "\n"; + << !!sixteenBitStorageFeatures.storageInputOutput16 << "\n"; std::cout << "\t\tstoragePushConstant16 : " - << static_cast( sixteenBitStorageFeatures.storagePushConstant16 ) << "\n"; + << !!sixteenBitStorageFeatures.storagePushConstant16 << "\n"; std::cout << "\t\tuniformAndStorageBuffer16BitAccess : " - << static_cast( sixteenBitStorageFeatures.uniformAndStorageBuffer16BitAccess ) << "\n"; + << !!sixteenBitStorageFeatures.uniformAndStorageBuffer16BitAccess << "\n"; std::cout << "\n"; if ( vk::su::contains( extensionProperties, "VK_KHR_8bit_storage" ) ) @@ -226,11 +235,11 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\t8BitStorageFeatures:\n"; std::cout << "\t\tstorageBuffer8BitAccess : " - << static_cast( eightBitStorageFeatures.storageBuffer8BitAccess ) << "\n"; + << !!eightBitStorageFeatures.storageBuffer8BitAccess << "\n"; std::cout << "\t\tstoragePushConstant8 : " - << static_cast( eightBitStorageFeatures.storagePushConstant8 ) << "\n"; + << !!eightBitStorageFeatures.storagePushConstant8 << "\n"; std::cout << "\t\tuniformAndStorageBuffer8BitAccess : " - << static_cast( eightBitStorageFeatures.uniformAndStorageBuffer8BitAccess ) << "\n"; + << !!eightBitStorageFeatures.uniformAndStorageBuffer8BitAccess << "\n"; std::cout << "\n"; } @@ -240,7 +249,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tASTCDecodeFeature:\n"; std::cout << "\t\tdecodeModeSharedExponent : " - << static_cast( astcDecodeFeatures.decodeModeSharedExponent ) << "\n"; + << !!astcDecodeFeatures.decodeModeSharedExponent << "\n"; std::cout << "\n"; } @@ -250,7 +259,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tBlendOperationAdvancedFeatures:\n"; std::cout << "\t\tadvancedBlendCoherentOperations : " - << static_cast( blendOperationAdvancedFeatures.advancedBlendCoherentOperations ) << "\n"; + << !!blendOperationAdvancedFeatures.advancedBlendCoherentOperations << "\n"; std::cout << "\n"; } @@ -260,11 +269,11 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tBufferDeviceAddressFeatures:\n"; std::cout << "\t\tbufferDeviceAddress : " - << static_cast( bufferDeviceAddressFeatures.bufferDeviceAddress ) << "\n"; + << !!bufferDeviceAddressFeatures.bufferDeviceAddress << "\n"; std::cout << "\t\tbufferDeviceAddressCaptureReplay : " - << static_cast( bufferDeviceAddressFeatures.bufferDeviceAddressCaptureReplay ) << "\n"; + << !!bufferDeviceAddressFeatures.bufferDeviceAddressCaptureReplay << "\n"; std::cout << "\t\tbufferDeviceAddressMultiDevice : " - << static_cast( bufferDeviceAddressFeatures.bufferDeviceAddressMultiDevice ) << "\n"; + << !!bufferDeviceAddressFeatures.bufferDeviceAddressMultiDevice << "\n"; std::cout << "\n"; } @@ -273,7 +282,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceCoherentMemoryFeaturesAMD const & coherentMemoryFeatures = features2.get(); std::cout << "\tCoherentMemoryFeatures:\n"; - std::cout << "\t\tdeviceCoherentMemory : " << static_cast( coherentMemoryFeatures.deviceCoherentMemory ) + std::cout << "\t\tdeviceCoherentMemory : " << !!coherentMemoryFeatures.deviceCoherentMemory << "\n"; std::cout << "\n"; } @@ -284,9 +293,9 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tComputeShaderDerivativeFeatures:\n"; std::cout << "\t\tcomputeDerivativeGroupLinear : " - << static_cast( computeShaderDerivativesFeatures.computeDerivativeGroupLinear ) << "\n"; + << !!computeShaderDerivativesFeatures.computeDerivativeGroupLinear << "\n"; std::cout << "\t\tcomputeDerivativeGroupQuads : " - << static_cast( computeShaderDerivativesFeatures.computeDerivativeGroupQuads ) << "\n"; + << !!computeShaderDerivativesFeatures.computeDerivativeGroupQuads << "\n"; std::cout << "\n"; } @@ -296,9 +305,9 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tConditionalRenderingFeatures:\n"; std::cout << "\t\tconditionalRendering : " - << static_cast( conditionalRenderingFeatures.conditionalRendering ) << "\n"; + << !!conditionalRenderingFeatures.conditionalRendering << "\n"; std::cout << "\t\tinheritedConditionalRendering : " - << static_cast( conditionalRenderingFeatures.inheritedConditionalRendering ) << "\n"; + << !!conditionalRenderingFeatures.inheritedConditionalRendering << "\n"; std::cout << "\n"; } @@ -308,9 +317,9 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tCooperativeMatrixFeatures:\n"; std::cout << "\t\tcooperativeMatrix : " - << static_cast( cooperativeMatrixFeatures.cooperativeMatrix ) << "\n"; + << !!cooperativeMatrixFeatures.cooperativeMatrix << "\n"; std::cout << "\t\tcooperativeMatrixRobustBufferAccess : " - << static_cast( cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess ) << "\n"; + << !!cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess << "\n"; std::cout << "\n"; } @@ -319,7 +328,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceCornerSampledImageFeaturesNV const & cornerSampledImageFeatures = features2.get(); std::cout << "\tCornerSampledImageFeatures:\n"; - std::cout << "\t\tcornerSampledImage : " << static_cast( cornerSampledImageFeatures.cornerSampledImage ) + std::cout << "\t\tcornerSampledImage : " << !!cornerSampledImageFeatures.cornerSampledImage << "\n"; std::cout << "\n"; } @@ -330,7 +339,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tCoverageReductionModeFeatures:\n"; std::cout << "\t\tcoverageReductionMode : " - << static_cast( coverageReductionModeFeatures.coverageReductionMode ) << "\n"; + << !!coverageReductionModeFeatures.coverageReductionMode << "\n"; std::cout << "\n"; } @@ -340,7 +349,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tDedicatedAllocationAliasingFeatures:\n"; std::cout << "\t\tdedicatedAllocationImageAliasing : " - << static_cast( dedicatedAllocationImageAliasingFeatures.dedicatedAllocationImageAliasing ) + << !!dedicatedAllocationImageAliasingFeatures.dedicatedAllocationImageAliasing << "\n"; std::cout << "\n"; } @@ -350,7 +359,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceDepthClipEnableFeaturesEXT const & depthClipEnabledFeatures = features2.get(); std::cout << "\tDepthClipEnabledFeatures:\n"; - std::cout << "\t\tdepthClipEnable : " << static_cast( depthClipEnabledFeatures.depthClipEnable ) << "\n"; + std::cout << "\t\tdepthClipEnable : " << !!depthClipEnabledFeatures.depthClipEnable << "\n"; std::cout << "\n"; } @@ -360,55 +369,55 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tDescriptorIndexingFeatures:\n"; std::cout << "\t\tdescriptorBindingPartiallyBound : " - << static_cast( descriptorIndexingFeatures.descriptorBindingPartiallyBound ) << "\n"; + << !!descriptorIndexingFeatures.descriptorBindingPartiallyBound << "\n"; std::cout << "\t\tdescriptorBindingSampledImageUpdateAfterBind : " - << static_cast( descriptorIndexingFeatures.descriptorBindingSampledImageUpdateAfterBind ) + << !!descriptorIndexingFeatures.descriptorBindingSampledImageUpdateAfterBind << "\n"; std::cout << "\t\tdescriptorBindingStorageBufferUpdateAfterBind : " - << static_cast( descriptorIndexingFeatures.descriptorBindingStorageBufferUpdateAfterBind ) + << !!descriptorIndexingFeatures.descriptorBindingStorageBufferUpdateAfterBind << "\n"; std::cout << "\t\tdescriptorBindingStorageImageUpdateAfterBind : " - << static_cast( descriptorIndexingFeatures.descriptorBindingStorageImageUpdateAfterBind ) + << !!descriptorIndexingFeatures.descriptorBindingStorageImageUpdateAfterBind << "\n"; std::cout << "\t\tdescriptorBindingStorageTexelBufferUpdateAfterBind : " - << static_cast( descriptorIndexingFeatures.descriptorBindingStorageTexelBufferUpdateAfterBind ) + << !!descriptorIndexingFeatures.descriptorBindingStorageTexelBufferUpdateAfterBind << "\n"; std::cout << "\t\tdescriptorBindingUniformBufferUpdateAfterBind : " - << static_cast( descriptorIndexingFeatures.descriptorBindingUniformBufferUpdateAfterBind ) + << !!descriptorIndexingFeatures.descriptorBindingUniformBufferUpdateAfterBind << "\n"; std::cout << "\t\tdescriptorBindingUniformTexelBufferUpdateAfterBind : " - << static_cast( descriptorIndexingFeatures.descriptorBindingUniformTexelBufferUpdateAfterBind ) + << !!descriptorIndexingFeatures.descriptorBindingUniformTexelBufferUpdateAfterBind << "\n"; std::cout << "\t\tdescriptorBindingUpdateUnusedWhilePending : " - << static_cast( descriptorIndexingFeatures.descriptorBindingUpdateUnusedWhilePending ) << "\n"; + << !!descriptorIndexingFeatures.descriptorBindingUpdateUnusedWhilePending << "\n"; std::cout << "\t\tdescriptorBindingVariableDescriptorCount : " - << static_cast( descriptorIndexingFeatures.descriptorBindingVariableDescriptorCount ) << "\n"; + << !!descriptorIndexingFeatures.descriptorBindingVariableDescriptorCount << "\n"; std::cout << "\t\truntimeDescriptorArray : " - << static_cast( descriptorIndexingFeatures.runtimeDescriptorArray ) << "\n"; + << !!descriptorIndexingFeatures.runtimeDescriptorArray << "\n"; std::cout << "\t\tshaderInputAttachmentArrayDynamicIndexing : " - << static_cast( descriptorIndexingFeatures.shaderInputAttachmentArrayDynamicIndexing ) << "\n"; + << !!descriptorIndexingFeatures.shaderInputAttachmentArrayDynamicIndexing << "\n"; std::cout << "\t\tshaderInputAttachmentArrayNonUniformIndexing : " - << static_cast( descriptorIndexingFeatures.shaderInputAttachmentArrayNonUniformIndexing ) + << !!descriptorIndexingFeatures.shaderInputAttachmentArrayNonUniformIndexing << "\n"; std::cout << "\t\tshaderSampledImageArrayNonUniformIndexing : " - << static_cast( descriptorIndexingFeatures.shaderSampledImageArrayNonUniformIndexing ) << "\n"; + << !!descriptorIndexingFeatures.shaderSampledImageArrayNonUniformIndexing << "\n"; std::cout << "\t\tshaderStorageBufferArrayNonUniformIndexing : " - << static_cast( descriptorIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing ) << "\n"; + << !!descriptorIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing << "\n"; std::cout << "\t\tshaderStorageImageArrayNonUniformIndexing : " - << static_cast( descriptorIndexingFeatures.shaderStorageImageArrayNonUniformIndexing ) << "\n"; + << !!descriptorIndexingFeatures.shaderStorageImageArrayNonUniformIndexing << "\n"; std::cout << "\t\tshaderStorageTexelBufferArrayDynamicIndexing : " - << static_cast( descriptorIndexingFeatures.shaderStorageTexelBufferArrayDynamicIndexing ) + << !!descriptorIndexingFeatures.shaderStorageTexelBufferArrayDynamicIndexing << "\n"; std::cout << "\t\tshaderStorageTexelBufferArrayNonUniformIndexing : " - << static_cast( descriptorIndexingFeatures.shaderStorageTexelBufferArrayNonUniformIndexing ) + << !!descriptorIndexingFeatures.shaderStorageTexelBufferArrayNonUniformIndexing << "\n"; std::cout << "\t\tshaderUniformBufferArrayNonUniformIndexing : " - << static_cast( descriptorIndexingFeatures.shaderUniformBufferArrayNonUniformIndexing ) << "\n"; + << !!descriptorIndexingFeatures.shaderUniformBufferArrayNonUniformIndexing << "\n"; std::cout << "\t\tshaderUniformTexelBufferArrayDynamicIndexing : " - << static_cast( descriptorIndexingFeatures.shaderUniformTexelBufferArrayDynamicIndexing ) + << !!descriptorIndexingFeatures.shaderUniformTexelBufferArrayDynamicIndexing << "\n"; std::cout << "\t\tshaderUniformTexelBufferArrayNonUniformIndexing : " - << static_cast( descriptorIndexingFeatures.shaderUniformTexelBufferArrayNonUniformIndexing ) + << !!descriptorIndexingFeatures.shaderUniformTexelBufferArrayNonUniformIndexing << "\n"; std::cout << "\n"; } @@ -418,7 +427,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceExclusiveScissorFeaturesNV const & exclusiveScissorFeatures = features2.get(); std::cout << "\tExclusiveScissorFeatures:\n"; - std::cout << "\t\texclusiveScissor : " << static_cast( exclusiveScissorFeatures.exclusiveScissor ) + std::cout << "\t\texclusiveScissor : " << !!exclusiveScissorFeatures.exclusiveScissor << "\n"; std::cout << "\n"; } @@ -429,11 +438,11 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tFragmentDensityMapFeatures:\n"; std::cout << "\t\tfragmentDensityMap : " - << static_cast( fragmentDensityMapFeatures.fragmentDensityMap ) << "\n"; + << !!fragmentDensityMapFeatures.fragmentDensityMap << "\n"; std::cout << "\t\tfragmentDensityMapDynamic : " - << static_cast( fragmentDensityMapFeatures.fragmentDensityMapDynamic ) << "\n"; + << !!fragmentDensityMapFeatures.fragmentDensityMapDynamic << "\n"; std::cout << "\t\tfragmentDensityMapNonSubsampledImages : " - << static_cast( fragmentDensityMapFeatures.fragmentDensityMapNonSubsampledImages ) << "\n"; + << !!fragmentDensityMapFeatures.fragmentDensityMapNonSubsampledImages << "\n"; std::cout << "\n"; } @@ -443,7 +452,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tFragmentShaderBarycentricFeatures:\n"; std::cout << "\t\tfragmentShaderBarycentric : " - << static_cast( fragmentShaderBarycentricFeatures.fragmentShaderBarycentric ) << "\n"; + << !!fragmentShaderBarycentricFeatures.fragmentShaderBarycentric << "\n"; std::cout << "\n"; } @@ -453,11 +462,11 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tFragmentShaderInterlockFeatures:\n"; std::cout << "\t\tfragmentShaderPixelInterlock : " - << static_cast( fragmentShaderInterlockFeatures.fragmentShaderPixelInterlock ) << "\n"; + << !!fragmentShaderInterlockFeatures.fragmentShaderPixelInterlock << "\n"; std::cout << "\t\tfragmentShaderSampleInterlock : " - << static_cast( fragmentShaderInterlockFeatures.fragmentShaderSampleInterlock ) << "\n"; + << !!fragmentShaderInterlockFeatures.fragmentShaderSampleInterlock << "\n"; std::cout << "\t\tfragmentShaderShadingRateInterlock : " - << static_cast( fragmentShaderInterlockFeatures.fragmentShaderShadingRateInterlock ) << "\n"; + << !!fragmentShaderInterlockFeatures.fragmentShaderShadingRateInterlock << "\n"; std::cout << "\n"; } @@ -466,7 +475,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceHostQueryResetFeaturesEXT const & hostQueryResetFeatures = features2.get(); std::cout << "\tHostQueryResetFeatures:\n"; - std::cout << "\t\thostQueryReset : " << static_cast( hostQueryResetFeatures.hostQueryReset ) << "\n"; + std::cout << "\t\thostQueryReset : " << !!hostQueryResetFeatures.hostQueryReset << "\n"; std::cout << "\n"; } @@ -476,7 +485,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tImagelessFramebufferFeatures:\n"; std::cout << "\t\timagelessFramebuffer : " - << static_cast( imagelessFramebufferFeatures.imagelessFramebuffer ) << "\n"; + << !!imagelessFramebufferFeatures.imagelessFramebuffer << "\n"; std::cout << "\n"; } @@ -485,7 +494,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceIndexTypeUint8FeaturesEXT const & indexTypeUint8Features = features2.get(); std::cout << "\tIndexTypeUint8Features:\n"; - std::cout << "\t\tindexTypeUint8 : " << static_cast( indexTypeUint8Features.indexTypeUint8 ) << "\n"; + std::cout << "\t\tindexTypeUint8 : " << !!indexTypeUint8Features.indexTypeUint8 << "\n"; std::cout << "\n"; } @@ -495,10 +504,10 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tInlineUniformBlockFeatures:\n"; std::cout << "\t\tdescriptorBindingInlineUniformBlockUpdateAfterBind : " - << static_cast( inlineUniformBlockFeatures.descriptorBindingInlineUniformBlockUpdateAfterBind ) + << !!inlineUniformBlockFeatures.descriptorBindingInlineUniformBlockUpdateAfterBind << "\n"; std::cout << "\t\tinlineUniformBlock : " - << static_cast( inlineUniformBlockFeatures.inlineUniformBlock ) << "\n"; + << !!inlineUniformBlockFeatures.inlineUniformBlock << "\n"; std::cout << "\n"; } @@ -507,18 +516,18 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceLineRasterizationFeaturesEXT const & lineRasterizationFeatures = features2.get(); std::cout << "\tLineRasterizationFeatures:\n"; - std::cout << "\t\tbresenhamLines : " << static_cast( lineRasterizationFeatures.bresenhamLines ) + std::cout << "\t\tbresenhamLines : " << !!lineRasterizationFeatures.bresenhamLines << "\n"; std::cout << "\t\trectangularLines : " - << static_cast( lineRasterizationFeatures.rectangularLines ) << "\n"; - std::cout << "\t\tsmoothLines : " << static_cast( lineRasterizationFeatures.smoothLines ) + << !!lineRasterizationFeatures.rectangularLines << "\n"; + std::cout << "\t\tsmoothLines : " << !!lineRasterizationFeatures.smoothLines << "\n"; std::cout << "\t\tstippledBresenhamLines : " - << static_cast( lineRasterizationFeatures.stippledBresenhamLines ) << "\n"; + << !!lineRasterizationFeatures.stippledBresenhamLines << "\n"; std::cout << "\t\tstippledRectangularLines : " - << static_cast( lineRasterizationFeatures.stippledRectangularLines ) << "\n"; + << !!lineRasterizationFeatures.stippledRectangularLines << "\n"; std::cout << "\t\tstippledSmoothLines : " - << static_cast( lineRasterizationFeatures.stippledSmoothLines ) << "\n"; + << !!lineRasterizationFeatures.stippledSmoothLines << "\n"; std::cout << "\n"; } @@ -527,7 +536,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceMemoryPriorityFeaturesEXT const & memoryPriorityFeatures = features2.get(); std::cout << "\tMemoryPriorityFeatures:\n"; - std::cout << "\t\tmemoryPriority : " << static_cast( memoryPriorityFeatures.memoryPriority ) << "\n"; + std::cout << "\t\tmemoryPriority : " << !!memoryPriorityFeatures.memoryPriority << "\n"; std::cout << "\n"; } @@ -536,19 +545,19 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceMeshShaderFeaturesNV const & meshShaderFeatures = features2.get(); std::cout << "\tMeshShaderFeatures:\n"; - std::cout << "\t\tmeshShader : " << static_cast( meshShaderFeatures.meshShader ) << "\n"; - std::cout << "\t\ttaskShader : " << static_cast( meshShaderFeatures.taskShader ) << "\n"; + std::cout << "\t\tmeshShader : " << !!meshShaderFeatures.meshShader << "\n"; + std::cout << "\t\ttaskShader : " << !!meshShaderFeatures.taskShader << "\n"; std::cout << "\n"; } vk::PhysicalDeviceMultiviewFeatures const & multiviewFeatures = features2.get(); std::cout << "\tMultiviewFeatures:\n"; - std::cout << "\t\tmultiview : " << static_cast( multiviewFeatures.multiview ) << "\n"; + std::cout << "\t\tmultiview : " << !!multiviewFeatures.multiview << "\n"; std::cout << "\t\tmultiviewGeometryShader : " - << static_cast( multiviewFeatures.multiviewGeometryShader ) << "\n"; + << !!multiviewFeatures.multiviewGeometryShader << "\n"; std::cout << "\t\tmultiviewTessellationShader : " - << static_cast( multiviewFeatures.multiviewTessellationShader ) << "\n"; + << !!multiviewFeatures.multiviewTessellationShader << "\n"; std::cout << "\n"; if ( vk::su::contains( extensionProperties, "VK_KHR_pipeline_executable_properties" ) ) @@ -557,14 +566,14 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tPipelineExectuablePropertiesFeatures:\n"; std::cout << "\t\tpipelineExecutableInfo : " - << static_cast( pipelineExecutablePropertiesFeatures.pipelineExecutableInfo ) << "\n"; + << !!pipelineExecutablePropertiesFeatures.pipelineExecutableInfo << "\n"; std::cout << "\n"; } vk::PhysicalDeviceProtectedMemoryFeatures const & protectedMemoryFeatures = features2.get(); std::cout << "\tProtectedMemoryFeatures:\n"; - std::cout << "\t\tprotectedMemory : " << static_cast( protectedMemoryFeatures.protectedMemory ) << "\n"; + std::cout << "\t\tprotectedMemory : " << !!protectedMemoryFeatures.protectedMemory << "\n"; std::cout << "\n"; if ( vk::su::contains( extensionProperties, "VK_NV_representative_fragment_test" ) ) @@ -573,7 +582,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tRepresentativeFragmentTestFeatures:\n"; std::cout << "\t\trepresentativeFragmentTest : " - << static_cast( representativeFragmentTestFeatures.representativeFragmentTest ) << "\n"; + << !!representativeFragmentTestFeatures.representativeFragmentTest << "\n"; std::cout << "\n"; } @@ -581,7 +590,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tSamplerYcbcrConversionFeatures:\n"; std::cout << "\t\tsamplerYcbcrConversion : " - << static_cast( samplerYcbcrConversionFeatures.samplerYcbcrConversion ) << "\n"; + << !!samplerYcbcrConversionFeatures.samplerYcbcrConversion << "\n"; std::cout << "\n"; if ( vk::su::contains( extensionProperties, "VK_EXT_scalar_block_layout" ) ) @@ -589,7 +598,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceScalarBlockLayoutFeaturesEXT const & scalarBlockLayoutFeatures = features2.get(); std::cout << "\tScalarBlockLayoutFeatures:\n"; - std::cout << "\t\tscalarBlockLayout : " << static_cast( scalarBlockLayoutFeatures.scalarBlockLayout ) + std::cout << "\t\tscalarBlockLayout : " << !!scalarBlockLayoutFeatures.scalarBlockLayout << "\n"; std::cout << "\n"; } @@ -600,9 +609,9 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tShaderAtomicInt64Features:\n"; std::cout << "\t\tshaderBufferInt64Atomics : " - << static_cast( shaderAtomicInt64Features.shaderBufferInt64Atomics ) << "\n"; + << !!shaderAtomicInt64Features.shaderBufferInt64Atomics << "\n"; std::cout << "\t\tshaderSharedInt64Atomics : " - << static_cast( shaderAtomicInt64Features.shaderSharedInt64Atomics ) << "\n"; + << !!shaderAtomicInt64Features.shaderSharedInt64Atomics << "\n"; std::cout << "\n"; } @@ -612,7 +621,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tShaderDemoteToHelperInvocationFeatures:\n"; std::cout << "\t\tshaderDemoteToHelperInvocation : " - << static_cast( shaderDemoteToHelperInvocationFeatures.shaderDemoteToHelperInvocation ) << "\n"; + << !!shaderDemoteToHelperInvocationFeatures.shaderDemoteToHelperInvocation << "\n"; std::cout << "\n"; } @@ -620,7 +629,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tShaderDrawParametersFeature:\n"; std::cout << "\t\tshaderDrawParameters : " - << static_cast( shaderDrawParametersFeature.shaderDrawParameters ) << "\n"; + << !!shaderDrawParametersFeature.shaderDrawParameters << "\n"; std::cout << "\n"; if ( vk::su::contains( extensionProperties, "VK_KHR_shader_float16_int8" ) ) @@ -628,8 +637,8 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceShaderFloat16Int8FeaturesKHR const & shaderFloat16Int8Features = features2.get(); std::cout << "\tShaderFloat16Int8Features:\n"; - std::cout << "\t\tshaderFloat16 : " << static_cast( shaderFloat16Int8Features.shaderFloat16 ) << "\n"; - std::cout << "\t\tshaderInt8 : " << static_cast( shaderFloat16Int8Features.shaderInt8 ) << "\n"; + std::cout << "\t\tshaderFloat16 : " << !!shaderFloat16Int8Features.shaderFloat16 << "\n"; + std::cout << "\t\tshaderInt8 : " << !!shaderFloat16Int8Features.shaderInt8 << "\n"; std::cout << "\n"; } @@ -638,7 +647,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceShaderImageFootprintFeaturesNV const & shaderImageFootprintFeatures = features2.get(); std::cout << "\tShaderImageFootprintFeatures:\n"; - std::cout << "\t\timageFootprint : " << static_cast( shaderImageFootprintFeatures.imageFootprint ) + std::cout << "\t\timageFootprint : " << !!shaderImageFootprintFeatures.imageFootprint << "\n"; std::cout << "\n"; } @@ -649,7 +658,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tShaderIntegerFunctions2Features:\n"; std::cout << "\t\tshaderIntegerFunctions2 : " - << static_cast( shaderIntegerFunctions2Features.shaderIntegerFunctions2 ) << "\n"; + << !!shaderIntegerFunctions2Features.shaderIntegerFunctions2 << "\n"; std::cout << "\n"; } @@ -658,7 +667,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceShaderSMBuiltinsFeaturesNV const & shaderSMBuiltinsFeatures = features2.get(); std::cout << "\tShaderSMBuiltinsFeatures:\n"; - std::cout << "\t\tshaderSMBuiltins : " << static_cast( shaderSMBuiltinsFeatures.shaderSMBuiltins ) + std::cout << "\t\tshaderSMBuiltins : " << !!shaderSMBuiltinsFeatures.shaderSMBuiltins << "\n"; std::cout << "\n"; } @@ -669,7 +678,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tShaderSubgroupExtendedTypeFeatures:\n"; std::cout << "\t\tshaderSubgroupExtendedTypes : " - << static_cast( shaderSubgroupExtendedTypesFeatures.shaderSubgroupExtendedTypes ) << "\n"; + << !!shaderSubgroupExtendedTypesFeatures.shaderSubgroupExtendedTypes << "\n"; std::cout << "\n"; } @@ -679,9 +688,9 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tShadingRateImageFeatures:\n"; std::cout << "\t\tshadingRateCoarseSampleOrder : " - << static_cast( shadingRateImageFeatures.shadingRateCoarseSampleOrder ) << "\n"; + << !!shadingRateImageFeatures.shadingRateCoarseSampleOrder << "\n"; std::cout << "\t\tshadingRateImage : " - << static_cast( shadingRateImageFeatures.shadingRateImage ) << "\n"; + << !!shadingRateImageFeatures.shadingRateImage << "\n"; std::cout << "\n"; } @@ -691,9 +700,9 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tSubgroupSizeControlFeatures:\n"; std::cout << "\t\tcomputeFullSubgroups : " - << static_cast( subgroupSizeControlFeatures.computeFullSubgroups ) << "\n"; + << !!subgroupSizeControlFeatures.computeFullSubgroups << "\n"; std::cout << "\t\tsubgroupSizeControl : " - << static_cast( subgroupSizeControlFeatures.subgroupSizeControl ) << "\n"; + << !!subgroupSizeControlFeatures.subgroupSizeControl << "\n"; std::cout << "\n"; } @@ -703,7 +712,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tTexelBufferAlignmentFeatures:\n"; std::cout << "\t\ttexelBufferAlignment : " - << static_cast( texelBufferAlignmentFeatures.texelBufferAlignment ) << "\n"; + << !!texelBufferAlignmentFeatures.texelBufferAlignment << "\n"; std::cout << "\n"; } @@ -713,7 +722,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tTextureCompressionASTCHHRFeatures:\n"; std::cout << "\t\ttextureCompressionASTC_HDR : " - << static_cast( textureCompressionASTCHDRFeatures.textureCompressionASTC_HDR ) << "\n"; + << !!textureCompressionASTCHDRFeatures.textureCompressionASTC_HDR << "\n"; std::cout << "\n"; } @@ -722,7 +731,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceTimelineSemaphoreFeaturesKHR const & timelineSemaphoreFeatures = features2.get(); std::cout << "\tTimelineSemaphoreFeatures:\n"; - std::cout << "\t\ttimelineSemaphore :" << static_cast( timelineSemaphoreFeatures.timelineSemaphore ) + std::cout << "\t\ttimelineSemaphore :" << !!timelineSemaphoreFeatures.timelineSemaphore << "\n"; std::cout << "\n"; } @@ -732,8 +741,8 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceTransformFeedbackFeaturesEXT const & transformFeedbackFeatures = features2.get(); std::cout << "\tTransformFeedbackFeatures:\n"; - std::cout << "\t\tgeometryStreams : " << static_cast( transformFeedbackFeatures.geometryStreams ) << "\n"; - std::cout << "\t\ttransformFeedback : " << static_cast( transformFeedbackFeatures.transformFeedback ) + std::cout << "\t\tgeometryStreams : " << !!transformFeedbackFeatures.geometryStreams << "\n"; + std::cout << "\t\ttransformFeedback : " << !!transformFeedbackFeatures.transformFeedback << "\n"; std::cout << "\n"; } @@ -744,7 +753,7 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tUniformBufferStandardLayoutFeatures:\n"; std::cout << "\t\tuniformBufferStandardLayout : " - << static_cast( uniformBufferStandardLayoutFeatures.uniformBufferStandardLayout ) << "\n"; + << !!uniformBufferStandardLayoutFeatures.uniformBufferStandardLayout << "\n"; std::cout << "\n"; } @@ -754,9 +763,9 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tVariablePointersFeatures:\n"; std::cout << "\t\tvariablePointers : " - << static_cast( variablePointersFeatures.variablePointers ) << "\n"; + << !!variablePointersFeatures.variablePointers << "\n"; std::cout << "\t\tvariablePointersStorageBuffer : " - << static_cast( variablePointersFeatures.variablePointersStorageBuffer ) << "\n"; + << !!variablePointersFeatures.variablePointersStorageBuffer << "\n"; std::cout << "\n"; } @@ -766,9 +775,9 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tVertexAttributeDivisorFeature:\n"; std::cout << "\t\tvertexAttributeInstanceRateDivisor : " - << static_cast( vertexAttributeDivisorFeatures.vertexAttributeInstanceRateDivisor ) << "\n"; + << !!vertexAttributeDivisorFeatures.vertexAttributeInstanceRateDivisor << "\n"; std::cout << "\t\tvertexAttributeInstanceRateZeroDivisor : " - << static_cast( vertexAttributeDivisorFeatures.vertexAttributeInstanceRateZeroDivisor ) << "\n"; + << !!vertexAttributeDivisorFeatures.vertexAttributeInstanceRateZeroDivisor << "\n"; std::cout << "\n"; } @@ -778,12 +787,12 @@ int main( int /*argc*/, char ** /*argv*/ ) features2.get(); std::cout << "\tVulkanMemoryModelFeatures:\n"; std::cout << "\t\tvulkanMemoryModel : " - << static_cast( vulkanMemoryModelFeatures.vulkanMemoryModel ) << "\n"; + << !!vulkanMemoryModelFeatures.vulkanMemoryModel << "\n"; std::cout << "\t\tvulkanMemoryModelAvailabilityVisibilityChains : " - << static_cast( vulkanMemoryModelFeatures.vulkanMemoryModelAvailabilityVisibilityChains ) + << !!vulkanMemoryModelFeatures.vulkanMemoryModelAvailabilityVisibilityChains << "\n"; std::cout << "\t\tvulkanMemoryModelDeviceScope : " - << static_cast( vulkanMemoryModelFeatures.vulkanMemoryModelDeviceScope ) << "\n"; + << !!vulkanMemoryModelFeatures.vulkanMemoryModelDeviceScope << "\n"; std::cout << "\n"; } @@ -792,7 +801,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PhysicalDeviceYcbcrImageArraysFeaturesEXT const & ycbcrImageArraysFeatures = features2.get(); std::cout << "\tYcbcrImageArraysFeatures:\n"; - std::cout << "\t\tycbcrImageArrays : " << static_cast( ycbcrImageArraysFeatures.ycbcrImageArrays ) + std::cout << "\t\tycbcrImageArrays : " << !!ycbcrImageArraysFeatures.ycbcrImageArrays << "\n"; std::cout << "\n"; } diff --git a/samples/PhysicalDeviceGroups/PhysicalDeviceGroups.cpp b/samples/PhysicalDeviceGroups/PhysicalDeviceGroups.cpp index a29f32c..b720651 100644 --- a/samples/PhysicalDeviceGroups/PhysicalDeviceGroups.cpp +++ b/samples/PhysicalDeviceGroups/PhysicalDeviceGroups.cpp @@ -49,7 +49,7 @@ int main( int /*argc*/, char ** /*argv*/ ) std::cout << "\t\t" << j << " : " << groupProperties[i].physicalDevices[j].getProperties().deviceName << "\n"; } std::cout << "\t" - << "subsetAllocation = " << static_cast( groupProperties[i].subsetAllocation ) << "\n"; + << "subsetAllocation = " << !!groupProperties[i].subsetAllocation << "\n"; std::cout << "\n"; if ( 1 < groupProperties[i].physicalDeviceCount ) diff --git a/samples/PhysicalDeviceProperties/PhysicalDeviceProperties.cpp b/samples/PhysicalDeviceProperties/PhysicalDeviceProperties.cpp index 66efddc..eba17e9 100644 --- a/samples/PhysicalDeviceProperties/PhysicalDeviceProperties.cpp +++ b/samples/PhysicalDeviceProperties/PhysicalDeviceProperties.cpp @@ -468,13 +468,13 @@ int main( int /*argc*/, char ** /*argv*/ ) << "\n"; std::cout << "\t\t\t" << "standardSampleLocations = " - << static_cast( properties.limits.standardSampleLocations ) << "\n"; + << !!properties.limits.standardSampleLocations << "\n"; std::cout << "\t\t\t" << "storageImageSampleCounts = " << vk::to_string( properties.limits.storageImageSampleCounts ) << "\n"; std::cout << "\t\t\t" << "strictLines = " - << static_cast( properties.limits.strictLines ) << "\n"; + << !!properties.limits.strictLines << "\n"; std::cout << "\t\t\t" << "subPixelInterpolationOffsetBits = " << properties.limits.subPixelInterpolationOffsetBits << "\n"; @@ -486,7 +486,7 @@ int main( int /*argc*/, char ** /*argv*/ ) << "\n"; std::cout << "\t\t\t" << "timestampComputeAndGraphics = " - << static_cast( properties.limits.timestampComputeAndGraphics ) << "\n"; + << !!properties.limits.timestampComputeAndGraphics << "\n"; std::cout << "\t\t\t" << "timestampPeriod = " << properties.limits.timestampPeriod << "\n"; std::cout << "\t\t\t" @@ -501,19 +501,19 @@ int main( int /*argc*/, char ** /*argv*/ ) << "sparseProperties:\n"; std::cout << "\t\t\t" << "residencyAlignedMipSize = " - << static_cast( properties.sparseProperties.residencyAlignedMipSize ) << "\n"; + << !!properties.sparseProperties.residencyAlignedMipSize << "\n"; std::cout << "\t\t\t" << "residencyNonResidentStrict = " - << static_cast( properties.sparseProperties.residencyNonResidentStrict ) << "\n"; + << !!properties.sparseProperties.residencyNonResidentStrict << "\n"; std::cout << "\t\t\t" << "residencyStandard2DBlockShape = " - << static_cast( properties.sparseProperties.residencyStandard2DBlockShape ) << "\n"; + << !!properties.sparseProperties.residencyStandard2DBlockShape << "\n"; std::cout << "\t\t\t" << "residencyStandard2DMultisampleBlockShape = " - << static_cast( properties.sparseProperties.residencyStandard2DMultisampleBlockShape ) << "\n"; + << !!properties.sparseProperties.residencyStandard2DMultisampleBlockShape << "\n"; std::cout << "\t\t\t" << "residencyStandard3DBlockShape = " - << static_cast( properties.sparseProperties.residencyStandard3DBlockShape ) << "\n"; + << !!properties.sparseProperties.residencyStandard3DBlockShape << "\n"; std::cout << "\n"; if ( vk::su::contains( extensionProperties, "VK_EXT_blend_operation_advanced" ) ) @@ -524,23 +524,23 @@ int main( int /*argc*/, char ** /*argv*/ ) << "BlendOperationAdvancedProperties:\n"; std::cout << "\t\t" << "advancedBlendAllOperations = " - << static_cast( blendOperationAdvancedProperties.advancedBlendAllOperations ) << "\n"; + << !!blendOperationAdvancedProperties.advancedBlendAllOperations << "\n"; std::cout << "\t\t" << "advancedBlendCorrelatedOverlap = " - << static_cast( blendOperationAdvancedProperties.advancedBlendCorrelatedOverlap ) << "\n"; + << !!blendOperationAdvancedProperties.advancedBlendCorrelatedOverlap << "\n"; std::cout << "\t\t" << "advancedBlendIndependentBlend = " - << static_cast( blendOperationAdvancedProperties.advancedBlendIndependentBlend ) << "\n"; + << !!blendOperationAdvancedProperties.advancedBlendIndependentBlend << "\n"; std::cout << "\t\t" << "advancedBlendMaxColorAttachments = " << blendOperationAdvancedProperties.advancedBlendMaxColorAttachments << "\n"; std::cout << "\t\t" << "advancedBlendNonPremultipliedDstColor = " - << static_cast( blendOperationAdvancedProperties.advancedBlendNonPremultipliedDstColor ) + << !!blendOperationAdvancedProperties.advancedBlendNonPremultipliedDstColor << "\n"; std::cout << "\t\t" << "advancedBlendNonPremultipliedSrcColor = " - << static_cast( blendOperationAdvancedProperties.advancedBlendNonPremultipliedSrcColor ) + << !!blendOperationAdvancedProperties.advancedBlendNonPremultipliedSrcColor << "\n"; std::cout << "\n"; } @@ -553,24 +553,24 @@ int main( int /*argc*/, char ** /*argv*/ ) << "ConservativeRasterizationProperties:\n"; std::cout << "\t\t" << "conservativePointAndLineRasterization = " - << static_cast( conservativeRasterizationProperties.conservativePointAndLineRasterization ) + << !!conservativeRasterizationProperties.conservativePointAndLineRasterization << "\n"; std::cout << "\t\t" << "conservativeRasterizationPostDepthCoverage = " - << static_cast( conservativeRasterizationProperties.conservativeRasterizationPostDepthCoverage ) + << !!conservativeRasterizationProperties.conservativeRasterizationPostDepthCoverage << "\n"; std::cout << "\t\t" << "degenerateLinesRasterized = " - << static_cast( conservativeRasterizationProperties.degenerateLinesRasterized ) << "\n"; + << !!conservativeRasterizationProperties.degenerateLinesRasterized << "\n"; std::cout << "\t\t" << "degenerateTrianglesRasterized = " - << static_cast( conservativeRasterizationProperties.degenerateTrianglesRasterized ) << "\n"; + << !!conservativeRasterizationProperties.degenerateTrianglesRasterized << "\n"; std::cout << "\t\t" << "extraPrimitiveOverestimationSizeGranularity = " << conservativeRasterizationProperties.extraPrimitiveOverestimationSizeGranularity << "\n"; std::cout << "\t\t" << "fullyCoveredFragmentShaderInputVariable = " - << static_cast( conservativeRasterizationProperties.fullyCoveredFragmentShaderInputVariable ) + << !!conservativeRasterizationProperties.fullyCoveredFragmentShaderInputVariable << "\n"; std::cout << "\t\t" << "maxExtraPrimitiveOverestimationSize = " @@ -580,7 +580,7 @@ int main( int /*argc*/, char ** /*argv*/ ) << conservativeRasterizationProperties.primitiveOverestimationSize << "\n"; std::cout << "\t\t" << "primitiveUnderestimation = " - << static_cast( conservativeRasterizationProperties.primitiveUnderestimation ) << "\n"; + << !!conservativeRasterizationProperties.primitiveUnderestimation << "\n"; std::cout << "\n"; } @@ -604,10 +604,10 @@ int main( int /*argc*/, char ** /*argv*/ ) << "DepthStencilResolveProperties:\n"; std::cout << "\t\t" << "independentResolve = " - << static_cast( depthStencilResolveProperties.independentResolve ) << "\n"; + << !!depthStencilResolveProperties.independentResolve << "\n"; std::cout << "\t\t" << "independentResolveNone = " - << static_cast( depthStencilResolveProperties.independentResolveNone ) << "\n"; + << !!depthStencilResolveProperties.independentResolveNone << "\n"; std::cout << "\t\t" << "supportedDepthResolveModes = " << vk::to_string( depthStencilResolveProperties.supportedDepthResolveModes ) << "\n"; @@ -673,30 +673,29 @@ int main( int /*argc*/, char ** /*argv*/ ) << descriptorIndexingProperties.maxUpdateAfterBindDescriptorsInAllPools << "\n"; std::cout << "\t\t" << "quadDivergentImplicitLod = " - << static_cast( descriptorIndexingProperties.quadDivergentImplicitLod ) << "\n"; + << !!descriptorIndexingProperties.quadDivergentImplicitLod << "\n"; std::cout << "\t\t" << "robustBufferAccessUpdateAfterBind = " - << static_cast( descriptorIndexingProperties.robustBufferAccessUpdateAfterBind ) << "\n"; + << !!descriptorIndexingProperties.robustBufferAccessUpdateAfterBind << "\n"; std::cout << "\t\t" << "shaderInputAttachmentArrayNonUniformIndexingNative = " - << static_cast( - descriptorIndexingProperties.shaderInputAttachmentArrayNonUniformIndexingNative ) + << !!descriptorIndexingProperties.shaderInputAttachmentArrayNonUniformIndexingNative << "\n"; std::cout << "\t\t" << "shaderSampledImageArrayNonUniformIndexingNative = " - << static_cast( descriptorIndexingProperties.shaderSampledImageArrayNonUniformIndexingNative ) + << !!descriptorIndexingProperties.shaderSampledImageArrayNonUniformIndexingNative << "\n"; std::cout << "\t\t" << "shaderStorageBufferArrayNonUniformIndexingNative = " - << static_cast( descriptorIndexingProperties.shaderStorageBufferArrayNonUniformIndexingNative ) + << !!descriptorIndexingProperties.shaderStorageBufferArrayNonUniformIndexingNative << "\n"; std::cout << "\t\t" << "shaderStorageImageArrayNonUniformIndexingNative = " - << static_cast( descriptorIndexingProperties.shaderStorageImageArrayNonUniformIndexingNative ) + << !!descriptorIndexingProperties.shaderStorageImageArrayNonUniformIndexingNative << "\n"; std::cout << "\t\t" << "shaderUniformBufferArrayNonUniformIndexingNative = " - << static_cast( descriptorIndexingProperties.shaderUniformBufferArrayNonUniformIndexingNative ) + << !!descriptorIndexingProperties.shaderUniformBufferArrayNonUniformIndexingNative << "\n"; std::cout << "\n"; } @@ -758,49 +757,49 @@ int main( int /*argc*/, char ** /*argv*/ ) << vk::to_string( floatControlsProperties.roundingModeIndependence ) << "\n"; std::cout << "\t\t" << "shaderDenormFlushToZeroFloat16 = " - << static_cast( floatControlsProperties.shaderDenormFlushToZeroFloat16 ) << "\n"; + << !!floatControlsProperties.shaderDenormFlushToZeroFloat16 << "\n"; std::cout << "\t\t" << "shaderDenormFlushToZeroFloat32 = " - << static_cast( floatControlsProperties.shaderDenormFlushToZeroFloat32 ) << "\n"; + << !!floatControlsProperties.shaderDenormFlushToZeroFloat32 << "\n"; std::cout << "\t\t" << "shaderDenormFlushToZeroFloat64 = " - << static_cast( floatControlsProperties.shaderDenormFlushToZeroFloat64 ) << "\n"; + << !!floatControlsProperties.shaderDenormFlushToZeroFloat64 << "\n"; std::cout << "\t\t" << "shaderDenormPreserveFloat16 = " - << static_cast( floatControlsProperties.shaderDenormPreserveFloat16 ) << "\n"; + << !!floatControlsProperties.shaderDenormPreserveFloat16 << "\n"; std::cout << "\t\t" << "shaderDenormPreserveFloat32 = " - << static_cast( floatControlsProperties.shaderDenormPreserveFloat32 ) << "\n"; + << !!floatControlsProperties.shaderDenormPreserveFloat32 << "\n"; std::cout << "\t\t" << "shaderDenormPreserveFloat64 = " - << static_cast( floatControlsProperties.shaderDenormPreserveFloat64 ) << "\n"; + << !!floatControlsProperties.shaderDenormPreserveFloat64 << "\n"; std::cout << "\t\t" << "shaderRoundingModeRTEFloat16 = " - << static_cast( floatControlsProperties.shaderRoundingModeRTEFloat16 ) << "\n"; + << !!floatControlsProperties.shaderRoundingModeRTEFloat16 << "\n"; std::cout << "\t\t" << "shaderRoundingModeRTEFloat32 = " - << static_cast( floatControlsProperties.shaderRoundingModeRTEFloat32 ) << "\n"; + << !!floatControlsProperties.shaderRoundingModeRTEFloat32 << "\n"; std::cout << "\t\t" << "shaderRoundingModeRTEFloat64 = " - << static_cast( floatControlsProperties.shaderRoundingModeRTEFloat64 ) << "\n"; + << !!floatControlsProperties.shaderRoundingModeRTEFloat64 << "\n"; std::cout << "\t\t" << "shaderRoundingModeRTZFloat16 = " - << static_cast( floatControlsProperties.shaderRoundingModeRTZFloat16 ) << "\n"; + << !!floatControlsProperties.shaderRoundingModeRTZFloat16 << "\n"; std::cout << "\t\t" << "shaderRoundingModeRTZFloat32 = " - << static_cast( floatControlsProperties.shaderRoundingModeRTZFloat32 ) << "\n"; + << !!floatControlsProperties.shaderRoundingModeRTZFloat32 << "\n"; std::cout << "\t\t" << "shaderRoundingModeRTZFloat64 = " - << static_cast( floatControlsProperties.shaderRoundingModeRTZFloat64 ) << "\n"; + << !!floatControlsProperties.shaderRoundingModeRTZFloat64 << "\n"; std::cout << "\t\t" << "shaderSignedZeroInfNanPreserveFloat16 = " - << static_cast( floatControlsProperties.shaderSignedZeroInfNanPreserveFloat16 ) << "\n"; + << !!floatControlsProperties.shaderSignedZeroInfNanPreserveFloat16 << "\n"; std::cout << "\t\t" << "shaderSignedZeroInfNanPreserveFloat32 = " - << static_cast( floatControlsProperties.shaderSignedZeroInfNanPreserveFloat32 ) << "\n"; + << !!floatControlsProperties.shaderSignedZeroInfNanPreserveFloat32 << "\n"; std::cout << "\t\t" << "shaderSignedZeroInfNanPreserveFloat64 = " - << static_cast( floatControlsProperties.shaderSignedZeroInfNanPreserveFloat64 ) << "\n"; + << !!floatControlsProperties.shaderSignedZeroInfNanPreserveFloat64 << "\n"; std::cout << "\n"; } @@ -812,7 +811,7 @@ int main( int /*argc*/, char ** /*argv*/ ) << "FragmentDensityProperties:\n"; std::cout << "\t\t" << "fragmentDensityInvocations = " - << static_cast( fragmentDensityMapProperties.fragmentDensityInvocations ) << "\n"; + << !!fragmentDensityMapProperties.fragmentDensityInvocations << "\n"; std::cout << "\t\t" << "maxFragmentDensityTexelSize = " << fragmentDensityMapProperties.maxFragmentDensityTexelSize.width << " x " << fragmentDensityMapProperties.maxFragmentDensityTexelSize.height << "\n"; @@ -834,7 +833,7 @@ int main( int /*argc*/, char ** /*argv*/ ) std::cout << "\t\t" << "deviceNodeMask = " << std::hex << idProperties.deviceNodeMask << std::dec << "\n"; std::cout << "\t\t" - << "deviceLUIDValid = " << static_cast( idProperties.deviceLUIDValid ) << "\n"; + << "deviceLUIDValid = " << !!idProperties.deviceLUIDValid << "\n"; std::cout << "\n"; if ( vk::su::contains( extensionProperties, "VK_EXT_inline_uniform_block" ) ) @@ -935,7 +934,7 @@ int main( int /*argc*/, char ** /*argv*/ ) << "MultiviewPerViewAttributesProperties:\n"; std::cout << "\t\t" << "perViewPositionAllComponents = " - << static_cast( multiviewPerViewAttributesProperties.perViewPositionAllComponents ) << "\n"; + << !!multiviewPerViewAttributesProperties.perViewPositionAllComponents << "\n"; std::cout << "\n"; } @@ -983,7 +982,7 @@ int main( int /*argc*/, char ** /*argv*/ ) std::cout << "\t" << "ProtectedMemoryProperties:\n"; std::cout << "\t\t" - << "protectedNoFault = " << static_cast( protectedMemoryProperties.protectedNoFault ) << "\n"; + << "protectedNoFault = " << !!protectedMemoryProperties.protectedNoFault << "\n"; std::cout << "\n"; if ( vk::su::contains( extensionProperties, "VK_KHR_push_descriptor" ) ) @@ -1045,7 +1044,7 @@ int main( int /*argc*/, char ** /*argv*/ ) << "sampleLocationSubPixelBits = " << sampleLocationProperties.sampleLocationSubPixelBits << "\n"; std::cout << "\t\t" << "variableSampleLocations = " - << static_cast( sampleLocationProperties.variableSampleLocations ) << "\n"; + << !!sampleLocationProperties.variableSampleLocations << "\n"; std::cout << "\n"; } @@ -1057,10 +1056,10 @@ int main( int /*argc*/, char ** /*argv*/ ) << "SamplerFilterMinmaxProperties:\n"; std::cout << "\t\t" << "filterMinmaxImageComponentMapping = " - << static_cast( samplerFilterMinmaxProperties.filterMinmaxImageComponentMapping ) << "\n"; + << !!samplerFilterMinmaxProperties.filterMinmaxImageComponentMapping << "\n"; std::cout << "\t\t" << "filterMinmaxSingleComponentFormats = " - << static_cast( samplerFilterMinmaxProperties.filterMinmaxSingleComponentFormats ) << "\n"; + << !!samplerFilterMinmaxProperties.filterMinmaxSingleComponentFormats << "\n"; std::cout << "\n"; } @@ -1150,7 +1149,7 @@ int main( int /*argc*/, char ** /*argv*/ ) std::cout << "\t" << "SubgroupProperties:\n"; std::cout << "\t\t" - << "quadOperationsInAllStages = " << static_cast( subgroupProperties.quadOperationsInAllStages ) + << "quadOperationsInAllStages = " << !!subgroupProperties.quadOperationsInAllStages << "\n"; std::cout << "\t\t" << "subgroupSize = " << subgroupProperties.subgroupSize << "\n"; @@ -1202,14 +1201,14 @@ int main( int /*argc*/, char ** /*argv*/ ) << texelBufferAlignmentProperties.storageTexelBufferOffsetAlignmentBytes << "\n"; std::cout << "\t\t" << "storageTexelBufferOffsetSingleTexelAlignment = " - << static_cast( texelBufferAlignmentProperties.storageTexelBufferOffsetSingleTexelAlignment ) + << !!texelBufferAlignmentProperties.storageTexelBufferOffsetSingleTexelAlignment << "\n"; std::cout << "\t\t" << "uniformTexelBufferOffsetAlignmentBytes = " << texelBufferAlignmentProperties.uniformTexelBufferOffsetAlignmentBytes << "\n"; std::cout << "\t\t" << "uniformTexelBufferOffsetSingleTexelAlignment = " - << static_cast( texelBufferAlignmentProperties.uniformTexelBufferOffsetSingleTexelAlignment ) + << !!texelBufferAlignmentProperties.uniformTexelBufferOffsetSingleTexelAlignment << "\n"; std::cout << "\n"; } @@ -1240,17 +1239,17 @@ int main( int /*argc*/, char ** /*argv*/ ) << transformFeedbackProperties.maxTransformFeedbackStreams << "\n"; std::cout << "\t\t" << "transformFeedbackDraw = " - << static_cast( transformFeedbackProperties.transformFeedbackDraw ) << "\n"; + << !!transformFeedbackProperties.transformFeedbackDraw << "\n"; std::cout << "\t\t" << "transformFeedbackQueries = " - << static_cast( transformFeedbackProperties.transformFeedbackQueries ) << "\n"; + << !!transformFeedbackProperties.transformFeedbackQueries << "\n"; std::cout << "\t\t" << "transformFeedbackRasterizationStreamSelect = " - << static_cast( transformFeedbackProperties.transformFeedbackRasterizationStreamSelect ) + << !!transformFeedbackProperties.transformFeedbackRasterizationStreamSelect << "\n"; std::cout << "\t\t" << "transformFeedbackStreamsLinesTriangles = " - << static_cast( transformFeedbackProperties.transformFeedbackStreamsLinesTriangles ) << "\n"; + << !!transformFeedbackProperties.transformFeedbackStreamsLinesTriangles << "\n"; std::cout << "\n"; } diff --git a/samples/PipelineCache/PipelineCache.cpp b/samples/PipelineCache/PipelineCache.cpp index 3a357dd..e3ccf9e 100644 --- a/samples/PipelineCache/PipelineCache.cpp +++ b/samples/PipelineCache/PipelineCache.cpp @@ -15,6 +15,18 @@ // VulkanHpp Samples : PipelineCache // This sample tries to save and reuse pipeline cache data between runs. +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -158,7 +170,7 @@ int main( int /*argc*/, char ** /*argv*/ ) { // Determine cache size readCacheStream.seekg( 0, readCacheStream.end ); - startCacheSize = vk::su::checked_cast( readCacheStream.tellg() ); + startCacheSize = static_cast( readCacheStream.tellg() ); readCacheStream.seekg( 0, readCacheStream.beg ); // Allocate memory to hold the initial cache data @@ -352,7 +364,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/PipelineDerivative/PipelineDerivative.cpp b/samples/PipelineDerivative/PipelineDerivative.cpp index d3645d2..57e1334 100644 --- a/samples/PipelineDerivative/PipelineDerivative.cpp +++ b/samples/PipelineDerivative/PipelineDerivative.cpp @@ -15,6 +15,18 @@ // VulkanHpp Samples : PipelineDerivative // This sample creates pipeline derivative and draws with it. +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -308,7 +320,9 @@ void main() switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/PushConstants/PushConstants.cpp b/samples/PushConstants/PushConstants.cpp index 6fed256..358e37d 100644 --- a/samples/PushConstants/PushConstants.cpp +++ b/samples/PushConstants/PushConstants.cpp @@ -15,6 +15,18 @@ // VulkanHpp Samples : PushConstants // Use push constants in a simple shader, validate the correct value was read. +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -236,7 +248,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/PushDescriptors/PushDescriptors.cpp b/samples/PushDescriptors/PushDescriptors.cpp index 30b587c..bb794fa 100644 --- a/samples/PushDescriptors/PushDescriptors.cpp +++ b/samples/PushDescriptors/PushDescriptors.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : PushDescriptors // Use Push Descriptors to Draw Textured Cube +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -214,7 +224,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/RayTracing/CameraManipulator.cpp b/samples/RayTracing/CameraManipulator.cpp index dbb2cf0..1ce8348 100644 --- a/samples/RayTracing/CameraManipulator.cpp +++ b/samples/RayTracing/CameraManipulator.cpp @@ -13,6 +13,19 @@ // limitations under the License. // +// ignore warning 4127: conditional expression is constant +#if defined( _MSC_VER ) +# pragma warning( disable : 4127 ) +#elif defined( __clang__ ) +# if ( 10 <= __clang_major__ ) +# pragma clang diagnostic ignored "-Wdeprecated-volatile" // to keep glm/detail/type_half.inl compiling +# endif +#elif defined( __GNUC__ ) +// don't know how to switch off that warning here +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "CameraManipulator.hpp" #include @@ -166,7 +179,7 @@ namespace vk void CameraManipulator::wheel( int value ) { float fValue = static_cast( value ); - float dx = ( fValue * abs( fValue ) ) / static_cast( m_windowSize[0] ); + float dx = ( fValue * std::abs( fValue ) ) / static_cast( m_windowSize[0] ); glm::vec3 z = m_cameraPosition - m_centerPosition; float length = z.length() * 0.1f; @@ -265,8 +278,7 @@ namespace vk orbit( glm::vec2( delta[0], -delta[1] ), true ); } break; - default: - break; + default: break; } update(); diff --git a/samples/RayTracing/RayTracing.cpp b/samples/RayTracing/RayTracing.cpp index c46f9d2..cf359a7 100644 --- a/samples/RayTracing/RayTracing.cpp +++ b/samples/RayTracing/RayTracing.cpp @@ -15,6 +15,22 @@ // VulkanHpp Samples : RayTracing // Simple sample how to ray trace using Vulkan +#if defined( _MSC_VER ) +# pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed + // to get glm/detail/type_vec?.hpp without warnings +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +# if ( 10 <= __clang_major__ ) +# pragma clang diagnostic ignored "-Wdeprecated-volatile" // to keep glm/detail/type_half.inl compiling +# endif +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + // clang-format off // we need to include vulkan.hpp before glfw3.h, so stop clang-format to reorder them #include @@ -27,8 +43,6 @@ #define GLM_FORCE_DEPTH_ZERO_TO_ONE #define GLM_FORCE_RADIANS #define GLM_ENABLE_EXPERIMENTAL -#pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed - // to get glm/detail/type_vec?.hpp without warnings #include "../utils/shaders.hpp" #include "../utils/utils.hpp" #include "CameraManipulator.hpp" @@ -542,11 +556,11 @@ static void cursorPosCallback( GLFWwindow * window, double mouseX, double mouseY vk::su::CameraManipulator::MouseButton mouseButton = ( glfwGetMouseButton( window, GLFW_MOUSE_BUTTON_LEFT ) == GLFW_PRESS ) ? vk::su::CameraManipulator::MouseButton::Left - : ( glfwGetMouseButton( window, GLFW_MOUSE_BUTTON_MIDDLE ) == GLFW_PRESS ) - ? vk::su::CameraManipulator::MouseButton::Middle - : ( glfwGetMouseButton( window, GLFW_MOUSE_BUTTON_RIGHT ) == GLFW_PRESS ) - ? vk::su::CameraManipulator::MouseButton::Right - : vk::su::CameraManipulator::MouseButton::None; + : ( glfwGetMouseButton( window, GLFW_MOUSE_BUTTON_MIDDLE ) == GLFW_PRESS ) + ? vk::su::CameraManipulator::MouseButton::Middle + : ( glfwGetMouseButton( window, GLFW_MOUSE_BUTTON_RIGHT ) == GLFW_PRESS ) + ? vk::su::CameraManipulator::MouseButton::Right + : vk::su::CameraManipulator::MouseButton::None; if ( mouseButton != vk::su::CameraManipulator::MouseButton::None ) { vk::su::CameraManipulator::ModifierFlags modifiers; @@ -639,7 +653,7 @@ glm::vec3 randomVec3( float minValue, float maxValue ) randomDistribution( randomGenerator ) ); } -size_t roundUp( size_t value, size_t alignment ) +uint32_t roundUp( uint32_t value, uint32_t alignment ) { return ( ( value + alignment - 1 ) / alignment ) * alignment; } @@ -772,7 +786,7 @@ int main( int /*argc*/, char ** /*argv*/ ) std::vector framebuffers = vk::su::createFramebuffers( device, renderPass, swapChainData.imageViews, depthBufferData.imageView, windowExtent ); - bool samplerAnisotropy = supportedFeatures.get().features.samplerAnisotropy; + bool samplerAnisotropy = !!supportedFeatures.get().features.samplerAnisotropy; // create some simple checkerboard textures, randomly sized and colored const size_t textureCount = 10; @@ -1120,24 +1134,24 @@ int main( int /*argc*/, char ** /*argv*/ ) uint32_t shaderGroupHandleSize = propertiesChain.get().shaderGroupHandleSize; - vk::DeviceSize raygenShaderBindingOffset = 0; // starting with raygen - uint32_t raygenShaderTableSize = shaderGroupHandleSize; // one raygen shader - vk::DeviceSize missShaderBindingOffset = + uint32_t raygenShaderBindingOffset = 0; // starting with raygen + uint32_t raygenShaderTableSize = shaderGroupHandleSize; // one raygen shader + uint32_t missShaderBindingOffset = raygenShaderBindingOffset + roundUp( raygenShaderTableSize, shaderGroupBaseAlignment ); - vk::DeviceSize missShaderBindingStride = shaderGroupHandleSize; - uint32_t missShaderTableSize = vk::su::checked_cast( 2 * missShaderBindingStride ); // two raygen shaders - vk::DeviceSize hitShaderBindingOffset = + uint32_t missShaderBindingStride = shaderGroupHandleSize; + uint32_t missShaderTableSize = 2 * missShaderBindingStride; // two raygen shaders + uint32_t hitShaderBindingOffset = missShaderBindingOffset + roundUp( missShaderTableSize, shaderGroupBaseAlignment ); - vk::DeviceSize hitShaderBindingStride = shaderGroupHandleSize; - uint32_t hitShaderTableSize = vk::su::checked_cast( 2 * hitShaderBindingStride ); // two hit shaders + uint32_t hitShaderBindingStride = shaderGroupHandleSize; + uint32_t hitShaderTableSize = 2 * hitShaderBindingStride; // two hit shaders - vk::DeviceSize shaderBindingTableSize = hitShaderBindingOffset + hitShaderTableSize; + uint32_t shaderBindingTableSize = hitShaderBindingOffset + hitShaderTableSize; std::vector shaderHandleStorage( shaderBindingTableSize ); - device->getRayTracingShaderGroupHandlesNV( + (void)device->getRayTracingShaderGroupHandlesNV( *rayTracingPipeline, 0, 1, raygenShaderTableSize, &shaderHandleStorage[raygenShaderBindingOffset] ); - device->getRayTracingShaderGroupHandlesNV( + (void)device->getRayTracingShaderGroupHandlesNV( *rayTracingPipeline, 1, 2, missShaderTableSize, &shaderHandleStorage[missShaderBindingOffset] ); - device->getRayTracingShaderGroupHandlesNV( + (void)device->getRayTracingShaderGroupHandlesNV( *rayTracingPipeline, 3, 2, hitShaderTableSize, &shaderHandleStorage[hitShaderBindingOffset] ); vk::su::BufferData shaderBindingTableBufferData( physicalDevice, @@ -1308,7 +1322,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } frameIndex = ( frameIndex + 1 ) % IMGUI_VK_QUEUED_FRAMES; diff --git a/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp b/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp index fc0f069..a0fa515 100644 --- a/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp +++ b/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : SecondaryCommandBuffer // Draw several cubes using primary and secondary command buffers +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +// no need to ignore any warnings with GCC +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -234,7 +244,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/SeparateImageSampler/SeparateImageSampler.cpp b/samples/SeparateImageSampler/SeparateImageSampler.cpp index 5174161..c9bba1c 100644 --- a/samples/SeparateImageSampler/SeparateImageSampler.cpp +++ b/samples/SeparateImageSampler/SeparateImageSampler.cpp @@ -15,6 +15,18 @@ // VulkanHpp Samples : SeparateImageSampler // Use separate image and sampler in descriptor set and shader to draw a textured cube. +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -257,7 +269,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/SurfaceCapabilities/SurfaceCapabilities.cpp b/samples/SurfaceCapabilities/SurfaceCapabilities.cpp index a8e9420..9893acb 100644 --- a/samples/SurfaceCapabilities/SurfaceCapabilities.cpp +++ b/samples/SurfaceCapabilities/SurfaceCapabilities.cpp @@ -120,8 +120,7 @@ int main( int /*argc*/, char ** /*argv*/ ) surfaceCapabilities2.get(); std::cout << "\tDisplayNativeHdrSurfaceCapabilitiesAMD:\n"; std::cout << "\t\t" - << "localDimmingSupport = " - << static_cast( displayNativeHdrSurfaceCapabilities.localDimmingSupport ) << "\n"; + << "localDimmingSupport = " << !!displayNativeHdrSurfaceCapabilities.localDimmingSupport << "\n"; std::cout << "\n"; } @@ -143,7 +142,7 @@ int main( int /*argc*/, char ** /*argv*/ ) std::cout << "\tSurfaceCapabilitiesFullScreenExclusiveEXT:\n"; std::cout << "\t\t" << "fullScreenExclusiveSupported = " - << static_cast( surfaceCapabilitiesFullScreenExclusive.fullScreenExclusiveSupported ) << "\n"; + << !!surfaceCapabilitiesFullScreenExclusive.fullScreenExclusiveSupported << "\n"; std::cout << "\n"; } @@ -153,8 +152,7 @@ int main( int /*argc*/, char ** /*argv*/ ) surfaceCapabilities2.get(); std::cout << "\tSurfaceProtectedCapabilitiesKHR:\n"; std::cout << "\t\t" - << "supportsProtected = " << static_cast( surfaceProtectedCapabilities.supportsProtected ) - << "\n"; + << "supportsProtected = " << !!surfaceProtectedCapabilities.supportsProtected << "\n"; std::cout << "\n"; } } diff --git a/samples/Template/Template.cpp b/samples/Template/Template.cpp index 0f80434..35045ff 100644 --- a/samples/Template/Template.cpp +++ b/samples/Template/Template.cpp @@ -15,6 +15,16 @@ // VulkanHpp Samples : Template // Template sample to start from. Draw textured cube with mostly helpers. +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __GNUC__ ) +# if ( 9 <= __GNUC__ ) +# pragma GCC diagnostic ignored "-Winit-list-lifetime" +# endif +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "../utils/geometries.hpp" #include "../utils/math.hpp" #include "../utils/shaders.hpp" @@ -175,7 +185,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/TexelBuffer/TexelBuffer.cpp b/samples/TexelBuffer/TexelBuffer.cpp index b215316..70bff5a 100644 --- a/samples/TexelBuffer/TexelBuffer.cpp +++ b/samples/TexelBuffer/TexelBuffer.cpp @@ -208,7 +208,9 @@ int main( int /*argc*/, char ** /*argv*/ ) switch ( result ) { case vk::Result::eSuccess: break; - case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + case vk::Result::eSuboptimalKHR: + std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; + break; default: assert( false ); // an unexpected result is returned ! } std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) ); diff --git a/samples/utils/math.cpp b/samples/utils/math.cpp index e9b8011..4547125 100644 --- a/samples/utils/math.cpp +++ b/samples/utils/math.cpp @@ -13,6 +13,15 @@ // limitations under the License. // +// ignore warning 4127: conditional expression is constant +#if defined( _MSC_VER ) +# pragma warning( disable : 4127 ) +#elif defined( __GNUC__ ) +// don't know how to switch off that warning here +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "math.hpp" namespace vk diff --git a/samples/utils/math.hpp b/samples/utils/math.hpp index 6045bec..fba55b2 100644 --- a/samples/utils/math.hpp +++ b/samples/utils/math.hpp @@ -13,14 +13,18 @@ // limitations under the License. // -#include -#define GLM_FORCE_RADIANS - -#if defined(_MSC_VER) -#pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed - // to get glm/detail/type_vec?.hpp without warnings +#if defined( _MSC_VER ) +# pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed + // to get glm/detail/type_vec?.hpp without warnings +#elif defined( __GNUC__ ) +// don't know how to switch off that warning here +#else +// unknow compiler... just ignore the warnings for yourselves ;) #endif - + +#include + +#define GLM_FORCE_RADIANS #include namespace vk diff --git a/samples/utils/utils.cpp b/samples/utils/utils.cpp index 3dac7f0..13e0042 100644 --- a/samples/utils/utils.cpp +++ b/samples/utils/utils.cpp @@ -13,6 +13,16 @@ // limitations under the License. // +#if defined( _MSC_VER ) +// no need to ignore any warnings with MSVC +#elif defined( __clang__ ) +# pragma clang diagnostic ignored "-Wmissing-braces" +#elif defined( __GNUC__ ) +// no need to ignore any warnings with GCC +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "utils.hpp" #include "vulkan/vulkan.hpp" @@ -521,7 +531,7 @@ namespace vk } typeBits >>= 1; } - assert( typeIndex != ~0 ); + assert( typeIndex != uint32_t(~0) ); return typeIndex; } @@ -1046,7 +1056,6 @@ namespace vk bool forceStaging ) : format( vk::Format::eR8G8B8A8Unorm ), extent( extent_ ) { - vk::PhysicalDeviceMemoryProperties memoryProperties = physicalDevice.getMemoryProperties(); vk::FormatProperties formatProperties = physicalDevice.getFormatProperties( format ); formatFeatureFlags |= vk::FormatFeatureFlagBits::eSampledImage; diff --git a/samples/utils/utils.hpp b/samples/utils/utils.hpp index 20a0e38..b555e53 100644 --- a/samples/utils/utils.hpp +++ b/samples/utils/utils.hpp @@ -343,8 +343,10 @@ namespace vk VULKAN_HPP_INLINE TargetType checked_cast( SourceType value ) { static_assert( sizeof( TargetType ) <= sizeof( SourceType ), "No need to cast from smaller to larger type!" ); - static_assert( !std::numeric_limits::is_signed, "Only unsigned types supported!" ); + static_assert( std::numeric_limits::is_integer, "Only integer types supported!" ); static_assert( !std::numeric_limits::is_signed, "Only unsigned types supported!" ); + static_assert( std::numeric_limits::is_integer, "Only integer types supported!" ); + static_assert( !std::numeric_limits::is_signed, "Only unsigned types supported!" ); assert( value <= std::numeric_limits::max() ); return static_cast( value ); } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8848a04..3ea58c6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,6 +24,12 @@ if (NOT (TESTS_BUILD_ONLY_DYNAMIC AND TESTS_BUILD_WITH_LOCAL_VULKAN_HPP)) find_package(Vulkan REQUIRED) endif() +if(MSVC) + add_compile_options(/W4 /WX /permissive-) +else(MSVC) + add_compile_options(-Wall -Wextra -pedantic -Werror) +endif(MSVC) + if (WIN32) add_definitions(-DNOMINMAX -DVK_USE_PLATFORM_WIN32_KHR) elseif(UNIX) diff --git a/tests/DeviceFunctions/DeviceFunctions.cpp b/tests/DeviceFunctions/DeviceFunctions.cpp index 729ca1b..7508a1a 100644 --- a/tests/DeviceFunctions/DeviceFunctions.cpp +++ b/tests/DeviceFunctions/DeviceFunctions.cpp @@ -15,6 +15,15 @@ // VulkanHpp Samples : DeviceFunctions // Compile test on device functions +// ignore warning 4189: local variable is initialized but not referenced +#if defined( _MSC_VER ) +# pragma warning( disable : 4189 ) +#elif defined( __GNUC__ ) +# pragma GCC diagnostic ignored "-Wunused-variable" +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #include "vulkan/vulkan.hpp" #include diff --git a/tests/StructureChain/StructureChain.cpp b/tests/StructureChain/StructureChain.cpp index 2aea587..5f47e98 100644 --- a/tests/StructureChain/StructureChain.cpp +++ b/tests/StructureChain/StructureChain.cpp @@ -15,6 +15,15 @@ // VulkanHpp Tests : StructureChain // Compile-test for StructureChains +// ignore warning 4189: local variable is initialized but not referenced +#if defined( _MSC_VER ) +# pragma warning( disable : 4189 ) +#elif defined( __GNUC__ ) +# pragma GCC diagnostic ignored "-Wunused-variable" +#else +// unknow compiler... just ignore the warnings for yourselves ;) +#endif + #define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1 #include "vulkan/vulkan.hpp" @@ -24,14 +33,6 @@ static char const * AppName = "StructureChain"; static char const * EngineName = "Vulkan.hpp"; -#if defined( _MSC_VER ) -# pragma warning( disable : 4189 ) -#elif defined( __GNUC__ ) -# pragma GCC diagnostic ignored "-Wunused-variable" -#else -// unknow compiler... just ignore the warnings for yourselves ;) -#endif - VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE template diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index b4fbe9c..7050049 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -81,6 +81,10 @@ extern "C" __declspec( dllimport ) FARPROC __stdcall GetProcAddress( HINSTANCE h # endif #endif +#if !defined( __has_include ) +# define __has_include( x ) false +#endif + #if ( 201711 <= __cpp_impl_three_way_comparison ) && __has_include( ) # define VULKAN_HPP_HAS_SPACESHIP_OPERATOR #endif