Commit cf408458 authored by Laszlo Agocs's avatar Laszlo Agocs

Add a getter for the QRhi Implementation

parent 4c2cc893
......@@ -3515,13 +3515,23 @@ QRhi *QRhi::create(Implementation impl, QRhiInitParams *params, Flags flags, QRh
profD->rhiDWhenEnabled = r->d;
}
r->d->debugMarkers = flags.testFlag(EnableDebugMarkers);
if (r->d->create(flags))
if (r->d->create(flags)) {
r->dtype = impl;
return r.take();
}
}
return nullptr;
}
/*!
\return the backend type for this QRhi.
*/
QRhi::Implementation QRhi::backend() const
{
return dtype;
}
/*!
\class QRhiResourceUpdateBatch
\inmodule QtRhi
......
......@@ -1277,6 +1277,8 @@ public:
Flags flags = Flags(),
QRhiNativeHandles *importDevice = nullptr);
Implementation backend() const;
QRhiGraphicsPipeline *newGraphicsPipeline();
QRhiShaderResourceBindings *newShaderResourceBindings();
......@@ -1339,6 +1341,7 @@ protected:
private:
Q_DISABLE_COPY(QRhi)
QRhiImplementation *d = nullptr;
QRhi::Implementation dtype;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::Flags)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment