aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-11-13 16:35:11 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-11-27 21:50:52 +0100
commitdf0cb0edac85db1fe12442d332bafc1d508bc3ae (patch)
tree843ccc014623b0200a698b6916f7a926bc88ede4 /examples/quick
parentf6e90ba533b9b4b98cfcae3d31731c1cb794ee77 (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')
-rw-r--r--examples/quick/scenegraph/metaltextureimport/metaltextureimport.pro5
-rw-r--r--examples/quick/scenegraph/metalunderqml/metalsquircle.mm5
-rw-r--r--examples/quick/scenegraph/metalunderqml/metalunderqml.pro5
-rw-r--r--examples/quick/scenegraph/scenegraph.pro2
4 files changed, 11 insertions, 6 deletions
diff --git a/examples/quick/scenegraph/metaltextureimport/metaltextureimport.pro b/examples/quick/scenegraph/metaltextureimport/metaltextureimport.pro
index 5b11606946..bbdfd358d3 100644
--- a/examples/quick/scenegraph/metaltextureimport/metaltextureimport.pro
+++ b/examples/quick/scenegraph/metaltextureimport/metaltextureimport.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 += metaltextureimport.h
SOURCES += metaltextureimport.mm main.cpp
RESOURCES += metaltextureimport.qrc
-LIBS += -framework Metal -framework AppKit
+LIBS += -framework Metal
+macos: LIBS += -framework AppKit
target.path = $$[QT_INSTALL_EXAMPLES]/quick/scenegraph/metaltextureimport
INSTALLS += target
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
diff --git a/examples/quick/scenegraph/scenegraph.pro b/examples/quick/scenegraph/scenegraph.pro
index 5fea3b974a..cc75cbc0d3 100644
--- a/examples/quick/scenegraph/scenegraph.pro
+++ b/examples/quick/scenegraph/scenegraph.pro
@@ -16,7 +16,7 @@ SUBDIRS += \
rendernode \
threadedanimation
-macos {
+macos|ios {
SUBDIRS += \
metalunderqml \
metaltextureimport