[core] Reset GL values when needed
This commit is contained in:
@@ -144,6 +144,7 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
|
||||
config.depthMask = GL_FALSE;
|
||||
|
||||
if (bucket.hasCollisionBoxData()) {
|
||||
config.stencilOp.reset();
|
||||
config.stencilTest = GL_TRUE;
|
||||
|
||||
config.program = collisionBoxShader->program;
|
||||
@@ -170,11 +171,17 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
|
||||
if (drawAcrossEdges) {
|
||||
config.stencilTest = GL_FALSE;
|
||||
} else {
|
||||
config.stencilOp.reset();
|
||||
config.stencilTest = GL_TRUE;
|
||||
}
|
||||
|
||||
if (bucket.hasIconData()) {
|
||||
config.depthTest = layout.icon.rotation_alignment == RotationAlignmentType::Map;
|
||||
if (layout.icon.rotation_alignment == RotationAlignmentType::Map) {
|
||||
config.depthFunc.reset();
|
||||
config.depthTest = GL_TRUE;
|
||||
} else {
|
||||
config.depthTest = GL_FALSE;
|
||||
}
|
||||
|
||||
bool sdf = bucket.sdfIcons;
|
||||
|
||||
@@ -246,7 +253,12 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
|
||||
}
|
||||
|
||||
if (bucket.hasTextData()) {
|
||||
config.depthTest = layout.text.rotation_alignment == RotationAlignmentType::Map;
|
||||
if (layout.text.rotation_alignment == RotationAlignmentType::Map) {
|
||||
config.depthFunc.reset();
|
||||
config.depthTest = GL_TRUE;
|
||||
} else {
|
||||
config.depthTest = GL_FALSE;
|
||||
}
|
||||
|
||||
glyphAtlas->bind();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user