aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-10-20 01:02:53 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-10-20 01:02:53 +0200
commitf06cbeb00b00e54826a67816663920cb468141a2 (patch)
tree9d073663750cfaf11ace6488f880be093b40b2bd /src/quick/scenegraph
parenteef179c9eb2c2d24e67c27742618555267e45e89 (diff)
parent6734ee9a6ddb6a3870556514a70d904836258559 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/qsgbasicinternalimagenode.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp25
2 files changed, 26 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgbasicinternalimagenode.cpp b/src/quick/scenegraph/qsgbasicinternalimagenode.cpp
index c8699218ba..53271af9ab 100644
--- a/src/quick/scenegraph/qsgbasicinternalimagenode.cpp
+++ b/src/quick/scenegraph/qsgbasicinternalimagenode.cpp
@@ -484,7 +484,7 @@ void QSGBasicInternalImageNode::updateGeometry()
int hTiles = ceilRight - floorLeft;
int vTiles = ceilBottom - floorTop;
- bool hasTiles = hTiles != 1 || vTiles != 1;
+ bool hasTiles = hTiles > 1 || vTiles > 1;
bool fullTexture = innerSourceRect == QRectF(0, 0, 1, 1);
// An image can be rendered as a single quad if:
diff --git a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp
index 56508af152..94912778f8 100644
--- a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp
+++ b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp
@@ -57,20 +57,34 @@ QSGDepthStencilBuffer::~QSGDepthStencilBuffer()
m_manager->m_buffers.remove(m_format);
}
+#ifndef GL_DEPTH_STENCIL_ATTACHMENT
+#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
+#endif
+
void QSGDepthStencilBuffer::attach()
{
+#ifndef Q_OS_WASM
m_functions.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
GL_RENDERBUFFER, m_depthBuffer);
m_functions.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
GL_RENDERBUFFER, m_stencilBuffer);
+#else
+ m_functions.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
+ GL_RENDERBUFFER, m_stencilBuffer);
+#endif
}
void QSGDepthStencilBuffer::detach()
{
+#ifndef Q_OS_WASM
m_functions.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
GL_RENDERBUFFER, 0);
m_functions.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
GL_RENDERBUFFER, 0);
+#else
+ m_functions.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
+ GL_RENDERBUFFER, 0);
+#endif
}
#ifndef GL_DEPTH24_STENCIL8_OES
@@ -81,12 +95,17 @@ void QSGDepthStencilBuffer::detach()
#define GL_DEPTH_COMPONENT24_OES 0x81A6
#endif
+#ifndef GL_DEPTH_STENCIL
+#define GL_DEPTH_STENCIL 0x84F9
+#endif
+
QSGDefaultDepthStencilBuffer::QSGDefaultDepthStencilBuffer(QOpenGLContext *context, const Format &format)
: QSGDepthStencilBuffer(context, format)
{
const GLsizei width = format.size.width();
const GLsizei height = format.size.height();
+#ifndef Q_OS_WASM
if (format.attachments == (DepthAttachment | StencilAttachment)
&& m_functions.hasOpenGLExtension(QOpenGLExtensions::PackedDepthStencil))
{
@@ -138,6 +157,12 @@ QSGDefaultDepthStencilBuffer::QSGDefaultDepthStencilBuffer(QOpenGLContext *conte
m_functions.glRenderbufferStorage(GL_RENDERBUFFER, internalFormat, width, height);
}
}
+#else
+ m_functions.glGenRenderbuffers(1, &m_depthBuffer);
+ m_functions.glBindRenderbuffer(GL_RENDERBUFFER, m_depthBuffer);
+ m_functions.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL, width, height);
+ m_stencilBuffer = m_depthBuffer;
+#endif
}
QSGDefaultDepthStencilBuffer::~QSGDefaultDepthStencilBuffer()