From f1cc8f684cf7a72c70dfe4d9c1ca0a03ad0030a9 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 18 Aug 2020 17:18:53 +0200 Subject: 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 --- src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quick/scenegraph') 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); -- cgit v1.2.3