aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-03-03 16:44:20 +0100
committerAndy Nichols <andy.nichols@theqtcompany.com>2016-03-07 16:13:06 +0000
commitc64d60e6946c57733fa03acf3d544f9adb5e05a9 (patch)
tree4d3a3ef3a0f0fada6643fec7bc0ce3c981d0005a /tests/manual
parent9f764891c142ddf318fc3fef298686c922fd2cc6 (diff)
D3D12: Basic image support
For now there is no mipmapping, no atlases, and all image data is converted to RGBA8888. Regardless, this already makes it possible to use basic Image elements. Follow the same pattern as with rectangles: most of the code is shared via a material-less, abstract QSGDefaultNoMaterialImageNode, with the material-related bits provided by QSGDefaultImageNode for GL and QSGD3D12ImageNode for D3D. Also fixes the harmless but incorrect miscalculation of the VBV size for indexed draws. Image data is copied into an intermediate upload buffer when invoking the render context's createTexture(). The upload is triggered on a separate copy command queue. The main command queue is synchronized via a fence before executing the commands for the current frame. Root signatures are now cached more cleverly and include zero or more SRVs as parameter 1. This involves the engine having to manage a shader (GPU) visible CBV-SRV-UAV descriptor heap as well. Change-Id: I67c35577ff2677e1c7776dd8e5011860e2d78b00 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/nodetypes/Images.qml60
-rw-r--r--tests/manual/nodetypes/main.qml3
-rw-r--r--tests/manual/nodetypes/nodetypes.cpp1
-rw-r--r--tests/manual/nodetypes/nodetypes.pro2
-rw-r--r--tests/manual/nodetypes/nodetypes.qrc3
-rw-r--r--tests/manual/nodetypes/qt.pngbin0 -> 11917 bytes
6 files changed, 68 insertions, 1 deletions
diff --git a/tests/manual/nodetypes/Images.qml b/tests/manual/nodetypes/Images.qml
new file mode 100644
index 0000000000..34badcdb4b
--- /dev/null
+++ b/tests/manual/nodetypes/Images.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ Rectangle {
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+ color: "red"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+
+ Image {
+ source: "qrc:/qt.png"
+
+ Image {
+ anchors.centerIn: parent
+ source: "qrc:/face-smile.png"
+ }
+ }
+}
diff --git a/tests/manual/nodetypes/main.qml b/tests/manual/nodetypes/main.qml
index 3639b8c5b2..94f154afdd 100644
--- a/tests/manual/nodetypes/main.qml
+++ b/tests/manual/nodetypes/main.qml
@@ -56,5 +56,8 @@ Item {
loader.source = "qrc:/Rects.qml";
if (event.key === Qt.Key_4)
loader.source = "qrc:/LotsOfRects.qml";
+
+ if (event.key === Qt.Key_I)
+ loader.source = "qrc:/Images.qml";
}
}
diff --git a/tests/manual/nodetypes/nodetypes.cpp b/tests/manual/nodetypes/nodetypes.cpp
index bd9d1937d8..6e4b6db2a2 100644
--- a/tests/manual/nodetypes/nodetypes.cpp
+++ b/tests/manual/nodetypes/nodetypes.cpp
@@ -50,6 +50,7 @@ int main(int argc, char **argv)
qDebug("Available tests:");
qDebug(" [R] - Rectangles");
qDebug(" [4] - A lot of rectangles (perf)");
+ qDebug(" [I] - Images");
qDebug("\nPress S to stop the currently running test\n");
QQuickView view;
diff --git a/tests/manual/nodetypes/nodetypes.pro b/tests/manual/nodetypes/nodetypes.pro
index 4ac026fc41..ae5a60e1bd 100644
--- a/tests/manual/nodetypes/nodetypes.pro
+++ b/tests/manual/nodetypes/nodetypes.pro
@@ -4,4 +4,4 @@ SOURCES += nodetypes.cpp
RESOURCES += nodetypes.qrc
-OTHER_FILES += main.qml Rects.qml
+OTHER_FILES += main.qml Rects.qml LotsOfRects.qml Images.qml
diff --git a/tests/manual/nodetypes/nodetypes.qrc b/tests/manual/nodetypes/nodetypes.qrc
index d942ee2396..924a262eb9 100644
--- a/tests/manual/nodetypes/nodetypes.qrc
+++ b/tests/manual/nodetypes/nodetypes.qrc
@@ -3,5 +3,8 @@
<file>main.qml</file>
<file>Rects.qml</file>
<file>LotsOfRects.qml</file>
+ <file>Images.qml</file>
+ <file>qt.png</file>
+ <file>face-smile.png</file>
</qresource>
</RCC>
diff --git a/tests/manual/nodetypes/qt.png b/tests/manual/nodetypes/qt.png
new file mode 100644
index 0000000000..f30eec0d4d
--- /dev/null
+++ b/tests/manual/nodetypes/qt.png
Binary files differ