mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Update to Vulkan 1.0.50
* The naming scheme from the Vulkan spec would Ycbcr for YCBCR in enums, but is using YCbCr for structs which are linked to those enums. Introduce a replacement vector to address this issue.
This commit is contained in:
parent
8f21dfa0f5
commit
9b74c8ccae
@ -1 +1 @@
|
|||||||
Subproject commit 757a1232e6541db17585d1f59a17dfdaa272c100
|
Subproject commit 31018cf088c921ab90ec69dee033875807e8faec
|
@ -24,6 +24,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <tuple>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
@ -457,7 +458,7 @@ const std::string createResultValueHeader = R"(
|
|||||||
if ( result != Result::eSuccess )
|
if ( result != Result::eSuccess )
|
||||||
{
|
{
|
||||||
throwResultException( result, message );
|
throwResultException( result, message );
|
||||||
}
|
20
|
||||||
return data;
|
return data;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -602,7 +603,7 @@ const std::string uniqueHandleHeader = R"(
|
|||||||
|
|
||||||
)";
|
)";
|
||||||
|
|
||||||
std::string replaceWithMap(std::string const &input, std::map<std::string, std::string> replacements)
|
std::string replaceWithMap(std::string const &input, std::map<std::string, std::string> const &replacements)
|
||||||
{
|
{
|
||||||
// This will match ${someVariable} and contain someVariable in match group 1
|
// This will match ${someVariable} and contain someVariable in match group 1
|
||||||
std::regex re(R"(\$\{([^\}]+)\})");
|
std::regex re(R"(\$\{([^\}]+)\})");
|
||||||
@ -2055,6 +2056,11 @@ std::string stripPluralS(std::string const& name)
|
|||||||
|
|
||||||
std::string toCamelCase(std::string const& value)
|
std::string toCamelCase(std::string const& value)
|
||||||
{
|
{
|
||||||
|
static std::vector<std::tuple<std::string, std::string>> const replacements =
|
||||||
|
{
|
||||||
|
std::make_tuple( "Ycbcr", "YCbCr" )
|
||||||
|
};
|
||||||
|
|
||||||
assert(!value.empty() && (isupper(value[0]) || isdigit(value[0])));
|
assert(!value.empty() && (isupper(value[0]) || isdigit(value[0])));
|
||||||
std::string result;
|
std::string result;
|
||||||
result.reserve(value.size());
|
result.reserve(value.size());
|
||||||
@ -2073,6 +2079,17 @@ std::string toCamelCase(std::string const& value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The Vulkan spec is using YCBCR instead of Y_CB_CR. The first will generated Ycbcr while the Vulkan spec required YCbCr.
|
||||||
|
// Fix the issue with a simple replacement pattern.
|
||||||
|
for (auto it : replacements)
|
||||||
|
{
|
||||||
|
auto stringSize = std::get<0>(it).size();
|
||||||
|
for (auto itResult = result.find(std::get<0>(it)); itResult != std::string::npos; itResult = result.find(std::get<0>(it), itResult + stringSize))
|
||||||
|
{
|
||||||
|
result.replace(itResult, stringSize, std::get<1>(it));
|
||||||
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4778
vulkan/vulkan.hpp
4778
vulkan/vulkan.hpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user