Commit cf408458 authored by Laszlo Agocs's avatar Laszlo Agocs
Browse files

Add a getter for the QRhi Implementation

parent 4c2cc893
...@@ -3515,13 +3515,23 @@ QRhi *QRhi::create(Implementation impl, QRhiInitParams *params, Flags flags, QRh ...@@ -3515,13 +3515,23 @@ QRhi *QRhi::create(Implementation impl, QRhiInitParams *params, Flags flags, QRh
profD->rhiDWhenEnabled = r->d; profD->rhiDWhenEnabled = r->d;
} }
r->d->debugMarkers = flags.testFlag(EnableDebugMarkers); r->d->debugMarkers = flags.testFlag(EnableDebugMarkers);
if (r->d->create(flags)) if (r->d->create(flags)) {
r->dtype = impl;
return r.take(); return r.take();
}
} }
return nullptr; return nullptr;
} }
/*!
\return the backend type for this QRhi.
*/
QRhi::Implementation QRhi::backend() const
{
return dtype;
}
/*! /*!
\class QRhiResourceUpdateBatch \class QRhiResourceUpdateBatch
\inmodule QtRhi \inmodule QtRhi
......
...@@ -1277,6 +1277,8 @@ public: ...@@ -1277,6 +1277,8 @@ public:
Flags flags = Flags(), Flags flags = Flags(),
QRhiNativeHandles *importDevice = nullptr); QRhiNativeHandles *importDevice = nullptr);
Implementation backend() const;
QRhiGraphicsPipeline *newGraphicsPipeline(); QRhiGraphicsPipeline *newGraphicsPipeline();
QRhiShaderResourceBindings *newShaderResourceBindings(); QRhiShaderResourceBindings *newShaderResourceBindings();
...@@ -1339,6 +1341,7 @@ protected: ...@@ -1339,6 +1341,7 @@ protected:
private: private:
Q_DISABLE_COPY(QRhi) Q_DISABLE_COPY(QRhi)
QRhiImplementation *d = nullptr; QRhiImplementation *d = nullptr;
QRhi::Implementation dtype;
}; };
Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::Flags) Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::Flags)
......
Supports Markdown
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