aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-08-18 17:18:53 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-08-28 16:12:19 +0200
commitf1cc8f684cf7a72c70dfe4d9c1ca0a03ad0030a9 (patch)
tree2a1927d20bb40db3e1a4bb488f3cf859037dd7d9 /src/quick/scenegraph
parent229987d91505203e5a1577651b65880e58239ac7 (diff)
Do not incorrectly leave srcAlpha and dstAlpha set to the defaults
TargetBlend defaults to One, OneMinusSrcAlpha, One, OneMinusSrcAlpha when it comes to srcColor, dstColor, srcAlpha, dstAlpha. When setting a blending different than our standard premultiplied alpha, srcAlpha and dstAlpha must be set too. Otherwise what we get is something that is not equivalent to Qt 5's glBlendFunc() call. Change-Id: Ied03669edae9dcf3ec4c9c5b560195511db8d00b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 8aa7139940..51b9df0f45 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -2642,8 +2642,8 @@ bool Renderer::ensurePipelineState(Element *e, const ShaderManager::Shader *sms,
QRhiGraphicsPipeline::TargetBlend blend;
blend.colorWrite = m_gstate.colorWrite;
blend.enable = m_gstate.blending;
- blend.srcColor = m_gstate.srcColor;
- blend.dstColor = m_gstate.dstColor;
+ blend.srcColor = blend.srcAlpha = m_gstate.srcColor;
+ blend.dstColor = blend.dstAlpha = m_gstate.dstColor;
ps->setTargetBlends({ blend });
ps->setDepthTest(m_gstate.depthTest);