diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2016-01-20 16:33:53 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2016-01-22 14:29:34 +0000 |
commit | 86177b98e27a9d376e35039454986ff7de8f3104 (patch) | |
tree | 6ac256365641f538128666917f0b5090d873320a /src/render/graphicshelpers/graphicscontext_p.h | |
parent | 31e4d157c6b0af0c04546af643707a3811583455 (diff) |
QAspectEngine/QAbstractAspects: get rid of setData
Getting rid of set data and the refactoring on setting the surface implies
that:
- Given the FrameGraph configuration, there may be several RenderViews
each having a different RenderSurfaceSelector/Window
- This means that the Renderer/QRenderAspect can't know about the surface
before reading the scene
- This means that the Renderer may be dealing with more than 1 window
- This means that initialization, render and shutdown procedures will have to
be updated accordingly
Therefore the Renderer was refactored to:
- Be initialized without knowing about a surface
- For each RenderView, check the surface and if different from the previous
one:
* Make the context current with it
* Create the appropriate glHelpers (as Surfaces may have != formats)
TO DO:
- Fix picking
- Fix windows exposition
- Fix shutdown / detection of all windows beging closed
Change-Id: I49d070b05f46be4b26cfb57e494feba145d1da9c
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/graphicshelpers/graphicscontext_p.h')
-rw-r--r-- | src/render/graphicshelpers/graphicscontext_p.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/render/graphicshelpers/graphicscontext_p.h b/src/render/graphicshelpers/graphicscontext_p.h index cf7e36e6b..39170567c 100644 --- a/src/render/graphicshelpers/graphicscontext_p.h +++ b/src/render/graphicshelpers/graphicscontext_p.h @@ -64,6 +64,7 @@ QT_BEGIN_NAMESPACE +class QOpenGLDebugLogger; class QOpenGLShaderProgram; class QAbstractOpenGLFunctions; @@ -114,7 +115,7 @@ public: * this context */ void releaseOpenGL(); - void setOpenGLContext(QOpenGLContext* ctx, QSurface *surface); + void setOpenGLContext(QOpenGLContext* ctx); QOpenGLContext *openGLContext() { return m_gl; } bool makeCurrent(QSurface *surface); void doneCurrent(); @@ -220,7 +221,7 @@ private: GLint assignUnitForTexture(Texture* tex); void deactivateTexturesWithScope(TextureScope ts); - void resolveHighestOpenGLFunctions(); + GraphicsHelperInterface *resolveHighestOpenGLFunctions(); void bindFrameBufferAttachmentHelper(GLuint fboId, const AttachmentPack &attachments); void activateDrawBuffers(const AttachmentPack &attachments); @@ -240,6 +241,8 @@ private: QHash<Qt3DCore::QNodeId, GLuint> m_renderTargets; QHash<GLuint, QSize> m_renderTargetsSize; + QHash<QSurface *, GraphicsHelperInterface*> m_glHelpers; + // active textures, indexed by texture unit QVector<uint> m_activeTextures; QBitArray m_pinnedTextureUnits; @@ -262,6 +265,7 @@ private: QByteArray m_uboTempArray; bool m_supportsVAO; + QScopedPointer<QOpenGLDebugLogger> m_debugLogger; }; } // namespace Render |