aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/metalunderqml
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-09-16 15:51:21 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-09-18 02:27:10 +0000
commit89d654fcd4f06311c69393d5a1e1fbc8932347a1 (patch)
tree15ed158c2bbbf6f60de325bd0b8d2fea1d2199d8 /examples/quick/scenegraph/metalunderqml
parentdbf40f74de81e2780e3b14e35704750a2e44d978 (diff)
Clean up GraphicsStateInfo after API review
Change-Id: I715ad71153151a0e6521bc182227d9fa2dc0a3ea Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'examples/quick/scenegraph/metalunderqml')
-rw-r--r--examples/quick/scenegraph/metalunderqml/metalsquircle.mm8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/quick/scenegraph/metalunderqml/metalsquircle.mm b/examples/quick/scenegraph/metalunderqml/metalsquircle.mm
index 8a1a03dc68..5ca6daa01a 100644
--- a/examples/quick/scenegraph/metalunderqml/metalsquircle.mm
+++ b/examples/quick/scenegraph/metalunderqml/metalsquircle.mm
@@ -215,7 +215,7 @@ void SquircleRenderer::frameStart()
prepareShader(FragmentStage);
if (!m_initialized)
- init(m_window->graphicsStateInfo()->framesInFlight);
+ init(m_window->graphicsStateInfo().framesInFlight);
}
static const float vertices[] = {
@@ -233,7 +233,7 @@ 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();
id<MTLRenderCommandEncoder> encoder = (id<MTLRenderCommandEncoder>) rif->getResource(
@@ -242,7 +242,7 @@ void SquircleRenderer::mainPassRecordingStart()
m_window->beginExternalCommands();
- void *p = [m_ubuf[stateInfo->currentFrameSlot] contents];
+ void *p = [m_ubuf[stateInfo.currentFrameSlot] contents];
float t = m_t;
memcpy(p, &t, 4);
@@ -255,7 +255,7 @@ void SquircleRenderer::mainPassRecordingStart()
vp.zfar = 1;
[encoder setViewport: vp];
- [encoder setFragmentBuffer: m_ubuf[stateInfo->currentFrameSlot] offset: 0 atIndex: 0];
+ [encoder setFragmentBuffer: m_ubuf[stateInfo.currentFrameSlot] offset: 0 atIndex: 0];
[encoder setVertexBuffer: m_vbuf offset: 0 atIndex: 1];
[encoder setRenderPipelineState: m_pipeline];
[encoder drawPrimitives: MTLPrimitiveTypeTriangleStrip vertexStart: 0 vertexCount: 4 instanceCount: 1 baseInstance: 0];