summaryrefslogtreecommitdiffstats
path: root/src/render/backend/renderview_p.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2016-06-28 16:35:22 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-07-04 07:31:43 +0000
commit0b85e7ad6a962ad86b5c6a74ec20980e72ef9a57 (patch)
tree2db87d33bdffa98bc40ad4a663cbc21ba231dac4 /src/render/backend/renderview_p.h
parentfb6f909a27fa6b60907d4748311fa0f6b77478fe (diff)
ClearsBuffers: make the RenderViews store clearbuffers values
This then allows to only do value lookup at submission time rather than accessing the backend node. This will be a great help when submission and frame processing are later on parallelized. Change-Id: I0d34251d67f8329f486626642d7d2eccef9ddf18 Task-number: QTBUG-54423 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/backend/renderview_p.h')
-rw-r--r--src/render/backend/renderview_p.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/render/backend/renderview_p.h b/src/render/backend/renderview_p.h
index 0596b28b1..0b01744e9 100644
--- a/src/render/backend/renderview_p.h
+++ b/src/render/backend/renderview_p.h
@@ -105,6 +105,13 @@ struct Q_AUTOTEST_EXPORT Plane
const float d;
};
+struct Q_AUTOTEST_EXPORT ClearBufferInfo
+{
+ int drawBufferIndex = 0;
+ QRenderTargetOutput::AttachmentPoint attchmentPoint = QRenderTargetOutput::Color0;
+ QVector4D clearColor;
+};
+
// This class is kind of analogous to RenderBin but I want to avoid trampling
// on that until we get this working
@@ -177,8 +184,10 @@ public:
// color ClearBuffers are collected, as there may be multiple
// color buffers to be cleared. we need to apply all these at rendering
void addClearBuffers(const ClearBuffers *cb);
- inline QVector<const ClearBuffers*> specificClearColorBuffers() const { return m_specificClearColorBuffers; }
- inline const ClearBuffers* globalClearColorBuffers() const { return m_globalClearColorBuffer; }
+ inline QVector<ClearBufferInfo> specificClearColorBufferInfo() const { return m_specificClearColorBuffers; }
+ inline QVector<ClearBufferInfo> &specificClearColorBufferInfo() { return m_specificClearColorBuffers; }
+ inline ClearBufferInfo globalClearColorBufferInfo() const { return m_globalClearColorBuffer; }
+
inline QClearBuffers::BufferTypeFlags clearTypes() const { return m_clearBuffer; }
inline float clearDepthValue() const { return m_clearDepthValue; }
inline int clearStencilValue() const { return m_clearStencilValue; }
@@ -249,8 +258,8 @@ private:
QClearBuffers::BufferTypeFlags m_clearBuffer;
float m_clearDepthValue;
int m_clearStencilValue;
- const ClearBuffers* m_globalClearColorBuffer; // global ClearColor
- QVector<const ClearBuffers*> m_specificClearColorBuffers; // different draw buffers with distinct colors
+ ClearBufferInfo m_globalClearColorBuffer; // global ClearColor
+ QVector<ClearBufferInfo> m_specificClearColorBuffers; // different draw buffers with distinct colors
RenderStateSet *m_stateSet;
bool m_noDraw:1;
bool m_compute:1;