aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-12-14 19:01:23 +0100
committerLiang Qi <liang.qi@qt.io>2016-12-14 19:01:23 +0100
commit0e80d28aa5892d6bbb4d0017b1bc9a33489f4176 (patch)
tree0db2e10c8776d172bccaeaa7ee1fab3934b93073 /src/plugins
parented32558d6280cae40578f735fd326327d571d993 (diff)
parent16c81bb0d493af00bc376784bcb7e03a4a037b04 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp5
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp9
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp4
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/globalinspector.h2
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp24
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp72
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp12
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp24
11 files changed, 94 insertions, 64 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
index fe88d686fc..151e44c4d4 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
@@ -662,7 +662,7 @@ bool QQmlEngineDebugServiceImpl::setBinding(int objectId,
filename, line, column);
QQmlPropertyPrivate::takeSignalExpression(property, qmlExpression);
} else if (property.isProperty()) {
- QQmlBinding *binding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, expression.toString(), object, QQmlContextData::get(context), filename, line, column);
+ QQmlBinding *binding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, expression.toString(), object, QQmlContextData::get(context), filename, line);
binding->setTarget(property);
QQmlPropertyPrivate::setBinding(binding);
binding->update();
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
index b2db23d78c..aed2759383 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
@@ -60,7 +60,7 @@ QV4::CallContext *QV4DataCollector::findContext(int frame)
QV4::ExecutionContext *ctx = engine()->currentContext;
while (ctx) {
QV4::CallContext *cCtxt = ctx->asCallContext();
- if (cCtxt && cCtxt->d()->function) {
+ if (cCtxt && cCtxt->d()->v4Function) {
if (frame < 1)
return cCtxt;
--frame;
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp
index 44810dd4cb..5cc2043cb1 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp
@@ -252,9 +252,8 @@ QV4::Function *QV4Debugger::getFunction() const
{
QV4::Scope scope(m_engine);
QV4::ExecutionContext *context = m_engine->currentContext;
- QV4::ScopedFunctionObject function(scope, context->getFunctionObject());
- if (function)
- return function->function();
+ if (QV4::Function *function = context->getFunction())
+ return function;
else
return context->d()->engine->globalCode;
}
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
index 6c1e353b4d..df316c1ae6 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
@@ -41,6 +41,7 @@
#include <private/qv4script_p.h>
#include <private/qqmlcontext_p.h>
+#include <private/qv4qmlcontext_p.h>
#include <private/qv4qobjectwrapper_p.h>
#include <private/qqmldebugservice_p.h>
@@ -78,8 +79,8 @@ void JavaScriptJob::run()
if (context >= 0) {
QQmlContext *extraContext = qmlContext(QQmlDebugService::objectForId(context));
if (extraContext) {
- engine->pushContext(ctx->newQmlContext(QQmlContextData::get(extraContext),
- &scopeObject));
+ engine->pushContext(QV4::QmlContext::create(ctx, QQmlContextData::get(extraContext),
+ &scopeObject));
ctx = engine->currentContext;
}
} else if (frameNr < 0) { // Use QML context if available
@@ -99,7 +100,7 @@ void JavaScriptJob::run()
}
}
if (!engine->qmlContext()) {
- engine->pushContext(ctx->newQmlContext(QQmlContextData::get(qmlRootContext),
+ engine->pushContext(QV4::QmlContext::create(ctx, QQmlContextData::get(qmlRootContext),
&scopeObject));
ctx = engine->currentContext;
}
@@ -212,7 +213,7 @@ void ValueLookupJob::run()
QV4::ExecutionEngine *engine = collector->engine();
if (engine->qmlEngine() && !engine->qmlContext()) {
scopeObject.reset(new QObject);
- engine->pushContext(engine->currentContext->newQmlContext(
+ engine->pushContext(QV4::QmlContext::create(engine->currentContext,
QQmlContextData::get(engine->qmlEngine()->rootContext()),
scopeObject.data()));
}
diff --git a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
index eb254ca1e0..7145645609 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
+++ b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
@@ -235,9 +235,7 @@ bool GlobalInspector::syncSelectedItems(const QList<QQuickItem *> &items)
// Disconnect and remove items that are no longer selected
const auto selectedItemsCopy = m_selectedItems;
- for (const QPointer<QQuickItem> &item : selectedItemsCopy) {
- if (!item) // Don't see how this can happen due to handling of destroyed()
- continue;
+ for (QQuickItem *item : selectedItemsCopy) {
if (items.contains(item))
continue;
diff --git a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h
index 338eee14c3..f7b325c454 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h
@@ -84,7 +84,7 @@ private:
bool syncSelectedItems(const QList<QQuickItem *> &items);
// Hash< object to be destroyed, QPair<destroy eventId, object debugId> >
- QList<QPointer<QQuickItem> > m_selectedItems;
+ QList<QQuickItem *> m_selectedItems;
QHash<QQuickItem *, SelectionHighlight *> m_highlightItems;
QList<QQuickWindowInspector *> m_windowInspectors;
int m_eventId;
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp
index 2525500e65..7d260a4d2a 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp
+++ b/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp
@@ -153,7 +153,7 @@ bool QQuickWindowInspector::eventFilter(QObject *obj, QEvent *event)
case QEvent::MouseButtonDblClick:
m_tool->mouseDoubleClickEvent(static_cast<QMouseEvent*>(event));
return true;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
return true;
#endif
diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
index 9c198a8afc..7f842419e7 100644
--- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
@@ -336,18 +336,16 @@ void NativeDebugger::handleBacktrace(QJsonObject *response, const QJsonObject &a
QJsonArray frameArray;
QV4::ExecutionContext *executionContext = m_engine->currentContext;
for (int i = 0; i < limit && executionContext; ++i) {
- QV4::Heap::FunctionObject *heapFunctionObject = executionContext->getFunctionObject();
- if (heapFunctionObject) {
+ if (QV4::Function *function = executionContext->getFunction()) {
QJsonObject frame;
frame.insert(QStringLiteral("language"), QStringLiteral("js"));
frame.insert(QStringLiteral("context"), encodeContext(executionContext));
- if (QV4::Function *function = heapFunctionObject->function) {
- if (QV4::Heap::String *functionName = function->name())
- frame.insert(QStringLiteral("function"), functionName->toQString());
- frame.insert(QStringLiteral("file"), function->sourceFile());
- }
+ if (QV4::Heap::String *functionName = function->name())
+ frame.insert(QStringLiteral("function"), functionName->toQString());
+ frame.insert(QStringLiteral("file"), function->sourceFile());
+
int line = executionContext->d()->lineNumber;
frame.insert(QStringLiteral("line"), (line < 0 ? -line : line));
@@ -667,11 +665,9 @@ void NativeDebugger::aboutToThrow()
QV4::Function *NativeDebugger::getFunction() const
{
- QV4::Scope scope(m_engine);
QV4::ExecutionContext *context = m_engine->currentContext;
- QV4::ScopedFunctionObject function(scope, context->getFunctionObject());
- if (function)
- return function->function();
+ if (QV4::Function *function = context->getFunction())
+ return function;
else
return context->d()->engine->globalCode;
}
@@ -683,10 +679,8 @@ void NativeDebugger::pauseAndWait()
event.insert(QStringLiteral("event"), QStringLiteral("break"));
event.insert(QStringLiteral("language"), QStringLiteral("js"));
if (QV4::ExecutionContext *executionContext = m_engine->currentContext) {
- QV4::Heap::FunctionObject *heapFunctionObject = executionContext->getFunctionObject();
- if (heapFunctionObject) {
- if (QV4::Function *function = heapFunctionObject->function)
- event.insert(QStringLiteral("file"), function->sourceFile());
+ if (QV4::Function *function = executionContext->getFunction()) {
+ event.insert(QStringLiteral("file"), function->sourceFile());
int line = executionContext->d()->lineNumber;
event.insert(QStringLiteral("line"), (line < 0 ? -line : line));
}
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
index caf64ebb8b..908f1221ab 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
@@ -61,6 +61,8 @@
#include <windows.ui.xaml.media.dxinterop.h>
#endif
+#include <comdef.h>
+
QT_BEGIN_NAMESPACE
// NOTE: Avoid categorized logging. It is slow.
@@ -98,6 +100,19 @@ static const int BUCKETS_PER_HEAP = 8; // must match freeMap
static const int DESCRIPTORS_PER_BUCKET = 32; // the bit map (freeMap) is quint32
static const int MAX_DESCRIPTORS_PER_HEAP = BUCKETS_PER_HEAP * DESCRIPTORS_PER_BUCKET;
+static QString comErrorMessage(HRESULT hr)
+{
+#ifndef Q_OS_WINRT
+ const _com_error comError(hr);
+#else
+ const _com_error comError(hr, nullptr);
+#endif
+ QString result = QLatin1String("Error 0x") + QString::number(ulong(hr), 16);
+ if (const wchar_t *msg = comError.ErrorMessage())
+ result += QLatin1String(": ") + QString::fromWCharArray(msg);
+ return result;
+}
+
D3D12_CPU_DESCRIPTOR_HANDLE QSGD3D12CPUDescriptorHeapManager::allocate(D3D12_DESCRIPTOR_HEAP_TYPE type)
{
D3D12_CPU_DESCRIPTOR_HANDLE h = {};
@@ -128,7 +143,8 @@ D3D12_CPU_DESCRIPTOR_HANDLE QSGD3D12CPUDescriptorHeapManager::allocate(D3D12_DES
HRESULT hr = m_device->CreateDescriptorHeap(&heapDesc, IID_PPV_ARGS(&heap.heap));
if (FAILED(hr)) {
- qWarning("Failed to create heap with type 0x%x: %x", type, hr);
+ qWarning("Failed to create heap with type 0x%x: %s",
+ type, qPrintable(comErrorMessage(hr)));
return h;
}
@@ -211,7 +227,8 @@ static void getHardwareAdapter(IDXGIFactory1 *factory, IDXGIAdapter1 **outAdapte
*outAdapter = adapter.Detach();
return;
} else {
- qWarning("Failed to create device for requested adapter '%s': 0x%x", qPrintable(name), hr);
+ qWarning("Failed to create device for requested adapter '%s': %s",
+ qPrintable(name), qPrintable(comErrorMessage(hr)));
}
}
}
@@ -270,7 +287,7 @@ void QSGD3D12DeviceManager::ensureCreated()
HRESULT hr = CreateDXGIFactory2(0, IID_PPV_ARGS(&m_factory));
if (FAILED(hr)) {
- qWarning("Failed to create DXGI: 0x%x", hr);
+ qWarning("Failed to create DXGI: %s", qPrintable(comErrorMessage(hr)));
return;
}
@@ -283,7 +300,7 @@ void QSGD3D12DeviceManager::ensureCreated()
if (SUCCEEDED(hr))
warp = false;
else
- qWarning("Failed to create device: 0x%x", hr);
+ qWarning("Failed to create device: %s", qPrintable(comErrorMessage(hr)));
}
if (warp) {
@@ -291,7 +308,7 @@ void QSGD3D12DeviceManager::ensureCreated()
m_factory->EnumWarpAdapter(IID_PPV_ARGS(&adapter));
HRESULT hr = D3D12CreateDevice(adapter.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device));
if (FAILED(hr)) {
- qWarning("Failed to create WARP device: 0x%x", hr);
+ qWarning("Failed to create WARP device: %s", qPrintable(comErrorMessage(hr)));
return;
}
}
@@ -798,15 +815,18 @@ void QSGD3D12EnginePrivate::initialize(WId w, const QSize &size, float dpr, int
if (SUCCEEDED(hr)) {
hr = dcompDevice->CreateVisual(&dcompVisual);
if (FAILED(hr)) {
- qWarning("Failed to create DirectComposition visual: 0x%x", hr);
+ qWarning("Failed to create DirectComposition visual: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
} else {
- qWarning("Failed to create DirectComposition target: 0x%x", hr);
+ qWarning("Failed to create DirectComposition target: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
} else {
- qWarning("Failed to create DirectComposition device: 0x%x", hr);
+ qWarning("Failed to create DirectComposition device: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
}
@@ -833,11 +853,13 @@ void QSGD3D12EnginePrivate::initialize(WId w, const QSize &size, float dpr, int
if (SUCCEEDED(hr)) {
hr = dcompTarget->SetRoot(dcompVisual.Get());
if (FAILED(hr)) {
- qWarning("SetRoot failed for DirectComposition target: 0x%x", hr);
+ qWarning("SetRoot failed for DirectComposition target: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
} else {
- qWarning("SetContent failed for DirectComposition visual: 0x%x", hr);
+ qWarning("SetContent failed for DirectComposition visual: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
} else {
@@ -867,11 +889,12 @@ void QSGD3D12EnginePrivate::initialize(WId w, const QSize &size, float dpr, int
ComPtr<IDXGISwapChain> baseSwapChain;
HRESULT hr = dev->dxgi()->CreateSwapChain(commandQueue.Get(), &swapChainDesc, &baseSwapChain);
if (FAILED(hr)) {
- qWarning("Failed to create swap chain: 0x%x", hr);
+ qWarning("Failed to create swap chain: %s", qPrintable(comErrorMessage(hr)));
return;
}
- if (FAILED(baseSwapChain.As(&swapChain))) {
- qWarning("Failed to cast swap chain");
+ hr = baseSwapChain.As(&swapChain);
+ if (FAILED(hr)) {
+ qWarning("Failed to cast swap chain: %s", qPrintable(comErrorMessage(hr)));
return;
}
}
@@ -1165,7 +1188,7 @@ void QSGD3D12EnginePrivate::setWindowSize(const QSize &size, float dpr)
deviceManager()->deviceLossDetected();
return;
} else if (FAILED(hr)) {
- qWarning("Failed to resize buffers: 0x%x", hr);
+ qWarning("Failed to resize buffers: %s", qPrintable(comErrorMessage(hr)));
return;
}
@@ -1188,7 +1211,7 @@ QSGD3D12CPUWaitableFence *QSGD3D12EnginePrivate::createCPUWaitableFence() const
QSGD3D12CPUWaitableFence *f = new QSGD3D12CPUWaitableFence;
HRESULT hr = device->CreateFence(f->value, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&f->fence));
if (FAILED(hr)) {
- qWarning("Failed to create fence: 0x%x", hr);
+ qWarning("Failed to create fence: %s", qPrintable(comErrorMessage(hr)));
return f;
}
f->event = CreateEvent(nullptr, FALSE, FALSE, nullptr);
@@ -1202,7 +1225,7 @@ void QSGD3D12EnginePrivate::waitForGPU(QSGD3D12CPUWaitableFence *f) const
if (f->fence->GetCompletedValue() < newValue) {
HRESULT hr = f->fence->SetEventOnCompletion(newValue, f->event);
if (FAILED(hr)) {
- qWarning("SetEventOnCompletion failed: 0x%x", hr);
+ qWarning("SetEventOnCompletion failed: %s", qPrintable(comErrorMessage(hr)));
return;
}
WaitForSingleObject(f->event, INFINITE);
@@ -1283,7 +1306,7 @@ ID3D12Resource *QSGD3D12EnginePrivate::createBuffer(int size)
HRESULT hr = device->CreateCommittedResource(&uploadHeapProp, D3D12_HEAP_FLAG_NONE, &bufDesc,
D3D12_RESOURCE_STATE_GENERIC_READ, nullptr, IID_PPV_ARGS(&buf));
if (FAILED(hr))
- qWarning("Failed to create buffer resource: 0x%x", hr);
+ qWarning("Failed to create buffer resource: %s", qPrintable(comErrorMessage(hr)));
return buf;
}
@@ -1640,7 +1663,7 @@ void QSGD3D12EnginePrivate::endDrawCalls(bool lastInFrame)
// Go!
HRESULT hr = frameCommandList->Close();
if (FAILED(hr)) {
- qWarning("Failed to close command list: 0x%x", hr);
+ qWarning("Failed to close command list: %s", qPrintable(comErrorMessage(hr)));
if (hr == E_INVALIDARG)
qWarning("Invalid arguments. Some of the commands in the list is invalid in some way.");
}
@@ -1874,7 +1897,8 @@ void QSGD3D12EnginePrivate::finalizePipeline(const QSGD3D12PipelineState &pipeli
HRESULT hr = device->CreateGraphicsPipelineState(&psoDesc, IID_PPV_ARGS(&cachedPso->pso));
if (FAILED(hr)) {
- qWarning("Failed to create graphics pipeline state");
+ qWarning("Failed to create graphics pipeline state: %s",
+ qPrintable(comErrorMessage(hr)));
return;
}
@@ -2179,7 +2203,7 @@ void QSGD3D12EnginePrivate::present()
deviceManager()->deviceLossDetected();
return;
} else if (FAILED(hr)) {
- qWarning("Present failed: 0x%x", hr);
+ qWarning("Present failed: %s", qPrintable(comErrorMessage(hr)));
return;
}
@@ -2433,7 +2457,7 @@ void QSGD3D12EnginePrivate::createTexture(uint id, const QSize &size, QImage::Fo
HRESULT hr = device->CreateCommittedResource(&defaultHeapProp, D3D12_HEAP_FLAG_NONE, &textureDesc,
D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&t.texture));
if (FAILED(hr)) {
- qWarning("Failed to create texture resource: 0x%x", hr);
+ qWarning("Failed to create texture resource: %s", qPrintable(comErrorMessage(hr)));
return;
}
@@ -2498,7 +2522,8 @@ void QSGD3D12EnginePrivate::queueTextureResize(uint id, const QSize &size)
HRESULT hr = device->CreateCommittedResource(&defaultHeapProp, D3D12_HEAP_FLAG_NONE, &textureDesc,
D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&t.texture));
if (FAILED(hr)) {
- qWarning("Failed to create resized texture resource: 0x%x", hr);
+ qWarning("Failed to create resized texture resource: %s",
+ qPrintable(comErrorMessage(hr)));
return;
}
@@ -2954,7 +2979,8 @@ void QSGD3D12EnginePrivate::createRenderTarget(uint id, const QSize &size, const
HRESULT hr = device->CreateCommittedResource(&defaultHeapProp, D3D12_HEAP_FLAG_NONE, &textureDesc,
D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&rt.colorResolve));
if (FAILED(hr)) {
- qWarning("Failed to create resolve buffer: 0x%x", hr);
+ qWarning("Failed to create resolve buffer: %s",
+ qPrintable(comErrorMessage(hr)));
return;
}
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
index c53a1fa6c1..60b76deb2e 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
@@ -421,7 +421,8 @@ void QSGD3D12RenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
polishTime = renderTimer.nsecsElapsed();
Q_QUICK_SG_PROFILE_SWITCH(QQuickProfiler::SceneGraphPolishFrame,
- QQuickProfiler::SceneGraphRenderLoopFrame);
+ QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphPolishPolish);
emit window->afterAnimating();
@@ -463,13 +464,15 @@ void QSGD3D12RenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
syncTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync);
wd->renderSceneGraph(window->size());
if (profileFrames)
renderTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopRender);
if (!data.grabOnly) {
// The engine is able to have multiple frames in flight. This in effect is
@@ -496,7 +499,8 @@ void QSGD3D12RenderLoop::renderWindow(QQuickWindow *window)
qint64 swapTime = 0;
if (profileFrames)
swapTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
if (Q_UNLIKELY(debug_time())) {
static QTime lastFrameTime = QTime::currentTime();
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
index a803f67380..317471eeec 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
@@ -597,7 +597,8 @@ void QSGD3D12RenderThread::syncAndRender()
if (Q_UNLIKELY(debug_time()))
syncTime = threadTimer.nsecsElapsed();
#endif
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync);
if (!syncResultedInChanges && !repaintRequested) {
if (Q_UNLIKELY(debug_loop()))
@@ -632,7 +633,8 @@ void QSGD3D12RenderThread::syncAndRender()
wd->renderSceneGraph(engine->windowSize());
if (Q_UNLIKELY(debug_time()))
renderTime = threadTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopRender);
// The engine is able to have multiple frames in flight. This in effect is
// similar to BufferQueueingOpenGL. Provide an env var to force the
@@ -649,7 +651,8 @@ void QSGD3D12RenderThread::syncAndRender()
// blockOnEachFrame is not used, but emit it for compatibility.
wd->fireFrameSwapped();
} else {
- Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphRenderLoopFrame, 1);
+ Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync, 1);
if (Q_UNLIKELY(debug_loop()))
qDebug("RT - window not ready, skipping render");
}
@@ -671,7 +674,8 @@ void QSGD3D12RenderThread::syncAndRender()
int((renderTime - syncTime) / 1000000),
int(threadTimer.elapsed() - renderTime / 1000000));
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
static int devLossTest = qEnvironmentVariableIntValue("QT_D3D_TEST_DEVICE_LOSS");
if (devLossTest > 0) {
@@ -1127,7 +1131,8 @@ void QSGD3D12ThreadedRenderLoop::polishAndSync(WindowData *w, bool inExpose)
if (Q_UNLIKELY(debug_time()))
polishTime = timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncPolish);
w->updateDuringSync = false;
@@ -1144,7 +1149,8 @@ void QSGD3D12ThreadedRenderLoop::polishAndSync(WindowData *w, bool inExpose)
qDebug("polishAndSync - wait for sync");
if (Q_UNLIKELY(debug_time()))
waitTime = timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncWait);
w->thread->waitCondition.wait(&w->thread->mutex);
lockedForSync = false;
w->thread->mutex.unlock();
@@ -1153,7 +1159,8 @@ void QSGD3D12ThreadedRenderLoop::polishAndSync(WindowData *w, bool inExpose)
if (Q_UNLIKELY(debug_time()))
syncTime = timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncSync);
if (!animationTimer && anim->isRunning()) {
if (Q_UNLIKELY(debug_loop()))
@@ -1175,7 +1182,8 @@ void QSGD3D12ThreadedRenderLoop::polishAndSync(WindowData *w, bool inExpose)
<< ", animations=" << (timer.nsecsElapsed() - syncTime) / 1000000
<< " - (on gui thread) " << window;
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncAnimations);
}
#include "qsgd3d12threadedrenderloop.moc"