aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp')
-rw-r--r--examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp b/examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp
index 59e9606e7b..21f46a25c1 100644
--- a/examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp
+++ b/examples/quick/scenegraph/vulkanunderqml/vulkansquircle.cpp
@@ -212,7 +212,7 @@ void SquircleRenderer::frameStart()
prepareShader(FragmentStage);
if (!m_initialized)
- init(m_window->graphicsStateInfo()->framesInFlight);
+ init(m_window->graphicsStateInfo().framesInFlight);
}
static const float vertices[] = {
@@ -230,10 +230,10 @@ void SquircleRenderer::mainPassRecordingStart()
// the scenegraph's main renderpass. It does not create its own passes,
// rendertargets, etc. so no synchronization is needed.
- const QQuickWindow::GraphicsStateInfo *stateInfo = m_window->graphicsStateInfo();
+ const QQuickWindow::GraphicsStateInfo &stateInfo(m_window->graphicsStateInfo());
QSGRendererInterface *rif = m_window->rendererInterface();
- VkDeviceSize ubufOffset = stateInfo->currentFrameSlot * m_allocPerUbuf;
+ VkDeviceSize ubufOffset = stateInfo.currentFrameSlot * m_allocPerUbuf;
void *p = nullptr;
VkResult err = m_devFuncs->vkMapMemory(m_dev, m_ubufMem, ubufOffset, m_allocPerUbuf, 0, &p);
if (err != VK_SUCCESS || !p)
@@ -259,7 +259,7 @@ void SquircleRenderer::mainPassRecordingStart()
VkDeviceSize vbufOffset = 0;
m_devFuncs->vkCmdBindVertexBuffers(cb, 0, 1, &m_vbuf, &vbufOffset);
- uint32_t dynamicOffset = m_allocPerUbuf * stateInfo->currentFrameSlot;
+ uint32_t dynamicOffset = m_allocPerUbuf * stateInfo.currentFrameSlot;
m_devFuncs->vkCmdBindDescriptorSets(cb, VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipelineLayout, 0, 1,
&m_ubufDescriptor, 1, &dynamicOffset);
@@ -362,13 +362,13 @@ void SquircleRenderer::init(int framesInFlight)
}
}
}
- if (memTypeIndex < 0)
+ if (memTypeIndex == uint32_t(-1))
qFatal("Failed to find host visible and coherent memory type");
allocInfo.memoryTypeIndex = memTypeIndex;
err = m_devFuncs->vkAllocateMemory(m_dev, &allocInfo, nullptr, &m_vbufMem);
if (err != VK_SUCCESS)
- qFatal("Failed to allocate vertex buffer memory of size %llu: %d", allocInfo.allocationSize, err);
+ qFatal("Failed to allocate vertex buffer memory of size %u: %d", uint(allocInfo.allocationSize), err);
void *p = nullptr;
err = m_devFuncs->vkMapMemory(m_dev, m_vbufMem, 0, allocInfo.allocationSize, 0, &p);
@@ -412,14 +412,14 @@ void SquircleRenderer::init(int framesInFlight)
}
}
}
- if (memTypeIndex < 0)
+ if (memTypeIndex == uint32_t(-1))
qFatal("Failed to find host visible and coherent memory type");
allocInfo.allocationSize = framesInFlight * m_allocPerUbuf;
allocInfo.memoryTypeIndex = memTypeIndex;
err = m_devFuncs->vkAllocateMemory(m_dev, &allocInfo, nullptr, &m_ubufMem);
if (err != VK_SUCCESS)
- qFatal("Failed to allocate uniform buffer memory of size %llu: %d", allocInfo.allocationSize, err);
+ qFatal("Failed to allocate uniform buffer memory of size %u: %d", uint(allocInfo.allocationSize), err);
err = m_devFuncs->vkBindBufferMemory(m_dev, m_ubuf, m_ubufMem, 0);
if (err != VK_SUCCESS)