diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-11-13 16:35:11 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-11-27 21:50:52 +0100 |
commit | df0cb0edac85db1fe12442d332bafc1d508bc3ae (patch) | |
tree | 843ccc014623b0200a698b6916f7a926bc88ede4 /examples/quick/scenegraph/metalunderqml | |
parent | f6e90ba533b9b4b98cfcae3d31731c1cb794ee77 (diff) |
Fix Metal usage on iOS
Also enable the two Metal-specific scenegraph examples on iOS.
Change-Id: I0e1e6d527544ea4a5bfb0d08ca2d32c762d3c699
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'examples/quick/scenegraph/metalunderqml')
-rw-r--r-- | examples/quick/scenegraph/metalunderqml/metalsquircle.mm | 5 | ||||
-rw-r--r-- | examples/quick/scenegraph/metalunderqml/metalunderqml.pro | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/examples/quick/scenegraph/metalunderqml/metalsquircle.mm b/examples/quick/scenegraph/metalunderqml/metalsquircle.mm index 5ca6daa01a..4844df0c70 100644 --- a/examples/quick/scenegraph/metalunderqml/metalsquircle.mm +++ b/examples/quick/scenegraph/metalunderqml/metalsquircle.mm @@ -349,10 +349,13 @@ void SquircleRenderer::init(int framesInFlight) rpDesc.colorAttachments[0].destinationRGBBlendFactor = MTLBlendFactorOne; rpDesc.colorAttachments[0].destinationAlphaBlendFactor = MTLBlendFactorOne; +#ifdef Q_OS_MACOS if (m_device.depth24Stencil8PixelFormatSupported) { rpDesc.depthAttachmentPixelFormat = MTLPixelFormatDepth24Unorm_Stencil8; rpDesc.stencilAttachmentPixelFormat = MTLPixelFormatDepth24Unorm_Stencil8; - } else { + } else +#endif + { rpDesc.depthAttachmentPixelFormat = MTLPixelFormatDepth32Float_Stencil8; rpDesc.stencilAttachmentPixelFormat = MTLPixelFormatDepth32Float_Stencil8; } diff --git a/examples/quick/scenegraph/metalunderqml/metalunderqml.pro b/examples/quick/scenegraph/metalunderqml/metalunderqml.pro index 9fd131fe1b..2f4c3f63da 100644 --- a/examples/quick/scenegraph/metalunderqml/metalunderqml.pro +++ b/examples/quick/scenegraph/metalunderqml/metalunderqml.pro @@ -1,4 +1,4 @@ -!macos: error("This example requires macOS") +!macos:!ios: error("This example requires macOS or iOS") QT += qml quick @@ -6,7 +6,8 @@ HEADERS += metalsquircle.h SOURCES += metalsquircle.mm main.cpp RESOURCES += metalunderqml.qrc -LIBS += -framework Metal -framework AppKit +LIBS += -framework Metal +macos: LIBS += -framework AppKit target.path = $$[QT_INSTALL_EXAMPLES]/quick/scenegraph/metalunderqml INSTALLS += target |