aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/metaltextureimport
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/metaltextureimport
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/metaltextureimport')
-rw-r--r--examples/quick/scenegraph/metaltextureimport/metaltextureimport.mm8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/quick/scenegraph/metaltextureimport/metaltextureimport.mm b/examples/quick/scenegraph/metaltextureimport/metaltextureimport.mm
index 6bb68dac44..66a39083f7 100644
--- a/examples/quick/scenegraph/metaltextureimport/metaltextureimport.mm
+++ b/examples/quick/scenegraph/metaltextureimport/metaltextureimport.mm
@@ -281,7 +281,7 @@ void CustomTextureNode::sync()
m_vs = compileShaderFromSource(m_vert, m_vertEntryPoint);
m_fs = compileShaderFromSource(m_frag, m_fragEntryPoint);
- const int framesInFlight = m_window->graphicsStateInfo()->framesInFlight;
+ const int framesInFlight = m_window->graphicsStateInfo().framesInFlight;
m_vbuf = [m_device newBufferWithLength: sizeof(vertices) options: MTLResourceStorageModeShared];
void *p = [m_vbuf contents];
@@ -348,8 +348,8 @@ void CustomTextureNode::render()
Q_ASSERT(cb);
id<MTLRenderCommandEncoder> encoder = [cb renderCommandEncoderWithDescriptor: renderpassdesc];
- const QQuickWindow::GraphicsStateInfo *stateInfo = m_window->graphicsStateInfo();
- void *p = [m_ubuf[stateInfo->currentFrameSlot] contents];
+ const QQuickWindow::GraphicsStateInfo &stateInfo(m_window->graphicsStateInfo());
+ void *p = [m_ubuf[stateInfo.currentFrameSlot] contents];
memcpy(p, &m_t, 4);
MTLViewport vp;
@@ -361,7 +361,7 @@ void CustomTextureNode::render()
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];