Update to Vulkan 1.1.85. (#258)

This commit is contained in:
Andreas Süßenbach 2018-09-25 10:46:26 +02:00 committed by Markus Tavenrath
parent 295d5c755f
commit 127de1bf93
5 changed files with 3906 additions and 57 deletions

@ -1 +1 @@
Subproject commit dd9919749a56177c2eb9b6525c0979722a3c24ff Subproject commit 9858c1e89e21246f779226d2be779fd33bb6a50d

View File

@ -1531,10 +1531,13 @@ 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
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))
{
// 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 // -> look for another non-cost pointer argument
auto paramIt = std::find_if(commandData.params.begin() + i + 1, commandData.params.end(), [](ParamData const& pd) auto paramIt = std::find_if(commandData.params.begin() + i + 1, commandData.params.end(), [](ParamData const& pd)
{ {
@ -1547,6 +1550,7 @@ void VulkanHppGenerator::determineReturnParam(CommandData & commandData)
} }
} }
} }
}
void VulkanHppGenerator::determineSkippedParams(CommandData & commandData) void VulkanHppGenerator::determineSkippedParams(CommandData & commandData)
{ {

View 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")

View 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;
}

File diff suppressed because it is too large Load Diff