libqt5-qtquick3d/0002-Skip-processing-unknown-uniforms.patch

76 lines
3.0 KiB
Diff

From ff3d6efeb62575a5af503ee19db462cc6ff980e2 Mon Sep 17 00:00:00 2001
From: Inho Lee <inho.lee@qt.io>
Date: Mon, 17 Apr 2023 16:09:57 +0200
Subject: [PATCH] Skip processing unknown uniforms
While processing shader uniforms, it can face
vendor specific uniforms. Quick3D will skip
them because they are not interesting in
the pipeline.
And for GL_TEXTURE_2D_MULTISAMPLE, pnames which
are related with sampler states, are not allowed.
So, they will not be set.
Fixes: QTBUG-110039
Change-Id: I2f5b6e0103defbcac6890fd1d0c99dffe78c4b36
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
---
src/render/backends/gl/qssgopenglutil_p.h | 1 -
src/render/qssgrendershaderprogram.cpp | 7 +++++--
src/render/qssgrendertexturebase.cpp | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/render/backends/gl/qssgopenglutil_p.h b/src/render/backends/gl/qssgopenglutil_p.h
index 28b01fa62..66e780c14 100644
--- a/src/render/backends/gl/qssgopenglutil_p.h
+++ b/src/render/backends/gl/qssgopenglutil_p.h
@@ -1796,7 +1796,6 @@ struct GLConversion
default:
break;
}
- Q_ASSERT(false);
return QSSGRenderShaderDataType::Unknown;
}
diff --git a/src/render/qssgrendershaderprogram.cpp b/src/render/qssgrendershaderprogram.cpp
index f6a25c15c..80b8955e7 100644
--- a/src/render/qssgrendershaderprogram.cpp
+++ b/src/render/qssgrendershaderprogram.cpp
@@ -649,14 +649,17 @@ void QSSGRenderShaderProgram::getShaderParameters()
for (int idx = 0; idx != constantCount; ++idx) {
location = m_backend->getConstantInfoByID(m_handle, idx, 512, &elementCount, &type, &binding, nameBuf);
+ if (location == -1 || type == QSSGRenderShaderDataType::Unknown)
+ continue;
+
// sampler arrays have different type
if (type == QSSGRenderShaderDataType::Texture2D && elementCount > 1) {
type = QSSGRenderShaderDataType::Texture2DHandle;
} else if (type == QSSGRenderShaderDataType::TextureCube && elementCount > 1) {
type = QSSGRenderShaderDataType::TextureCubeHandle;
}
- if (location != -1)
- m_constants.insert(nameBuf, shaderConstantFactory(nameBuf, location, elementCount, type, binding));
+
+ m_constants.insert(nameBuf, shaderConstantFactory(nameBuf, location, elementCount, type, binding));
}
// next query constant buffers info
diff --git a/src/render/qssgrendertexturebase.cpp b/src/render/qssgrendertexturebase.cpp
index 5a191a0ca..b526bb393 100644
--- a/src/render/qssgrendertexturebase.cpp
+++ b/src/render/qssgrendertexturebase.cpp
@@ -196,7 +196,7 @@ void QSSGRenderTextureBase::setTextureCompareFunc(QSSGRenderTextureCompareOp val
void QSSGRenderTextureBase::applyTexParams()
{
- if (m_samplerParamsDirty) {
+ if (m_samplerParamsDirty && m_texTarget != QSSGRenderTextureTargetType::Texture2D_MS) {
m_backend->updateSampler(m_sampler->handle(),
m_texTarget,
m_sampler->minFilter,
--
GitLab