mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-12 13:27:58 -04:00
Unify long string literals to use raw string literals. (#101)
This commit is contained in:
parent
6e9d9b5111
commit
cd9d4f1388
@ -28,218 +28,217 @@
|
|||||||
|
|
||||||
#include <tinyxml2.h>
|
#include <tinyxml2.h>
|
||||||
|
|
||||||
const std::string exceptionHeader(
|
const std::string exceptionHeader = R"(
|
||||||
"#if defined(_MSC_VER) && (_MSC_VER == 1800)\n"
|
#if defined(_MSC_VER) && (_MSC_VER == 1800)
|
||||||
"# define noexcept _NOEXCEPT\n"
|
# define noexcept _NOEXCEPT
|
||||||
"#endif\n"
|
#endif
|
||||||
"\n"
|
|
||||||
" class ErrorCategoryImpl : public std::error_category\n"
|
|
||||||
" {\n"
|
|
||||||
" public:\n"
|
|
||||||
" virtual const char* name() const noexcept override { return \"vk::Result\"; }\n"
|
|
||||||
" virtual std::string message(int ev) const override { return to_string(static_cast<Result>(ev)); }\n"
|
|
||||||
" };\n"
|
|
||||||
"\n"
|
|
||||||
"#if defined(_MSC_VER) && (_MSC_VER == 1800)\n"
|
|
||||||
"# undef noexcept\n"
|
|
||||||
"#endif\n"
|
|
||||||
"\n"
|
|
||||||
" VULKAN_HPP_INLINE const std::error_category& errorCategory()\n"
|
|
||||||
" {\n"
|
|
||||||
" static ErrorCategoryImpl instance;\n"
|
|
||||||
" return instance;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" VULKAN_HPP_INLINE std::error_code make_error_code(Result e)\n"
|
|
||||||
" {\n"
|
|
||||||
" return std::error_code(static_cast<int>(e), errorCategory());\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" VULKAN_HPP_INLINE std::error_condition make_error_condition(Result e)\n"
|
|
||||||
" {\n"
|
|
||||||
" return std::error_condition(static_cast<int>(e), errorCategory());\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
std::string const exceptionClassesHeader = (
|
class ErrorCategoryImpl : public std::error_category
|
||||||
"#if defined(_MSC_VER) && (_MSC_VER == 1800)\n"
|
{
|
||||||
"# define noexcept _NOEXCEPT\n"
|
public:
|
||||||
"#endif\n"
|
virtual const char* name() const noexcept override { return "vk::Result"; }
|
||||||
"\n"
|
virtual std::string message(int ev) const override { return to_string(static_cast<Result>(ev)); }
|
||||||
" class Error\n"
|
};
|
||||||
" {\n"
|
|
||||||
" public:\n"
|
|
||||||
" virtual ~Error() = default;\n"
|
|
||||||
"\n"
|
|
||||||
" virtual const char* what() const noexcept = 0;\n"
|
|
||||||
" };\n"
|
|
||||||
"\n"
|
|
||||||
" class LogicError : public Error, public std::logic_error\n"
|
|
||||||
" {\n"
|
|
||||||
" public:\n"
|
|
||||||
" explicit LogicError( const std::string& what )\n"
|
|
||||||
" : Error(), std::logic_error(what) {}\n"
|
|
||||||
" explicit LogicError( char const * what )\n"
|
|
||||||
" : Error(), std::logic_error(what) {}\n"
|
|
||||||
" virtual ~LogicError() = default;\n"
|
|
||||||
"\n"
|
|
||||||
" virtual const char* what() const noexcept { return std::logic_error::what(); }\n"
|
|
||||||
" };\n"
|
|
||||||
"\n"
|
|
||||||
" class SystemError : public Error, public std::system_error\n"
|
|
||||||
" {\n"
|
|
||||||
" public:\n"
|
|
||||||
" SystemError( std::error_code ec )\n"
|
|
||||||
" : Error(), std::system_error(ec) {}\n"
|
|
||||||
" SystemError( std::error_code ec, std::string const& what )\n"
|
|
||||||
" : Error(), std::system_error(ec, what) {}\n"
|
|
||||||
" SystemError( std::error_code ec, char const * what )\n"
|
|
||||||
" : Error(), std::system_error(ec, what) {}\n"
|
|
||||||
" SystemError( int ev, std::error_category const& ecat )\n"
|
|
||||||
" : Error(), std::system_error(ev, ecat) {}\n"
|
|
||||||
" SystemError( int ev, std::error_category const& ecat, std::string const& what)\n"
|
|
||||||
" : Error(), std::system_error(ev, ecat, what) {}\n"
|
|
||||||
" SystemError( int ev, std::error_category const& ecat, char const * what)\n"
|
|
||||||
" : Error(), std::system_error(ev, ecat, what) {}\n"
|
|
||||||
" virtual ~SystemError() = default;\n"
|
|
||||||
"\n"
|
|
||||||
" virtual const char* what() const noexcept { return std::system_error::what(); }\n"
|
|
||||||
" };\n"
|
|
||||||
"\n"
|
|
||||||
"#if defined(_MSC_VER) && (_MSC_VER == 1800)\n"
|
|
||||||
"# undef noexcept\n"
|
|
||||||
"#endif\n"
|
|
||||||
"\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
const std::string flagsHeader(
|
#if defined(_MSC_VER) && (_MSC_VER == 1800)
|
||||||
" template <typename FlagBitsType> struct FlagTraits\n"
|
# undef noexcept
|
||||||
" {\n"
|
#endif
|
||||||
" enum { allFlags = 0 };\n"
|
|
||||||
" };\n"
|
|
||||||
"\n"
|
|
||||||
" template <typename BitType, typename MaskType = VkFlags>\n"
|
|
||||||
" class Flags\n"
|
|
||||||
" {\n"
|
|
||||||
" public:\n"
|
|
||||||
" Flags()\n"
|
|
||||||
" : m_mask(0)\n"
|
|
||||||
" {\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags(BitType bit)\n"
|
|
||||||
" : m_mask(static_cast<MaskType>(bit))\n"
|
|
||||||
" {\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags(Flags<BitType> const& rhs)\n"
|
|
||||||
" : m_mask(rhs.m_mask)\n"
|
|
||||||
" {\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags<BitType> & operator=(Flags<BitType> const& rhs)\n"
|
|
||||||
" {\n"
|
|
||||||
" m_mask = rhs.m_mask;\n"
|
|
||||||
" return *this;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags<BitType> & operator|=(Flags<BitType> const& rhs)\n"
|
|
||||||
" {\n"
|
|
||||||
" m_mask |= rhs.m_mask;\n"
|
|
||||||
" return *this;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags<BitType> & operator&=(Flags<BitType> const& rhs)\n"
|
|
||||||
" {\n"
|
|
||||||
" m_mask &= rhs.m_mask;\n"
|
|
||||||
" return *this;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags<BitType> & operator^=(Flags<BitType> const& rhs)\n"
|
|
||||||
" {\n"
|
|
||||||
" m_mask ^= rhs.m_mask;\n"
|
|
||||||
" return *this;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags<BitType> operator|(Flags<BitType> const& rhs) const\n"
|
|
||||||
" {\n"
|
|
||||||
" Flags<BitType> result(*this);\n"
|
|
||||||
" result |= rhs;\n"
|
|
||||||
" return result;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags<BitType> operator&(Flags<BitType> const& rhs) const\n"
|
|
||||||
" {\n"
|
|
||||||
" Flags<BitType> result(*this);\n"
|
|
||||||
" result &= rhs;\n"
|
|
||||||
" return result;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags<BitType> operator^(Flags<BitType> const& rhs) const\n"
|
|
||||||
" {\n"
|
|
||||||
" Flags<BitType> result(*this);\n"
|
|
||||||
" result ^= rhs;\n"
|
|
||||||
" return result;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" bool operator!() const\n"
|
|
||||||
" {\n"
|
|
||||||
" return !m_mask;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" Flags<BitType> operator~() const\n"
|
|
||||||
" {\n"
|
|
||||||
" Flags<BitType> result(*this);\n"
|
|
||||||
" result.m_mask ^= FlagTraits<BitType>::allFlags;\n"
|
|
||||||
" return result;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" bool operator==(Flags<BitType> const& rhs) const\n"
|
|
||||||
" {\n"
|
|
||||||
" return m_mask == rhs.m_mask;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" bool operator!=(Flags<BitType> const& rhs) const\n"
|
|
||||||
" {\n"
|
|
||||||
" return m_mask != rhs.m_mask;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" explicit operator bool() const\n"
|
|
||||||
" {\n"
|
|
||||||
" return !!m_mask;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" explicit operator MaskType() const\n"
|
|
||||||
" {\n"
|
|
||||||
" return m_mask;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" private:\n"
|
|
||||||
" MaskType m_mask;\n"
|
|
||||||
" };\n"
|
|
||||||
" \n"
|
|
||||||
" template <typename BitType>\n"
|
|
||||||
" Flags<BitType> operator|(BitType bit, Flags<BitType> const& flags)\n"
|
|
||||||
" {\n"
|
|
||||||
" return flags | bit;\n"
|
|
||||||
" }\n"
|
|
||||||
" \n"
|
|
||||||
" template <typename BitType>\n"
|
|
||||||
" Flags<BitType> operator&(BitType bit, Flags<BitType> const& flags)\n"
|
|
||||||
" {\n"
|
|
||||||
" return flags & bit;\n"
|
|
||||||
" }\n"
|
|
||||||
" \n"
|
|
||||||
" template <typename BitType>\n"
|
|
||||||
" Flags<BitType> operator^(BitType bit, Flags<BitType> const& flags)\n"
|
|
||||||
" {\n"
|
|
||||||
" return flags ^ bit;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
std::string const optionalClassHeader = R"(
|
VULKAN_HPP_INLINE const std::error_category& errorCategory()
|
||||||
|
{
|
||||||
|
static ErrorCategoryImpl instance;
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
VULKAN_HPP_INLINE std::error_code make_error_code(Result e)
|
||||||
|
{
|
||||||
|
return std::error_code(static_cast<int>(e), errorCategory());
|
||||||
|
}
|
||||||
|
|
||||||
|
VULKAN_HPP_INLINE std::error_condition make_error_condition(Result e)
|
||||||
|
{
|
||||||
|
return std::error_condition(static_cast<int>(e), errorCategory());
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
|
||||||
|
const std::string exceptionClassesHeader = R"(
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER == 1800)
|
||||||
|
# define noexcept _NOEXCEPT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class Error
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~Error() = default;
|
||||||
|
|
||||||
|
virtual const char* what() const noexcept = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LogicError : public Error, public std::logic_error
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit LogicError( const std::string& what )
|
||||||
|
: Error(), std::logic_error(what) {}
|
||||||
|
explicit LogicError( char const * what )
|
||||||
|
: Error(), std::logic_error(what) {}
|
||||||
|
virtual ~LogicError() = default;
|
||||||
|
|
||||||
|
virtual const char* what() const noexcept { return std::logic_error::what(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
class SystemError : public Error, public std::system_error
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SystemError( std::error_code ec )
|
||||||
|
: Error(), std::system_error(ec) {}
|
||||||
|
SystemError( std::error_code ec, std::string const& what )
|
||||||
|
: Error(), std::system_error(ec, what) {}
|
||||||
|
SystemError( std::error_code ec, char const * what )
|
||||||
|
: Error(), std::system_error(ec, what) {}
|
||||||
|
SystemError( int ev, std::error_category const& ecat )
|
||||||
|
: Error(), std::system_error(ev, ecat) {}
|
||||||
|
SystemError( int ev, std::error_category const& ecat, std::string const& what)
|
||||||
|
: Error(), std::system_error(ev, ecat, what) {}
|
||||||
|
SystemError( int ev, std::error_category const& ecat, char const * what)
|
||||||
|
: Error(), std::system_error(ev, ecat, what) {}
|
||||||
|
virtual ~SystemError() = default;
|
||||||
|
|
||||||
|
virtual const char* what() const noexcept { return std::system_error::what(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER == 1800)
|
||||||
|
# undef noexcept
|
||||||
|
#endif
|
||||||
|
|
||||||
|
)";
|
||||||
|
|
||||||
|
const std::string flagsHeader = R"(
|
||||||
|
template <typename FlagBitsType> struct FlagTraits
|
||||||
|
{
|
||||||
|
enum { allFlags = 0 };
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename BitType, typename MaskType = VkFlags>
|
||||||
|
class Flags
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Flags()
|
||||||
|
: m_mask(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags(BitType bit)
|
||||||
|
: m_mask(static_cast<MaskType>(bit))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags(Flags<BitType> const& rhs)
|
||||||
|
: m_mask(rhs.m_mask)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags<BitType> & operator=(Flags<BitType> const& rhs)
|
||||||
|
{
|
||||||
|
m_mask = rhs.m_mask;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags<BitType> & operator|=(Flags<BitType> const& rhs)
|
||||||
|
{
|
||||||
|
m_mask |= rhs.m_mask;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags<BitType> & operator&=(Flags<BitType> const& rhs)
|
||||||
|
{
|
||||||
|
m_mask &= rhs.m_mask;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags<BitType> & operator^=(Flags<BitType> const& rhs)
|
||||||
|
{
|
||||||
|
m_mask ^= rhs.m_mask;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags<BitType> operator|(Flags<BitType> const& rhs) const
|
||||||
|
{
|
||||||
|
Flags<BitType> result(*this);
|
||||||
|
result |= rhs;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags<BitType> operator&(Flags<BitType> const& rhs) const
|
||||||
|
{
|
||||||
|
Flags<BitType> result(*this);
|
||||||
|
result &= rhs;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags<BitType> operator^(Flags<BitType> const& rhs) const
|
||||||
|
{
|
||||||
|
Flags<BitType> result(*this);
|
||||||
|
result ^= rhs;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!() const
|
||||||
|
{
|
||||||
|
return !m_mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
Flags<BitType> operator~() const
|
||||||
|
{
|
||||||
|
Flags<BitType> result(*this);
|
||||||
|
result.m_mask ^= FlagTraits<BitType>::allFlags;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(Flags<BitType> const& rhs) const
|
||||||
|
{
|
||||||
|
return m_mask == rhs.m_mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!=(Flags<BitType> const& rhs) const
|
||||||
|
{
|
||||||
|
return m_mask != rhs.m_mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
explicit operator bool() const
|
||||||
|
{
|
||||||
|
return !!m_mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
explicit operator MaskType() const
|
||||||
|
{
|
||||||
|
return m_mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
MaskType m_mask;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename BitType>
|
||||||
|
Flags<BitType> operator|(BitType bit, Flags<BitType> const& flags)
|
||||||
|
{
|
||||||
|
return flags | bit;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename BitType>
|
||||||
|
Flags<BitType> operator&(BitType bit, Flags<BitType> const& flags)
|
||||||
|
{
|
||||||
|
return flags & bit;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename BitType>
|
||||||
|
Flags<BitType> operator^(BitType bit, Flags<BitType> const& flags)
|
||||||
|
{
|
||||||
|
return flags ^ bit;
|
||||||
|
}
|
||||||
|
|
||||||
|
)";
|
||||||
|
|
||||||
|
const std::string optionalClassHeader = R"(
|
||||||
template <typename RefType>
|
template <typename RefType>
|
||||||
class Optional
|
class Optional
|
||||||
{
|
{
|
||||||
@ -255,105 +254,103 @@ std::string const optionalClassHeader = R"(
|
|||||||
private:
|
private:
|
||||||
RefType *m_ptr;
|
RefType *m_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
)";
|
)";
|
||||||
|
|
||||||
std::string const arrayProxyHeader = (
|
const std::string arrayProxyHeader = R"(
|
||||||
"#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE\n"
|
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
|
||||||
" template <typename T>\n"
|
template <typename T>
|
||||||
" class ArrayProxy\n"
|
class ArrayProxy
|
||||||
" {\n"
|
{
|
||||||
" public:\n"
|
public:
|
||||||
" ArrayProxy(std::nullptr_t)\n"
|
ArrayProxy(std::nullptr_t)
|
||||||
" : m_count(0)\n"
|
: m_count(0)
|
||||||
" , m_ptr(nullptr)\n"
|
, m_ptr(nullptr)
|
||||||
" {}\n"
|
{}
|
||||||
"\n"
|
|
||||||
" ArrayProxy(T & ptr)\n"
|
|
||||||
" : m_count(1)\n"
|
|
||||||
" , m_ptr(&ptr)\n"
|
|
||||||
" {}\n"
|
|
||||||
"\n"
|
|
||||||
" ArrayProxy(uint32_t count, T * ptr)\n"
|
|
||||||
" : m_count(count)\n"
|
|
||||||
" , m_ptr(ptr)\n"
|
|
||||||
" {}\n"
|
|
||||||
"\n"
|
|
||||||
" template <size_t N>\n"
|
|
||||||
" ArrayProxy(std::array<typename std::remove_const<T>::type, N> & data)\n"
|
|
||||||
" : m_count(N)\n"
|
|
||||||
" , m_ptr(data.data())\n"
|
|
||||||
" {}\n"
|
|
||||||
"\n"
|
|
||||||
" template <size_t N>\n"
|
|
||||||
" ArrayProxy(std::array<typename std::remove_const<T>::type, N> const& data)\n"
|
|
||||||
" : m_count(N)\n"
|
|
||||||
" , m_ptr(data.data())\n"
|
|
||||||
" {}\n"
|
|
||||||
"\n"
|
|
||||||
" template <class Allocator = std::allocator<typename std::remove_const<T>::type>>\n"
|
|
||||||
" ArrayProxy(std::vector<typename std::remove_const<T>::type, Allocator> & data)\n"
|
|
||||||
" : m_count(static_cast<uint32_t>(data.size()))\n"
|
|
||||||
" , m_ptr(data.data())\n"
|
|
||||||
" {}\n"
|
|
||||||
"\n"
|
|
||||||
" template <class Allocator = std::allocator<typename std::remove_const<T>::type>>\n"
|
|
||||||
" ArrayProxy(std::vector<typename std::remove_const<T>::type, Allocator> const& data)\n"
|
|
||||||
" : m_count(static_cast<uint32_t>(data.size()))\n"
|
|
||||||
" , m_ptr(data.data())\n"
|
|
||||||
" {}\n"
|
|
||||||
"\n"
|
|
||||||
" ArrayProxy(std::initializer_list<T> const& data)\n"
|
|
||||||
" : m_count(static_cast<uint32_t>(data.end() - data.begin()))\n"
|
|
||||||
" , m_ptr(data.begin())\n"
|
|
||||||
" {}\n"
|
|
||||||
"\n"
|
|
||||||
" const T * begin() const\n"
|
|
||||||
" {\n"
|
|
||||||
" return m_ptr;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" const T * end() const\n"
|
|
||||||
" {\n"
|
|
||||||
" return m_ptr + m_count;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" const T & front() const\n"
|
|
||||||
" {\n"
|
|
||||||
" assert(m_count && m_ptr);\n"
|
|
||||||
" return *m_ptr;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" const T & back() const\n"
|
|
||||||
" {\n"
|
|
||||||
" assert(m_count && m_ptr);\n"
|
|
||||||
" return *(m_ptr + m_count - 1);\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" bool empty() const\n"
|
|
||||||
" {\n"
|
|
||||||
" return (m_count == 0);\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" uint32_t size() const\n"
|
|
||||||
" {\n"
|
|
||||||
" return m_count;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" T * data() const\n"
|
|
||||||
" {\n"
|
|
||||||
" return m_ptr;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" private:\n"
|
|
||||||
" uint32_t m_count;\n"
|
|
||||||
" T * m_ptr;\n"
|
|
||||||
" };\n"
|
|
||||||
"#endif\n"
|
|
||||||
"\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
std::string const versionCheckHeader = { R"(
|
ArrayProxy(T & ptr)
|
||||||
|
: m_count(1)
|
||||||
|
, m_ptr(&ptr)
|
||||||
|
{}
|
||||||
|
|
||||||
|
ArrayProxy(uint32_t count, T * ptr)
|
||||||
|
: m_count(count)
|
||||||
|
, m_ptr(ptr)
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <size_t N>
|
||||||
|
ArrayProxy(std::array<typename std::remove_const<T>::type, N> & data)
|
||||||
|
: m_count(N)
|
||||||
|
, m_ptr(data.data())
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <size_t N>
|
||||||
|
ArrayProxy(std::array<typename std::remove_const<T>::type, N> const& data)
|
||||||
|
: m_count(N)
|
||||||
|
, m_ptr(data.data())
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <class Allocator = std::allocator<typename std::remove_const<T>::type>>
|
||||||
|
ArrayProxy(std::vector<typename std::remove_const<T>::type, Allocator> & data)
|
||||||
|
: m_count(static_cast<uint32_t>(data.size()))
|
||||||
|
, m_ptr(data.data())
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <class Allocator = std::allocator<typename std::remove_const<T>::type>>
|
||||||
|
ArrayProxy(std::vector<typename std::remove_const<T>::type, Allocator> const& data)
|
||||||
|
: m_count(static_cast<uint32_t>(data.size()))
|
||||||
|
, m_ptr(data.data())
|
||||||
|
{}
|
||||||
|
|
||||||
|
ArrayProxy(std::initializer_list<T> const& data)
|
||||||
|
: m_count(static_cast<uint32_t>(data.end() - data.begin()))
|
||||||
|
, m_ptr(data.begin())
|
||||||
|
{}
|
||||||
|
|
||||||
|
const T * begin() const
|
||||||
|
{
|
||||||
|
return m_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
const T * end() const
|
||||||
|
{
|
||||||
|
return m_ptr + m_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
const T & front() const
|
||||||
|
{
|
||||||
|
assert(m_count && m_ptr);
|
||||||
|
return *m_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
const T & back() const
|
||||||
|
{
|
||||||
|
assert(m_count && m_ptr);
|
||||||
|
return *(m_ptr + m_count - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool empty() const
|
||||||
|
{
|
||||||
|
return (m_count == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t size() const
|
||||||
|
{
|
||||||
|
return m_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
T * data() const
|
||||||
|
{
|
||||||
|
return m_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint32_t m_count;
|
||||||
|
T * m_ptr;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
)";
|
||||||
|
|
||||||
|
const std::string versionCheckHeader = R"(
|
||||||
#if !defined(VULKAN_HPP_HAS_UNRESTRICTED_UNIONS)
|
#if !defined(VULKAN_HPP_HAS_UNRESTRICTED_UNIONS)
|
||||||
# if defined(__clang__)
|
# if defined(__clang__)
|
||||||
# if __has_feature(cxx_unrestricted_unions)
|
# if __has_feature(cxx_unrestricted_unions)
|
||||||
@ -370,10 +367,9 @@ std::string const versionCheckHeader = { R"(
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
)"
|
)";
|
||||||
};
|
|
||||||
|
|
||||||
std::string const inlineHeader = {R"(
|
const std::string inlineHeader = R"(
|
||||||
#if !defined(VULKAN_HPP_INLINE)
|
#if !defined(VULKAN_HPP_INLINE)
|
||||||
# if defined(__clang___)
|
# if defined(__clang___)
|
||||||
# if __has_attribute(always_inline)
|
# if __has_attribute(always_inline)
|
||||||
@ -389,114 +385,111 @@ std::string const inlineHeader = {R"(
|
|||||||
# define VULKAN_HPP_INLINE inline
|
# define VULKAN_HPP_INLINE inline
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
)"
|
)";
|
||||||
};
|
|
||||||
|
|
||||||
std::string const explicitHeader = { R"(
|
const std::string explicitHeader = R"(
|
||||||
#if defined(VULKAN_HPP_TYPESAFE_CONVERSION)
|
#if defined(VULKAN_HPP_TYPESAFE_CONVERSION)
|
||||||
# define VULKAN_HPP_TYPESAFE_EXPLICIT
|
# define VULKAN_HPP_TYPESAFE_EXPLICIT
|
||||||
#else
|
#else
|
||||||
# define VULKAN_HPP_TYPESAFE_EXPLICIT explicit
|
# define VULKAN_HPP_TYPESAFE_EXPLICIT explicit
|
||||||
#endif
|
#endif
|
||||||
)"
|
)";
|
||||||
};
|
|
||||||
|
|
||||||
std::string const resultValueHeader = (
|
const std::string resultValueHeader = R"(
|
||||||
" template <typename T>\n"
|
template <typename T>
|
||||||
" struct ResultValue\n"
|
struct ResultValue
|
||||||
" {\n"
|
{
|
||||||
" ResultValue( Result r, T & v )\n"
|
ResultValue( Result r, T & v )
|
||||||
" : result( r )\n"
|
: result( r )
|
||||||
" , value( v )\n"
|
, value( v )
|
||||||
" {}\n"
|
{}
|
||||||
"\n"
|
|
||||||
" Result result;\n"
|
|
||||||
" T value;\n"
|
|
||||||
"\n"
|
|
||||||
" operator std::tuple<Result&, T&>() { return std::tuple<Result&, T&>(result, value); }\n"
|
|
||||||
" };\n"
|
|
||||||
"\n"
|
|
||||||
" template <typename T>\n"
|
|
||||||
" struct ResultValueType\n"
|
|
||||||
" {\n"
|
|
||||||
"#ifdef VULKAN_HPP_NO_EXCEPTIONS\n"
|
|
||||||
" typedef ResultValue<T> type;\n"
|
|
||||||
"#else\n"
|
|
||||||
" typedef T type;\n"
|
|
||||||
"#endif\n"
|
|
||||||
" };\n"
|
|
||||||
"\n"
|
|
||||||
" template <>"
|
|
||||||
" struct ResultValueType<void>\n"
|
|
||||||
" {\n"
|
|
||||||
"#ifdef VULKAN_HPP_NO_EXCEPTIONS\n"
|
|
||||||
" typedef Result type;\n"
|
|
||||||
"#else\n"
|
|
||||||
" typedef void type;\n"
|
|
||||||
"#endif\n"
|
|
||||||
" };\n"
|
|
||||||
"\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
std::string const createResultValueHeader = (
|
Result result;
|
||||||
" VULKAN_HPP_INLINE ResultValueType<void>::type createResultValue( Result result, char const * message )\n"
|
T value;
|
||||||
" {\n"
|
|
||||||
"#ifdef VULKAN_HPP_NO_EXCEPTIONS\n"
|
|
||||||
" assert( result == Result::eSuccess );\n"
|
|
||||||
" return result;\n"
|
|
||||||
"#else\n"
|
|
||||||
" if ( result != Result::eSuccess )\n"
|
|
||||||
" {\n"
|
|
||||||
" throwResultException( result, message );\n"
|
|
||||||
" }\n"
|
|
||||||
"#endif\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" template <typename T>\n"
|
|
||||||
" VULKAN_HPP_INLINE typename ResultValueType<T>::type createResultValue( Result result, T & data, char const * message )\n"
|
|
||||||
" {\n"
|
|
||||||
"#ifdef VULKAN_HPP_NO_EXCEPTIONS\n"
|
|
||||||
" assert( result == Result::eSuccess );\n"
|
|
||||||
" return ResultValue<T>( result, data );\n"
|
|
||||||
"#else\n"
|
|
||||||
" if ( result != Result::eSuccess )\n"
|
|
||||||
" {\n"
|
|
||||||
" throwResultException( result, message );\n"
|
|
||||||
" }\n"
|
|
||||||
" return data;\n"
|
|
||||||
"#endif\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" VULKAN_HPP_INLINE Result createResultValue( Result result, char const * message, std::initializer_list<Result> successCodes )\n"
|
|
||||||
" {\n"
|
|
||||||
"#ifdef VULKAN_HPP_NO_EXCEPTIONS\n"
|
|
||||||
" assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );\n"
|
|
||||||
"#else\n"
|
|
||||||
" if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )\n"
|
|
||||||
" {\n"
|
|
||||||
" throwResultException( result, message );\n"
|
|
||||||
" }\n"
|
|
||||||
"#endif\n"
|
|
||||||
" return result;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" template <typename T>\n"
|
|
||||||
" VULKAN_HPP_INLINE ResultValue<T> createResultValue( Result result, T & data, char const * message, std::initializer_list<Result> successCodes )\n"
|
|
||||||
" {\n"
|
|
||||||
"#ifdef VULKAN_HPP_NO_EXCEPTIONS\n"
|
|
||||||
" assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );\n"
|
|
||||||
"#else\n"
|
|
||||||
" if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )\n"
|
|
||||||
" {\n"
|
|
||||||
" throwResultException( result, message );\n"
|
|
||||||
" }\n"
|
|
||||||
"#endif\n"
|
|
||||||
" return ResultValue<T>( result, data );\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
std::string const uniqueHandleHeader = { R"(
|
operator std::tuple<Result&, T&>() { return std::tuple<Result&, T&>(result, value); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct ResultValueType
|
||||||
|
{
|
||||||
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
|
typedef ResultValue<T> type;
|
||||||
|
#else
|
||||||
|
typedef T type;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct ResultValueType<void>
|
||||||
|
{
|
||||||
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
|
typedef Result type;
|
||||||
|
#else
|
||||||
|
typedef void type;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
)";
|
||||||
|
|
||||||
|
const std::string createResultValueHeader = R"(
|
||||||
|
VULKAN_HPP_INLINE ResultValueType<void>::type createResultValue( Result result, char const * message )
|
||||||
|
{
|
||||||
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
|
assert( result == Result::eSuccess );
|
||||||
|
return result;
|
||||||
|
#else
|
||||||
|
if ( result != Result::eSuccess )
|
||||||
|
{
|
||||||
|
throwResultException( result, message );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
VULKAN_HPP_INLINE typename ResultValueType<T>::type createResultValue( Result result, T & data, char const * message )
|
||||||
|
{
|
||||||
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
|
assert( result == Result::eSuccess );
|
||||||
|
return ResultValue<T>( result, data );
|
||||||
|
#else
|
||||||
|
if ( result != Result::eSuccess )
|
||||||
|
{
|
||||||
|
throwResultException( result, message );
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
VULKAN_HPP_INLINE Result createResultValue( Result result, char const * message, std::initializer_list<Result> successCodes )
|
||||||
|
{
|
||||||
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
|
assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
|
||||||
|
#else
|
||||||
|
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
|
||||||
|
{
|
||||||
|
throwResultException( result, message );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
VULKAN_HPP_INLINE ResultValue<T> createResultValue( Result result, T & data, char const * message, std::initializer_list<Result> successCodes )
|
||||||
|
{
|
||||||
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
|
assert( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
|
||||||
|
#else
|
||||||
|
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
|
||||||
|
{
|
||||||
|
throwResultException( result, message );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return ResultValue<T>( result, data );
|
||||||
|
}
|
||||||
|
|
||||||
|
)";
|
||||||
|
|
||||||
|
const std::string uniqueHandleHeader = R"(
|
||||||
#if defined(VULKAN_HPP_NO_EXCEPTIONS) && !defined(VULKAN_HPP_NO_SMART_HANDLE)
|
#if defined(VULKAN_HPP_NO_EXCEPTIONS) && !defined(VULKAN_HPP_NO_SMART_HANDLE)
|
||||||
# define VULKAN_HPP_NO_SMART_HANDLE
|
# define VULKAN_HPP_NO_SMART_HANDLE
|
||||||
#endif
|
#endif
|
||||||
@ -605,8 +598,7 @@ std::string const uniqueHandleHeader = { R"(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
)"
|
)";
|
||||||
};
|
|
||||||
|
|
||||||
struct ParamData
|
struct ParamData
|
||||||
{
|
{
|
||||||
@ -3621,7 +3613,7 @@ void writeTypeHandle(std::ofstream & ofs, VkData const& vkData, DependencyData c
|
|||||||
<< " m_" << memberName << " = " << memberName << ";" << std::endl
|
<< " m_" << memberName << " = " << memberName << ";" << std::endl
|
||||||
<< " return *this;" << std::endl
|
<< " return *this;" << std::endl
|
||||||
<< " }" << std::endl
|
<< " }" << std::endl
|
||||||
<< "#endif\n"
|
<< "#endif" << std::endl
|
||||||
<< std::endl
|
<< std::endl
|
||||||
// assignment from std::nullptr_t
|
// assignment from std::nullptr_t
|
||||||
<< " " << dependencyData.name << "& operator=( std::nullptr_t )" << std::endl
|
<< " " << dependencyData.name << "& operator=( std::nullptr_t )" << std::endl
|
||||||
|
@ -93,6 +93,7 @@ static_assert( VK_HEADER_VERSION == 46 , "Wrong VK_HEADER_VERSION!" );
|
|||||||
|
|
||||||
namespace vk
|
namespace vk
|
||||||
{
|
{
|
||||||
|
|
||||||
template <typename FlagBitsType> struct FlagTraits
|
template <typename FlagBitsType> struct FlagTraits
|
||||||
{
|
{
|
||||||
enum { allFlags = 0 };
|
enum { allFlags = 0 };
|
||||||
@ -325,7 +326,6 @@ namespace vk
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(VULKAN_HPP_NO_EXCEPTIONS) && !defined(VULKAN_HPP_NO_SMART_HANDLE)
|
#if defined(VULKAN_HPP_NO_EXCEPTIONS) && !defined(VULKAN_HPP_NO_SMART_HANDLE)
|
||||||
# define VULKAN_HPP_NO_SMART_HANDLE
|
# define VULKAN_HPP_NO_SMART_HANDLE
|
||||||
#endif
|
#endif
|
||||||
@ -500,6 +500,7 @@ namespace vk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER == 1800)
|
#if defined(_MSC_VER) && (_MSC_VER == 1800)
|
||||||
# define noexcept _NOEXCEPT
|
# define noexcept _NOEXCEPT
|
||||||
#endif
|
#endif
|
||||||
@ -800,6 +801,7 @@ namespace std
|
|||||||
|
|
||||||
namespace vk
|
namespace vk
|
||||||
{
|
{
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct ResultValue
|
struct ResultValue
|
||||||
{
|
{
|
||||||
@ -824,7 +826,8 @@ namespace vk
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct ResultValueType<void>
|
template <>
|
||||||
|
struct ResultValueType<void>
|
||||||
{
|
{
|
||||||
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
typedef Result type;
|
typedef Result type;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user