doc: Fix QVulkanFunctions code snippet
Showing code that cannot possibly compile is bad practice. (vkAllocateCommandBuffers is in QVulkanDeviceFunctions, not QVulkanFunctions) Rather use a member function that is actually in QVulkanFunctions. Pick-to: 6.6 6.5 6.2 Change-Id: I3063a8a229152144ce866e915eb4c14ecc58e9ce Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>bb10
parent
fa96e76ab1
commit
e8e9c287ec
|
|
@ -8,20 +8,18 @@
|
|||
namespace src_gui_vulkan_qvulkanfunctions {
|
||||
|
||||
struct Window {
|
||||
void render();
|
||||
void init();
|
||||
QVulkanInstance *vulkanInstance() { return nullptr; }
|
||||
};
|
||||
VkDevice_T *device = nullptr;
|
||||
VkCommandBufferAllocateInfo cmdBufInfo;
|
||||
VkCommandBuffer cmdBuf;
|
||||
|
||||
//! [0]
|
||||
void Window::render()
|
||||
void Window::init()
|
||||
{
|
||||
QVulkanInstance *inst = vulkanInstance();
|
||||
QVulkanFunctions *f = inst->functions();
|
||||
// ...
|
||||
VkResult err = f->vkAllocateCommandBuffers(device, &cmdBufInfo, &cmdBuf);
|
||||
uint32_t count = 0;
|
||||
VkResult err = f->vkEnumeratePhysicalDevices(inst->vkInstance(), &count, nullptr);
|
||||
// ...
|
||||
}
|
||||
//! [0]
|
||||
|
|
|
|||
Loading…
Reference in New Issue