/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of Qt 3D Studio. ** ** $QT_BEGIN_LICENSE:GPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 or (at your option) any later version ** approved by the KDE Free Qt Foundation. The licenses are as published by ** the Free Software Foundation and appearing in the file LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QDRAGONRENDERASPECT_H #define QDRAGONRENDERASPECT_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // // Backend types #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Helpers #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE namespace Qt3DRender { namespace Dragon { struct BoundingVolume; //struct BoundingVolumes; struct BoundingVolumeResult; using BoundingVolumes = ValueContainer; // TODO Add typename DirtyFlags which can differ depending on container, often just T::DirtyFlags template using CacheValueContainer = CacheContainer, U>; template using BasicContainer = TrackingChangesContainer; // aspect.h class Q3DSV_EXPORT QDragonRenderAspect : public Qt3DCore::QAbstractAspect { Q_OBJECT public: QDragonRenderAspect(Renderer::RenderType renderType); Renderer::Frame renderSynchronous(Renderer::Frame frame); void initialize(QOpenGLContext *context); void endRenderShutdown(); void beginRenderShutdown(); private: QVector jobsToExecute(qint64 time) override; QVector m_jobs; // Backend nodes NodeFunctorPtr m_entities = NodeFunctorPtr::create(); NodeFunctorPtr m_transforms = NodeFunctorPtr::create(); NodeFunctorPtr m_textures = NodeFunctorPtr::create(); NodeFunctorPtr m_textureImages = NodeFunctorPtr::create(); NodeFunctorPtr m_buffers = NodeFunctorPtr::create(); NodeFunctorPtr m_parameters = NodeFunctorPtr::create(); NodeFunctorPtr m_materials = NodeFunctorPtr::create(); NodeFunctorPtr m_effects = NodeFunctorPtr::create(); NodeFunctorPtr m_techniques = NodeFunctorPtr::create(); NodeFunctorPtr m_filterKeys = NodeFunctorPtr::create(); NodeFunctorPtr m_geometries = NodeFunctorPtr::create(); NodeFunctorPtr m_geometryRenderers = NodeFunctorPtr::create(); NodeFunctorPtr m_attributes = NodeFunctorPtr::create(); NodeFunctorPtr m_cameraLenses = NodeFunctorPtr::create(); NodeFunctorPtr m_renderTargets = NodeFunctorPtr::create(); NodeFunctorPtr m_renderPasses = NodeFunctorPtr::create(); NodeFunctorPtr m_renderTargetOutputs = NodeFunctorPtr::create(); NodeFunctorPtr m_shaders = NodeFunctorPtr::create(); NodeFunctorPtr m_shaderDatas = NodeFunctorPtr::create(); NodeFunctorPtr m_renderStates = NodeFunctorPtr::create(); // Frame graph ValueContainer m_frameGraphNodesContainer; NodeFunctorPtr m_frameGraphNodes = NodeFunctorPtr::create( &m_frameGraphNodesContainer); RenderSettings *m_renderSettings = nullptr; // Qt3DCore::ResourceManager m_bufferManager; // TODO boilerplate, consider generating SourceTaskPtr m_rootEntitySource = SourceTaskPtr::create(); SourceTaskPtr m_rootFrameGraphNodeSource = SourceTaskPtr::create(); // TODO look into ways of declaring templates based on function spec // TODO or look for a way to store multiple tasks in a simple container TaskPtr m_resetJobs; TaskPtr m_uploadRenderViews; // General jobs TaskPtr m_generateFrameGraph; TaskPtr> m_calculateWorldTransforms; TaskPtr m_calculateBoundingVolumes; TaskPtr m_printTransforms; TaskPtr m_loadTextures; TaskPtr m_loadTextureImages; // TaskPtr> m_loadTextures; TaskPtr m_loadBuffers; TaskPtr> m_uploadedShaders; TaskPtr m_gatherParameters; TaskPtr m_requestContextInfo; TaskPtr m_buildRenderViews; TaskPtr m_buildRenderCommands; TaskPtr m_applyParameters; QScopedPointer m_renderer; friend class RenderSettingsFunctor; }; } // namespace Dragon } // namespace Qt3DRender QT_END_NAMESPACE #endif // QDRAGONRENDERASPECT_H