Change structure member sType to non-const to allow default assignment operator. Make copy constructor and copy assignment default. The latter is required for C++20 designated initializers. Delegate the constructor from C-type to the copy constructor by casting rhs accordingly. Fix warnings on gcc/clang.
This commit is contained in:
@@ -15,16 +15,6 @@
|
||||
// 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"
|
||||
|
||||
@@ -15,16 +15,6 @@
|
||||
// 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"
|
||||
|
||||
@@ -15,16 +15,6 @@
|
||||
// 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"
|
||||
|
||||
@@ -15,21 +15,22 @@
|
||||
// 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"
|
||||
#include "../utils/utils.hpp"
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable : 4100 ) // unreferenced formal parameter (glslang)
|
||||
#endif // endif (_MSC_VER )
|
||||
|
||||
#include "SPIRV/GlslangToSpv.h"
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#include "vulkan/vulkan.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#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
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
static char const * AppName = "InstanceExtensionProperties";
|
||||
static char const * EngineName = "Vulkan.hpp";
|
||||
|
||||
int main( int /*argc*/, char ** /*argv*/ )
|
||||
{
|
||||
try
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
static char const * AppName = "InstanceLayerExtensionProperties";
|
||||
static char const * EngineName = "Vulkan.hpp";
|
||||
|
||||
struct PropertyData
|
||||
{
|
||||
PropertyData( vk::LayerProperties const & layerProperties_,
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
static char const * AppName = "InstanceLayerProperties";
|
||||
static char const * EngineName = "Vulkan.hpp";
|
||||
|
||||
int main( int /*argc*/, char ** /*argv*/ )
|
||||
{
|
||||
try
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
static char const * AppName = "InstanceVersion";
|
||||
static char const * EngineName = "Vulkan.hpp";
|
||||
|
||||
std::string decodeAPIVersion( uint32_t apiVersion )
|
||||
{
|
||||
return std::to_string( VK_VERSION_MAJOR( apiVersion ) ) + "." + std::to_string( VK_VERSION_MINOR( apiVersion ) ) +
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#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
|
||||
|
||||
@@ -15,16 +15,6 @@
|
||||
// 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"
|
||||
|
||||
@@ -20,13 +20,9 @@
|
||||
#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"
|
||||
|
||||
@@ -20,13 +20,9 @@
|
||||
#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"
|
||||
|
||||
@@ -20,13 +20,9 @@
|
||||
#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"
|
||||
|
||||
@@ -15,16 +15,6 @@
|
||||
// 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"
|
||||
|
||||
@@ -15,7 +15,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable : 4127 ) // conditional expression is constant (glm)
|
||||
#endif
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#include <vulkan/vulkan.hpp>
|
||||
|
||||
namespace vk
|
||||
|
||||
@@ -24,9 +24,6 @@
|
||||
# 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
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#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
|
||||
|
||||
@@ -15,16 +15,6 @@
|
||||
// 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"
|
||||
|
||||
@@ -25,8 +25,18 @@
|
||||
#include <vulkan/vulkan.hpp>
|
||||
|
||||
#define GLM_FORCE_RADIANS
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable : 4127 ) // conditional expression is constant (glm)
|
||||
#endif
|
||||
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
namespace vk
|
||||
{
|
||||
namespace su
|
||||
|
||||
Reference in New Issue
Block a user