summaryrefslogtreecommitdiffstats
path: root/src/render/graphicshelpers/graphicscontext_p.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2016-07-01 11:44:13 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-07-05 13:24:20 +0000
commit07a81c85745ce189e633b66c51fd328d7666734e (patch)
treece9196fb296281eaf4a037a53c7cf8c657b24420 /src/render/graphicshelpers/graphicscontext_p.h
parent916a756fd15fb3fa7851466f18365f701a3d16a3 (diff)
Renderer: make submission not rely on the Shader backend node
Instead use the stored shaderDNA in the command. Make GraphicsContext able to activate a shader based only on the DNA. This also forced to store the uniform values slightly differently so that they can be applied without requiring a backend Shader node at submission time. Interestingly according to the Qt3DProfilter the load has shifted from the second submission part to the first one because of this. The nice things is that the load of the first part could be spread across multiple threads. Change-Id: I7c543766d3c088ab3886ca1cd3b529f8deb18a93 Task-number: QTBUG-54423 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/graphicshelpers/graphicscontext_p.h')
-rw-r--r--src/render/graphicshelpers/graphicscontext_p.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/render/graphicshelpers/graphicscontext_p.h b/src/render/graphicshelpers/graphicscontext_p.h
index 43a7f1a01..82a5f42b1 100644
--- a/src/render/graphicshelpers/graphicscontext_p.h
+++ b/src/render/graphicshelpers/graphicscontext_p.h
@@ -126,7 +126,8 @@ public:
bool hasValidGLHelper() const;
QOpenGLShaderProgram *createShaderProgram(Shader *shaderNode);
- void activateShader(Shader* shader);
+ void loadShader(Shader* shader);
+ void activateShader(ProgramDNA shaderDNA);
void removeShaderProgramReference(Shader *shaderNode);
GLuint activeFBO() const { return m_activeFBO; }
@@ -143,7 +144,7 @@ public:
* @brief activeShader
* @return
*/
- QOpenGLShaderProgram* activeShader();
+ QOpenGLShaderProgram* activeShader() const;
void setRenderer(Renderer *renderer);
@@ -249,7 +250,9 @@ private:
bool m_ownCurrent;
ShaderCache m_shaderCache;
- Shader *m_activeShader;
+ QOpenGLShaderProgram *m_activeShader;
+ ProgramDNA m_activeShaderDNA;
+
QHash<Qt3DCore::QNodeId, HGLBuffer> m_renderBufferHash;
QHash<Qt3DCore::QNodeId, GLuint> m_renderTargets;
QHash<GLuint, QSize> m_renderTargetsSize;