Skip to content
Snippets Groups Projects
Commit c7fd92ab authored by Kaj Grönholm's avatar Kaj Grönholm
Browse files

Reset default blend equation


Combining sourceItem Textures and blendmodes which set blend equation
caused GL state issues. So reset blend equation if needed.

Task-number: QTBUG-83462
Change-Id: I9d852dabadf8da59f023e29b62702552a60137be
Reviewed-by: default avatarAndy Nichols <andy.nichols@qt.io>
parent 6a9b264e
No related branches found
No related tags found
No related merge requests found
......@@ -318,6 +318,16 @@ void QSSGRenderContext::setBlendEquation(QSSGRenderBlendEquationArgument inEquat
m_backend->setBlendEquation(inEquations);
}
void QSSGRenderContext::resetBlendEquation(bool forceSet)
{
const QSSGRenderBlendEquationArgument defaultBlendEqua;
if (!forceSet && m_hardwarePropertyContext.m_blendEquation == defaultBlendEqua)
return;
m_hardwarePropertyContext.m_blendEquation = defaultBlendEqua;
m_backend->setBlendEquation(defaultBlendEqua);
}
void QSSGRenderContext::setCullingEnabled(bool inEnabled, bool forceSet)
{
if (!forceSet && m_hardwarePropertyContext.m_cullingEnabled == inEnabled)
......@@ -669,6 +679,9 @@ bool QSSGRenderContext::applyPreDrawProperties()
void QSSGRenderContext::onPostDraw()
{
// Reset to default blend equation if needed
resetBlendEquation();
// reset input assembler binding
m_backend->setInputAssembler(nullptr, nullptr);
// Texture unit 0 is used for setting up and loading textures.
......
......@@ -343,6 +343,7 @@ public:
{
return m_hardwarePropertyContext.m_blendEquation;
}
void resetBlendEquation(bool forceSet = false);
void setCullingEnabled(bool inEnabled, bool forceSet = false);
bool isCullingEnabled() const { return m_hardwarePropertyContext.m_cullingEnabled; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment