Add some debug warnings to the GL paint engine regarding stencil
There is absolutely nothing we can do if the render target has no stencil buffer, but print at least a warning in debug builds to give a hint to the developer. Pick-to: 6.2 Task-number: QTBUG-96786 Change-Id: If7f84f28f9bc9b3dadd01d0816c8db4015a1db0b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
e9cef8e7fa
commit
e5d65996a9
@ -1124,6 +1124,10 @@ void QOpenGL2PaintEngineExPrivate::fillStencilWithVertexArray(const float *data,
|
|||||||
|
|
||||||
funcs.glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); // Disable color writes
|
funcs.glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); // Disable color writes
|
||||||
useSimpleShader();
|
useSimpleShader();
|
||||||
|
#ifndef QT_NO_DEBUG
|
||||||
|
if (ctx->format().stencilBufferSize() <= 0)
|
||||||
|
qWarning("OpenGL paint engine: attempted to use stencil test without requesting a stencil buffer.");
|
||||||
|
#endif
|
||||||
funcs.glEnable(GL_STENCIL_TEST); // For some reason, this has to happen _after_ the simple shader is use()'d
|
funcs.glEnable(GL_STENCIL_TEST); // For some reason, this has to happen _after_ the simple shader is use()'d
|
||||||
|
|
||||||
if (mode == WindingFillMode) {
|
if (mode == WindingFillMode) {
|
||||||
@ -2346,6 +2350,10 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest()
|
|||||||
{
|
{
|
||||||
Q_Q(QOpenGL2PaintEngineEx);
|
Q_Q(QOpenGL2PaintEngineEx);
|
||||||
if (q->state()->clipTestEnabled) {
|
if (q->state()->clipTestEnabled) {
|
||||||
|
#ifndef QT_NO_DEBUG
|
||||||
|
if (ctx->format().stencilBufferSize() <= 0)
|
||||||
|
qWarning("OpenGL paint engine: attempted to use stencil test for clipping without requesting a stencil buffer.");
|
||||||
|
#endif
|
||||||
funcs.glEnable(GL_STENCIL_TEST);
|
funcs.glEnable(GL_STENCIL_TEST);
|
||||||
funcs.glStencilFunc(GL_LEQUAL, q->state()->currentClip, ~GL_STENCIL_HIGH_BIT);
|
funcs.glStencilFunc(GL_LEQUAL, q->state()->currentClip, ~GL_STENCIL_HIGH_BIT);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user