mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Update to Vulkan 1.1.85. (#258)
This commit is contained in:
parent
295d5c755f
commit
127de1bf93
@ -1 +1 @@
|
|||||||
Subproject commit dd9919749a56177c2eb9b6525c0979722a3c24ff
|
Subproject commit 9858c1e89e21246f779226d2be779fd33bb6a50d
|
@ -375,30 +375,30 @@ const std::string structureChainHeader = R"(
|
|||||||
|
|
||||||
template <typename X, typename Y> struct isStructureChainValid { enum { value = false }; };
|
template <typename X, typename Y> struct isStructureChainValid { enum { value = false }; };
|
||||||
|
|
||||||
template <typename P, typename T>
|
template <typename P, typename T>
|
||||||
struct TypeList
|
struct TypeList
|
||||||
{
|
{
|
||||||
using list = P;
|
using list = P;
|
||||||
using last = T;
|
using last = T;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename List, typename X>
|
template <typename List, typename X>
|
||||||
struct extendCheck
|
struct extendCheck
|
||||||
{
|
{
|
||||||
static const bool valid = isStructureChainValid<typename List::last, X>::value || extendCheck<typename List::list,X>::valid;
|
static const bool valid = isStructureChainValid<typename List::last, X>::value || extendCheck<typename List::list,X>::valid;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, typename X>
|
template <typename T, typename X>
|
||||||
struct extendCheck<TypeList<void,T>,X>
|
struct extendCheck<TypeList<void,T>,X>
|
||||||
{
|
{
|
||||||
static const bool valid = isStructureChainValid<T, X>::value;
|
static const bool valid = isStructureChainValid<T, X>::value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename X>
|
template <typename X>
|
||||||
struct extendCheck<void,X>
|
struct extendCheck<void,X>
|
||||||
{
|
{
|
||||||
static const bool valid = true;
|
static const bool valid = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Element>
|
template <class Element>
|
||||||
class StructureChainElement
|
class StructureChainElement
|
||||||
@ -1531,18 +1531,22 @@ void VulkanHppGenerator::determineReturnParam(CommandData & commandData)
|
|||||||
{
|
{
|
||||||
if ((commandData.params[i].type.find('*') != std::string::npos)
|
if ((commandData.params[i].type.find('*') != std::string::npos)
|
||||||
&& (commandData.params[i].type.find("const") == 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()
|
&& 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)))
|
|
||||||
{
|
{
|
||||||
// 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
|
// it's a non-const pointer and not a vector-size parameter
|
||||||
// -> look for another non-cost pointer argument
|
std::map<size_t, size_t>::const_iterator vpit = commandData.vectorParams.find(i);
|
||||||
auto paramIt = std::find_if(commandData.params.begin() + i + 1, commandData.params.end(), [](ParamData const& pd)
|
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);
|
// 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
|
||||||
// if there is another such argument, we can't decide which one to return -> return none (~0)
|
auto paramIt = std::find_if(commandData.params.begin() + i + 1, commandData.params.end(), [](ParamData const& pd)
|
||||||
// otherwise return the index of the selcted parameter
|
{
|
||||||
commandData.returnParam = paramIt != commandData.params.end() ? ~0 : i;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
35
tests/DeviceFunctions/CMakeLists.txt
Normal file
35
tests/DeviceFunctions/CMakeLists.txt
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# Copyright(c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.2)
|
||||||
|
|
||||||
|
project(DeviceFunctions)
|
||||||
|
|
||||||
|
set(HEADERS
|
||||||
|
)
|
||||||
|
|
||||||
|
set(SOURCES
|
||||||
|
DeviceFunctions.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
source_group(headers FILES ${HEADERS})
|
||||||
|
source_group(sources FILES ${SOURCES})
|
||||||
|
|
||||||
|
add_executable(DeviceFunctions
|
||||||
|
${HEADERS}
|
||||||
|
${SOURCES}
|
||||||
|
)
|
||||||
|
|
||||||
|
set_target_properties(DeviceFunctions PROPERTIES FOLDER "Tests")
|
||||||
|
target_link_libraries(DeviceFunctions "$ENV{VK_SDK_PATH}/Lib/vulkan-1.lib")
|
62
tests/DeviceFunctions/DeviceFunctions.cpp
Normal file
62
tests/DeviceFunctions/DeviceFunctions.cpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// Copyright(c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//
|
||||||
|
// VulkanHpp Samples : DeviceFunctions
|
||||||
|
// Compile test on device functions
|
||||||
|
|
||||||
|
#include "vulkan/vulkan.hpp"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
static char const* AppName = "DeviceFunctions";
|
||||||
|
static char const* EngineName = "Vulkan.hpp";
|
||||||
|
|
||||||
|
int main(int /*argc*/, char * /*argv[]*/)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
vk::ApplicationInfo appInfo(AppName, 1, EngineName, 1, VK_API_VERSION_1_1);
|
||||||
|
vk::UniqueInstance instance = vk::createInstanceUnique(vk::InstanceCreateInfo({}, &appInfo));
|
||||||
|
std::vector<vk::PhysicalDevice> physicalDevices = instance->enumeratePhysicalDevices();
|
||||||
|
assert(!physicalDevices.empty());
|
||||||
|
|
||||||
|
// get the QueueFamilyProperties of the first PhysicalDevice
|
||||||
|
std::vector<vk::QueueFamilyProperties> queueFamilyProperties = physicalDevices[0].getQueueFamilyProperties();
|
||||||
|
|
||||||
|
// get the first index into queueFamiliyProperties which supports graphics
|
||||||
|
size_t graphicsQueueFamilyIndex = std::distance(queueFamilyProperties.begin(),
|
||||||
|
std::find_if(queueFamilyProperties.begin(),
|
||||||
|
queueFamilyProperties.end(),
|
||||||
|
[](vk::QueueFamilyProperties const& qfp) { return qfp.queueFlags & vk::QueueFlagBits::eGraphics; }));
|
||||||
|
assert(graphicsQueueFamilyIndex < queueFamilyProperties.size());
|
||||||
|
|
||||||
|
// create a UniqueDevice
|
||||||
|
float queuePriority = 0.0f;
|
||||||
|
vk::DeviceQueueCreateInfo deviceQueueCreateInfo(vk::DeviceQueueCreateFlags(), static_cast<uint32_t>(graphicsQueueFamilyIndex), 1, &queuePriority);
|
||||||
|
vk::UniqueDevice device = physicalDevices[0].createDeviceUnique(vk::DeviceCreateInfo(vk::DeviceCreateFlags(), 1, &deviceQueueCreateInfo));
|
||||||
|
|
||||||
|
std::vector<uint8_t> data;
|
||||||
|
device->getAccelerationStructureHandleNVX<uint8_t>({}, data, vk::DispatchLoaderDynamic());
|
||||||
|
}
|
||||||
|
catch (vk::SystemError err)
|
||||||
|
{
|
||||||
|
std::cout << "vk::SystemError: " << err.what() << std::endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cout << "unknown error\n";
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
3792
vulkan/vulkan.hpp
3792
vulkan/vulkan.hpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user