Commit 1508700e authored by Laszlo Agocs's avatar Laszlo Agocs

Build system nonsense to fix building against an installed Qt

parent b66ba791
......@@ -1413,6 +1413,9 @@ QRhiTexture::QRhiTexture(QRhiImplementation *rhi, Format format_, const QSize &p
\return a pointer to a backend-specific QRhiNativeHandles subclass, such as
QRhiVulkanTextureNativeHandles. The returned value is null when exposing
the underlying native resources is not supported by the backend.
\sa QRhiVulkanTextureNativeHandles, QRhiD3D11TextureNativeHandles,
QRhiMetalTextureNativeHandles, QRhiGles2TextureNativeHandles
*/
const QRhiNativeHandles *QRhiTexture::nativeHandles()
{
......@@ -1423,15 +1426,24 @@ const QRhiNativeHandles *QRhiTexture::nativeHandles()
Similar to build() except that no new native textures are created. Instead,
the texture from \a src is used.
// Calling this instead of build() allows importing an existing native
// texture object (must belong to the same device or a sharing context).
// Note that format, pixelSize, etc. must still be set correctly (typically
// via QRhi::newTexture()). Ownership of the native resource is not taken.
This allows importing an existing native texture object (which must belong
to the same device or sharing context, depending on the graphics API) from
an external graphics engine.
\note format(), pixelSize(), sampleCount(), and flags() must still be set
correctly. Passing incorrect sizes and other values to QRhi::newTexture()
and then following it with a buildFrom() expecting that the native texture
object alone is sufficient to deduce such values is \b wrong and will lead
to problems.
\note QRhiTexture does not take ownership of the texture object. release()
does not free the object or any associated memory.
\sa QRhiVulkanTextureNativeHandles
The opposite of this operation, exposing a QRhiTexture-created native
texture object to a foreign engine, is possible via nativeHandles().
\sa QRhiVulkanTextureNativeHandles, QRhiD3D11TextureNativeHandles,
QRhiMetalTextureNativeHandles, QRhiGles2TextureNativeHandles
*/
bool QRhiTexture::buildFrom(const QRhiNativeHandles *src)
{
......
......@@ -27,9 +27,15 @@ INCLUDEPATH += $$PWD/../3rdparty/SPIRV-Cross $$PWD/../3rdparty/glslang
# They will not propagate outside of this module though so should be safe enough.
CONFIG += exceptions
!exists($$[QT_HOST_DATA]/.qmake.cache) {
LIBLOC = $$shadowed($$dirname(_QMAKE_CONF_))/lib
} else {
LIBLOC = $$[QT_HOST_LIBS]
}
STATICLIBS = qtspirv-cross qtglslang-glslang qtglslang-spirv qtglslang-osdependent qtglslang-oglcompiler # qtglslang-hlsl
for(libname, STATICLIBS) {
staticlib = $$[QT_HOST_LIBS]/$${QMAKE_PREFIX_STATICLIB}$$qtLibraryTarget($$libname).$${QMAKE_EXTENSION_STATICLIB}
staticlib = $$LIBLOC/$${QMAKE_PREFIX_STATICLIB}$$qtLibraryTarget($$libname).$${QMAKE_EXTENSION_STATICLIB}
LIBS_PRIVATE += $$staticlib
PRE_TARGETDEPS += $$staticlib
}
......
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