Update to Vulkan 1.1.85. (#258)
This commit is contained in:
committed by
Markus Tavenrath
parent
295d5c755f
commit
127de1bf93
@@ -375,30 +375,30 @@ const std::string structureChainHeader = R"(
|
||||
|
||||
template <typename X, typename Y> struct isStructureChainValid { enum { value = false }; };
|
||||
|
||||
template <typename P, typename T>
|
||||
struct TypeList
|
||||
{
|
||||
using list = P;
|
||||
using last = T;
|
||||
};
|
||||
|
||||
template <typename List, typename X>
|
||||
struct extendCheck
|
||||
{
|
||||
static const bool valid = isStructureChainValid<typename List::last, X>::value || extendCheck<typename List::list,X>::valid;
|
||||
};
|
||||
|
||||
template <typename T, typename X>
|
||||
struct extendCheck<TypeList<void,T>,X>
|
||||
{
|
||||
static const bool valid = isStructureChainValid<T, X>::value;
|
||||
};
|
||||
|
||||
template <typename X>
|
||||
struct extendCheck<void,X>
|
||||
{
|
||||
static const bool valid = true;
|
||||
};
|
||||
template <typename P, typename T>
|
||||
struct TypeList
|
||||
{
|
||||
using list = P;
|
||||
using last = T;
|
||||
};
|
||||
|
||||
template <typename List, typename X>
|
||||
struct extendCheck
|
||||
{
|
||||
static const bool valid = isStructureChainValid<typename List::last, X>::value || extendCheck<typename List::list,X>::valid;
|
||||
};
|
||||
|
||||
template <typename T, typename X>
|
||||
struct extendCheck<TypeList<void,T>,X>
|
||||
{
|
||||
static const bool valid = isStructureChainValid<T, X>::value;
|
||||
};
|
||||
|
||||
template <typename X>
|
||||
struct extendCheck<void,X>
|
||||
{
|
||||
static const bool valid = true;
|
||||
};
|
||||
|
||||
template <class Element>
|
||||
class StructureChainElement
|
||||
@@ -1531,18 +1531,22 @@ void VulkanHppGenerator::determineReturnParam(CommandData & commandData)
|
||||
{
|
||||
if ((commandData.params[i].type.find('*') != std::string::npos)
|
||||
&& (commandData.params[i].type.find("const") == std::string::npos)
|
||||
&& std::find_if(commandData.vectorParams.begin(), commandData.vectorParams.end(), [i](std::pair<size_t, size_t> const& vp) { return vp.second == i; }) == commandData.vectorParams.end()
|
||||
&& ((commandData.vectorParams.find(i) == commandData.vectorParams.end()) || commandData.twoStep || (commandData.successCodes.size() == 1)))
|
||||
&& std::find_if(commandData.vectorParams.begin(), commandData.vectorParams.end(), [i](std::pair<size_t, size_t> const& vp) { return vp.second == i; }) == commandData.vectorParams.end())
|
||||
{
|
||||
// it's a non-const pointer, not a vector-size parameter, if it's a vector parameter, its a two-step process or there's just one success code
|
||||
// -> look for another non-cost pointer argument
|
||||
auto paramIt = std::find_if(commandData.params.begin() + i + 1, commandData.params.end(), [](ParamData const& pd)
|
||||
// it's a non-const pointer and not a vector-size parameter
|
||||
std::map<size_t, size_t>::const_iterator vpit = commandData.vectorParams.find(i);
|
||||
if ((vpit == commandData.vectorParams.end()) || commandData.twoStep || (commandData.vectorParams.size() > 1) || (vpit->second == size_t(~0)) || (commandData.params[vpit->second].type.find('*') != std::string::npos))
|
||||
{
|
||||
return (pd.type.find('*') != std::string::npos) && (pd.type.find("const") == std::string::npos);
|
||||
});
|
||||
// if there is another such argument, we can't decide which one to return -> return none (~0)
|
||||
// otherwise return the index of the selcted parameter
|
||||
commandData.returnParam = paramIt != commandData.params.end() ? ~0 : i;
|
||||
// it's not a vector parameter, or a two-step process, or there is at least one more vector parameter, or the size argument of this vector parameter is not an argument, or the size argument of this vector parameter is provided by a pointer
|
||||
// -> look for another non-cost pointer argument
|
||||
auto paramIt = std::find_if(commandData.params.begin() + i + 1, commandData.params.end(), [](ParamData const& pd)
|
||||
{
|
||||
return (pd.type.find('*') != std::string::npos) && (pd.type.find("const") == std::string::npos);
|
||||
});
|
||||
// if there is another such argument, we can't decide which one to return -> return none (~0)
|
||||
// otherwise return the index of the selcted parameter
|
||||
commandData.returnParam = paramIt != commandData.params.end() ? ~0 : i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user