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. Change-Id: I3063a8a229152144ce866e915eb4c14ecc58e9ce Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit e8e9c287ec6a086a96b36e692ab6d5ed11b64951) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
7076e8e9f4
commit
66a0d3a03c
@ -55,20 +55,18 @@
|
|||||||
namespace src_gui_vulkan_qvulkanfunctions {
|
namespace src_gui_vulkan_qvulkanfunctions {
|
||||||
|
|
||||||
struct Window {
|
struct Window {
|
||||||
void render();
|
void init();
|
||||||
QVulkanInstance *vulkanInstance() { return nullptr; }
|
QVulkanInstance *vulkanInstance() { return nullptr; }
|
||||||
};
|
};
|
||||||
VkDevice_T *device = nullptr;
|
|
||||||
VkCommandBufferAllocateInfo cmdBufInfo;
|
|
||||||
VkCommandBuffer cmdBuf;
|
|
||||||
|
|
||||||
//! [0]
|
//! [0]
|
||||||
void Window::render()
|
void Window::init()
|
||||||
{
|
{
|
||||||
QVulkanInstance *inst = vulkanInstance();
|
QVulkanInstance *inst = vulkanInstance();
|
||||||
QVulkanFunctions *f = inst->functions();
|
QVulkanFunctions *f = inst->functions();
|
||||||
// ...
|
// ...
|
||||||
VkResult err = f->vkAllocateCommandBuffers(device, &cmdBufInfo, &cmdBuf);
|
uint32_t count = 0;
|
||||||
|
VkResult err = f->vkEnumeratePhysicalDevices(inst->vkInstance(), &count, nullptr);
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
//! [0]
|
//! [0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user