summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-09 03:01:44 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-09 03:01:44 +0100
commit161af822b50c27984e92c3105d5b9af68c032007 (patch)
tree23cb3437f10fad8bfb1f1d838fba7dcc22432f9e /src
parentbf40a6cbf6b0045c157431f2717697c37bd20697 (diff)
parent52c3f9ab735bf0dfe611402ea456afc56ccdeb37 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/assimp/contrib/zip/src/miniz.h7
-rw-r--r--src/3rdparty/patches/0007-assimp-Fix-warning-about-uninitalized-variable.patch24
-rw-r--r--src/extras/shaders/es2/distancefieldtext.frag1
-rw-r--r--src/plugins/sceneparsers/assimp/assimpimporter.cpp1
-rw-r--r--src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp6
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2dmanager.cpp9
6 files changed, 43 insertions, 5 deletions
diff --git a/src/3rdparty/assimp/contrib/zip/src/miniz.h b/src/3rdparty/assimp/contrib/zip/src/miniz.h
index 916fb1ff8..2e4e223da 100644
--- a/src/3rdparty/assimp/contrib/zip/src/miniz.h
+++ b/src/3rdparty/assimp/contrib/zip/src/miniz.h
@@ -4427,14 +4427,15 @@ mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,
mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE];
MZ_FILE *pSrc_file = NULL;
+ if ((int)level_and_flags < 0)
+ level_and_flags = MZ_DEFAULT_LEVEL;
+ level = level_and_flags & 0xF;
+
if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
return MZ_FALSE;
local_dir_header_ofs = cur_archive_file_ofs = pZip->m_archive_size;
- if ((int)level_and_flags < 0)
- level_and_flags = MZ_DEFAULT_LEVEL;
- level = level_and_flags & 0xF;
if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)
return MZ_FALSE;
diff --git a/src/3rdparty/patches/0007-assimp-Fix-warning-about-uninitalized-variable.patch b/src/3rdparty/patches/0007-assimp-Fix-warning-about-uninitalized-variable.patch
new file mode 100644
index 000000000..056237f4c
--- /dev/null
+++ b/src/3rdparty/patches/0007-assimp-Fix-warning-about-uninitalized-variable.patch
@@ -0,0 +1,24 @@
+diff --git a/src/3rdparty/assimp/contrib/zip/src/miniz.h b/src/3rdparty/assimp/contrib/zip/src/miniz.h
+index 916fb1ff8..2e4e223da 100644
+--- a/src/3rdparty/assimp/contrib/zip/src/miniz.h
++++ b/src/3rdparty/assimp/contrib/zip/src/miniz.h
+@@ -4427,14 +4427,15 @@ mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,
+ mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE];
+ MZ_FILE *pSrc_file = NULL;
+
++ if ((int)level_and_flags < 0)
++ level_and_flags = MZ_DEFAULT_LEVEL;
++ level = level_and_flags & 0xF;
++
+ if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
+ return MZ_FALSE;
+
+ local_dir_header_ofs = cur_archive_file_ofs = pZip->m_archive_size;
+
+- if ((int)level_and_flags < 0)
+- level_and_flags = MZ_DEFAULT_LEVEL;
+- level = level_and_flags & 0xF;
+
+ if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)
+ return MZ_FALSE;
+
diff --git a/src/extras/shaders/es2/distancefieldtext.frag b/src/extras/shaders/es2/distancefieldtext.frag
index 88ead1f68..d2db2e306 100644
--- a/src/extras/shaders/es2/distancefieldtext.frag
+++ b/src/extras/shaders/es2/distancefieldtext.frag
@@ -1,4 +1,5 @@
#define FP highp
+#extension GL_OES_standard_derivatives: enable
uniform FP sampler2D distanceFieldTexture;
uniform FP float minAlpha;
diff --git a/src/plugins/sceneparsers/assimp/assimpimporter.cpp b/src/plugins/sceneparsers/assimp/assimpimporter.cpp
index a91bc268d..ef28c577f 100644
--- a/src/plugins/sceneparsers/assimp/assimpimporter.cpp
+++ b/src/plugins/sceneparsers/assimp/assimpimporter.cpp
@@ -164,6 +164,7 @@ QMaterial *createBestApproachingMaterial(const aiMaterial *assimpMaterial)
QString texturePath(const aiString &path)
{
QString p = aiStringToQString(path);
+ p.replace(QLatin1String("\\"), QLatin1String("/"));
if (p.startsWith('/'))
p.remove(0, 1);
return p;
diff --git a/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp b/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp
index 8a4585558..3fab345e1 100644
--- a/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp
+++ b/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp
@@ -124,7 +124,8 @@ const char *Scene3DSGMaterialShader::fragmentShader() const
"out vec4 fragColor; \n"
"void main() { \n"
" vec4 p = texture(source, qt_TexCoord); \n"
- " fragColor = vec4(p.rgb * p.a, qt_Opacity * p.a); \n"
+ " float a = qt_Opacity * p.a; \n"
+ " fragColor = vec4(p.rgb * a, a); \n"
"}";
} else {
return ""
@@ -133,7 +134,8 @@ const char *Scene3DSGMaterialShader::fragmentShader() const
"varying highp vec2 qt_TexCoord; \n"
"void main() { \n"
" highp vec4 p = texture2D(source, qt_TexCoord); \n"
- " gl_FragColor = vec4(p.rgb * p.a, qt_Opacity * p.a); \n"
+ " highp float a = qt_Opacity * p.a; \n"
+ " gl_FragColor = vec4(p.rgb * a, a); \n"
"}";
}
}
diff --git a/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp b/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp
index c5aeed278..1176d8e8e 100644
--- a/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp
+++ b/src/quick3d/quick3dscene2d/items/scene2dmanager.cpp
@@ -143,6 +143,15 @@ void Scene2DManager::startIfInitialized()
m_initialized = true;
m_sharedObject->setInitialized();
+
+ // Request render if we have already been requested and preparation has already been done
+ if (m_sharedObject->isPrepared() && m_renderSyncRequested) {
+ if (!m_requested) {
+ m_requested = true;
+ QCoreApplication::postEvent(this, new Scene2DEvent(Scene2DEvent::RenderSync));
+ }
+ m_renderSyncRequested = false;
+ }
}
}