Fix some issues with sample code in readme.md.

This commit is contained in:
asuessenbach 2020-07-29 12:25:52 +02:00
parent 130a496c19
commit 503e6ce500

View File

@ -103,6 +103,7 @@ vk::ImageCreateInfo ci({}, vk::ImageType::e2D, vk::format::eR8G8B8A8Unorm,
1, 1, vk::SampleCount::e1, 1, 1, vk::SampleCount::e1,
vk::ImageTiling::eOptimal, vk::ImageUsage:eColorAttachment, vk::ImageTiling::eOptimal, vk::ImageUsage:eColorAttachment,
vk::SharingMode::eExclusive, 0, 0, vk::Imagelayout::eUndefined); vk::SharingMode::eExclusive, 0, 0, vk::Imagelayout::eUndefined);
vk::Image image = device.createImage(ci);
``` ```
With constructors for CreateInfo structures one can also pass temporaries to Vulkan functions like this: With constructors for CreateInfo structures one can also pass temporaries to Vulkan functions like this:
@ -187,14 +188,15 @@ Vulkan-Hpp generates references for pointers to structs. This conversion allows
```c++ ```c++
// C // C
ImageSubResource subResource; VkImageSubResource subResource;
subResource.aspectMask = 0; subResource.aspectMask = 0;
subResource.mipLevel = 0; subResource.mipLevel = 0;
subResource.arrayLayer = 0; subResource.arrayLayer = 0;
vkSubresourceLayout layout = vkGetImageSubResourceLayout(image, subresource); VkSubresourceLayout layout;
vkGetImageSubresourceLayout(device, image, &subresource, &layout);
// C++ // C++
auto layout = device.getImageSubResourceLayout(image, { {} /* flags*/, 0 /* miplevel */, 0 /* layout */ }); auto layout = device.getImageSubresourceLayout(image, { {} /* flags*/, 0 /* miplevel */, 0 /* arrayLayer */ });
``` ```
### Structure Pointer Chains ### Structure Pointer Chains