summaryrefslogtreecommitdiffstats
path: root/src/render/framegraph/clearbuffers_p.h
diff options
context:
space:
mode:
authorWieland Hagen <wieland.hagen@kdab.com>2016-04-14 21:08:25 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-05-03 17:25:11 +0000
commit545cd3d3a5d0032c044f807429ace1cade462ceb (patch)
tree458d4d993714f92341ef77f5e58ac62f2a875d83 /src/render/framegraph/clearbuffers_p.h
parent44ca2d31d278b4b744abfee818a92370daf7c343 (diff)
QClearBuffers: clear specific QRenderTargetOutputs
If QClearBuffers::colorBuffer is set to a non-NULL value, only this color buffer will be affected by the Clear operation. Right now, only clamped color values are supported by the frontend. OpenGL also supports non-clamped float and integer values, depending on the type of the target buffer. Task-number: QTBUG-50116 Change-Id: I2786c0603b24b4af0d24751151d64be7504b3e92 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/framegraph/clearbuffers_p.h')
-rw-r--r--src/render/framegraph/clearbuffers_p.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/render/framegraph/clearbuffers_p.h b/src/render/framegraph/clearbuffers_p.h
index 4b2f262bd..e25860b03 100644
--- a/src/render/framegraph/clearbuffers_p.h
+++ b/src/render/framegraph/clearbuffers_p.h
@@ -68,18 +68,33 @@ public:
ClearBuffers();
void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE;
+
QClearBuffers::BufferType type() const;
- QColor clearColor() const;
float clearDepthValue() const;
int clearStencilValue() const;
+ Qt3DCore::QNodeId bufferId() const;
+
+ // in the backend we store this as a QVector4D, as the clearBuffer
+ // functions do support all float values (also those not clamped to [0,1])
+ // (for non-clamped float or int buffer types)
+ // we don't support this in the frontend yet, but let's keep our options for now
+ // and avoid QColor->QVector4D conversion every frame.
+ QVector4D clearColor() const;
+
+ // some clear operations only accept clamped values
+ QColor clearColorAsColor() const;
+
+ bool clearsAllColorBuffers() const;
private:
void initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) Q_DECL_FINAL;
QClearBuffers::BufferType m_type;
- QColor m_clearColor;
+ QVector4D m_clearColor;
+ QColor m_clearColorAsColor;
float m_clearDepthValue;
int m_clearStencilValue;
+ Qt3DCore::QNodeId m_colorBufferId;
};
} // namespace Render