+* vk::Result return values have been replaced by exceptions.
+* Functions with a single output value do return this value instead
+Here are a few code examples:
- uint32_t count;
- VK_VERIFY(vk::enumerateDeviceExtensionProperties(physicalDevice, layerName.c_str(), &count, nullptr));
+ try {
+ vk::Instance i = ...;
+ std::vector physicalDevices = i.enumeratePhysicalDevices();
+ vk::FormatProperties formatProperties = physicalDevices[0].getFormatProperties(vk::Format::eR8G8B8A8Unorm);
- std::vector properties(count);
- VK_VERIFY(vk::enumerateDeviceExtensionProperties(physicalDevice, layerName.c_str(), &count, properties.data()));
+ vk::CommandBuffer commandBuffer = ...;
+ vk::Buffer buffer = ...;
+ commandBuffer.updateBuffer(buffer, 0, {some values}); // update buffer with std::vector
+ }
+ catch (vk::Exception e)
+ {
+ std::cerr << "Vulkan failure: " << e.what() << std::endl;
+ }
-Luckily the official Khronos-provided vk.xml has enough information to figure out which pair of values represents a sized array or strings, so that it is possible to generate a function which allows you to write the following line of code instead:
-
-
-
- std::vector<ExtensionProperties> properties = vk::enumerateDeviceExtensionProperties(physicalDevice, layerName);
-
-
-
# Usage
To start with the C++ version of the Vulkan API download header from GIT, put it in a vulkan subdirectory and add
#include <vulkan/vk_cpp.h>
to your source code.
@@ -195,3 +194,14 @@ before this line:
* Update submodules: git submodule update --init --recursive
* Use CMake to generate a solution or makefile for your favourite build environment
* Launch the build
+
+# Providing Pull Requests
+
+NVIDIA is happy to review and consider pull requests for merging into the main tree of vkcpp for bug fixes and features. Before providing a pull request to NVIDIA, please note the following:
+
+* A pull request provided to this repo by a developer constitutes permission from the developer for NVIDIA to merge the provided
+ changes or any NVIDIA modified version of these changes to the repo. NVIDIA may remove or change the code at any time and in any
+ way deemed appropriate. Due to the required paperwork please refrain from providing pull requests for simple changes and file an issue
+ describing a bug or the desired change instead.
+* Not all pull requests can be or will be accepted. NVIDIA will close pull requests that it does not intend to merge.
+* The modified files and any new files must include the unmodified NVIDIA copyright header seen at the top of all shipping files.
\ No newline at end of file