diff options
Diffstat (limited to 'src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h')
-rw-r--r-- | src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h | 56 |
1 files changed, 23 insertions, 33 deletions
diff --git a/src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h b/src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h index 82b08f05d..7578639e6 100644 --- a/src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h +++ b/src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h @@ -52,7 +52,6 @@ // We mean it. // - #include <rhibuffer_p.h> #include <Qt3DRender/qclearbuffers.h> #include <Qt3DRender/qattribute.h> @@ -117,11 +116,7 @@ public: ShaderImage }; - enum FBOBindMode { - FBODraw, - FBORead, - FBOReadAndDraw - }; + enum FBOBindMode { FBODraw, FBORead, FBOReadAndDraw }; SubmissionContext(); ~SubmissionContext(); @@ -133,7 +128,7 @@ public: bool beginDrawing(QSurface *surface); void endDrawing(bool swapBuffers); void releaseResources(); - void setOpenGLContext(QOpenGLContext* ctx); + void setOpenGLContext(QOpenGLContext *ctx); bool isInitialized() const { return m_initialized; } const GraphicsApiFilterData *contextInfo() const; @@ -145,7 +140,8 @@ public: }; ShaderCreationInfo createShaderProgram(RHIShader *shaderNode); - void loadShader(Shader* shader, ShaderManager *shaderManager, RHIShaderManager *rhiShaderManager); + void loadShader(Shader *shader, ShaderManager *shaderManager, + RHIShaderManager *rhiShaderManager); GLuint defaultFBO() const { return m_defaultFBO; } @@ -155,19 +151,19 @@ public: // FBO GLuint activeFBO() const { return m_activeFBO; } - void activateRenderTarget(const Qt3DCore::QNodeId id, const AttachmentPack &attachments, GLuint defaultFboId); + void activateRenderTarget(const Qt3DCore::QNodeId id, const AttachmentPack &attachments, + GLuint defaultFboId); QSize renderTargetSize(const QSize &surfaceSize) const; QImage readFramebuffer(const QRect &rect); - void blitFramebuffer(Qt3DCore::QNodeId outputRenderTargetId, Qt3DCore::QNodeId inputRenderTargetId, - QRect inputRect, - QRect outputRect, uint defaultFboId, + void blitFramebuffer(Qt3DCore::QNodeId outputRenderTargetId, + Qt3DCore::QNodeId inputRenderTargetId, QRect inputRect, QRect outputRect, + uint defaultFboId, QRenderTargetOutput::AttachmentPoint inputAttachmentPoint, QRenderTargetOutput::AttachmentPoint outputAttachmentPoint, QBlitFramebuffer::InterpolationMethod interpolationMethod); // Attributes - void specifyAttribute(const Attribute *attribute, - Buffer *buffer, + void specifyAttribute(const Attribute *attribute, Buffer *buffer, const ShaderAttribute *attributeDescription); void specifyIndices(Buffer *buffer); @@ -182,24 +178,20 @@ public: bool setParameters(ShaderParameterPack ¶meterPack); // RenderState - void applyStateSet(const RenderStateSet *ss, - QRhiGraphicsPipeline *graphicsPipeline); - StateVariant* getState(RenderStateSet *ss, - StateMask type) const; + void applyStateSet(const RenderStateSet *ss, QRhiGraphicsPipeline *graphicsPipeline); + StateVariant *getState(RenderStateSet *ss, StateMask type) const; // Swap chain - struct SwapChainInfo { QRhiSwapChain *swapChain = nullptr; QRhiRenderBuffer *renderBuffer = nullptr; QRhiRenderPassDescriptor *renderPassDescriptor = nullptr; }; - SwapChainInfo* swapChainForSurface(QSurface* surface) noexcept; - + SwapChainInfo *swapChainForSurface(QSurface *surface) noexcept; - QRhiResourceUpdateBatch *m_currentUpdates{}; + QRhiResourceUpdateBatch *m_currentUpdates {}; QRhi *rhi() const { return m_rhi; } QRhiCommandBuffer *currentFrameCommandBuffer() const; @@ -210,15 +202,17 @@ public: private: // Material - Material* activeMaterial() const { return m_material; } - void setActiveMaterial(Material* rmat); + Material *activeMaterial() const { return m_material; } + void setActiveMaterial(Material *rmat); // FBO void bindFrameBufferAttachmentHelper(GLuint fboId, const AttachmentPack &attachments); void activateDrawBuffers(const AttachmentPack &attachments); void resolveRenderTargetFormat(); - GLuint createRenderTarget(Qt3DCore::QNodeId renderTargetNodeId, const AttachmentPack &attachments); - GLuint updateRenderTarget(Qt3DCore::QNodeId renderTargetNodeId, const AttachmentPack &attachments, bool isActiveRenderTarget); + GLuint createRenderTarget(Qt3DCore::QNodeId renderTargetNodeId, + const AttachmentPack &attachments); + GLuint updateRenderTarget(Qt3DCore::QNodeId renderTargetNodeId, + const AttachmentPack &attachments, bool isActiveRenderTarget); // Buffers HRHIBuffer createRHIBufferFor(Buffer *buffer); @@ -227,9 +221,7 @@ private: bool bindRHIBuffer(RHIBuffer *buffer, RHIBuffer::Type type); // States - void applyState(const StateVariant &state, - QRhiGraphicsPipeline *graphicsPipeline); - + void applyState(const StateVariant &state, QRhiGraphicsPipeline *graphicsPipeline); bool m_ownCurrent; const unsigned int m_id; @@ -243,20 +235,19 @@ private: QHash<GLuint, QSize> m_renderTargetsSize; QAbstractTexture::TextureFormat m_renderTargetFormat; - Material* m_material; + Material *m_material; GLuint m_activeFBO; Renderer *m_renderer; QByteArray m_uboTempArray; - bool m_initialized; GLint m_maxTextureUnits; GLuint m_defaultFBO; GraphicsApiFilterData m_contextInfo; - QRhi* m_rhi; + QRhi *m_rhi; QHash<QSurface *, SwapChainInfo> m_swapChains; QRhiSwapChain *m_currentSwapChain; QRhiRenderPassDescriptor *m_currentRenderPassDescriptor; @@ -264,7 +255,6 @@ private: #ifndef QT_NO_OPENGL QOffscreenSurface *m_fallbackSurface; #endif - }; } // namespace Rhi |