aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-02-03 17:36:55 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-18 21:00:00 +0100
commita2e92f6dee12320a58a4bcc95c14649b27804427 (patch)
tree3198365f9f7ca75cc3c4bd23340bb5fe15ee63a5 /src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp
parent337524714cad51934879d817564c5d58e6dbd0c0 (diff)
Dynamic GL in Quick
The counterpart to I716fdebb. Implements the dynamic path in scenegraph. Task-number: QTBUG-36483 Change-Id: I2dc613ba84560b7b8e36d3cd1da61c050ab08db0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp')
-rw-r--r--src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp
index 59bde0d602..db8ed03b8d 100644
--- a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp
+++ b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp
@@ -75,8 +75,6 @@ void QSGDepthStencilBuffer::detach()
GL_RENDERBUFFER, 0);
}
-// ###TODO Remove once using Khronos OpenGL headers
-#if defined(QT_OPENGL_ES_2)
#ifndef GL_DEPTH24_STENCIL8_OES
#define GL_DEPTH24_STENCIL8_OES 0x88F0
#endif
@@ -84,7 +82,6 @@ void QSGDepthStencilBuffer::detach()
#ifndef GL_DEPTH_COMPONENT24_OES
#define GL_DEPTH_COMPONENT24_OES 0x81A6
#endif
-#endif
QSGDefaultDepthStencilBuffer::QSGDefaultDepthStencilBuffer(QOpenGLContext *context, const Format &format)
: QSGDepthStencilBuffer(context, format)
@@ -117,12 +114,10 @@ QSGDefaultDepthStencilBuffer::QSGDefaultDepthStencilBuffer(QOpenGLContext *conte
if (!m_depthBuffer && (format.attachments & DepthAttachment)) {
m_functions.glGenRenderbuffers(1, &m_depthBuffer);
m_functions.glBindRenderbuffer(GL_RENDERBUFFER, m_depthBuffer);
-#ifdef QT_OPENGL_ES
- const GLenum internalFormat = m_functions.hasOpenGLExtension(QOpenGLExtensions::Depth24)
+ GLenum internalFormat = GL_DEPTH_COMPONENT;
+ if (context->isES())
+ internalFormat = m_functions.hasOpenGLExtension(QOpenGLExtensions::Depth24)
? GL_DEPTH_COMPONENT24_OES : GL_DEPTH_COMPONENT16;
-#else
- const GLenum internalFormat = GL_DEPTH_COMPONENT;
-#endif
if (format.samples && m_functions.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)) {
m_functions.glRenderbufferStorageMultisample(GL_RENDERBUFFER, format.samples,
internalFormat, width, height);
@@ -136,7 +131,7 @@ QSGDefaultDepthStencilBuffer::QSGDefaultDepthStencilBuffer(QOpenGLContext *conte
#ifdef QT_OPENGL_ES
const GLenum internalFormat = GL_STENCIL_INDEX8;
#else
- const GLenum internalFormat = GL_STENCIL_INDEX;
+ const GLenum internalFormat = context->isES() ? GL_STENCIL_INDEX8 : GL_STENCIL_INDEX;
#endif
if (format.samples && m_functions.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)) {
m_functions.glRenderbufferStorageMultisample(GL_RENDERBUFFER, format.samples,