summaryrefslogtreecommitdiffstats
path: root/src/render/renderers/opengl/renderer/renderer.cpp
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2019-08-12 13:00:28 +0200
committerPaul Lemire <paul.lemire@kdab.com>2019-09-30 08:13:16 +0200
commit4bae053c5dd756444c415bd6ddb121f7e3873b83 (patch)
tree7aad1e2ca82cb765f82a75cf413b66850a9d5423 /src/render/renderers/opengl/renderer/renderer.cpp
parentcbfa01d796aa8e95bb5f8985169c1b1a83d08d6b (diff)
RenderView:buildDrawRenderCommands: only set Command members that matter
Some values where overridden in Renderer::prepareSubmission so no point in spending time setting them in the first place Change-Id: Iceea0cbe044b883d0797aebd7487f8f6b29ac542 Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/render/renderers/opengl/renderer/renderer.cpp')
-rw-r--r--src/render/renderers/opengl/renderer/renderer.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/render/renderers/opengl/renderer/renderer.cpp b/src/render/renderers/opengl/renderer/renderer.cpp
index a05e128a2..af9a6e7e6 100644
--- a/src/render/renderers/opengl/renderer/renderer.cpp
+++ b/src/render/renderers/opengl/renderer/renderer.cpp
@@ -896,7 +896,7 @@ void Renderer::prepareCommandsSubmission(const QVector<RenderView *> &renderView
if (rGeometry->isDirty())
m_dirtyGeometry.push_back(rGeometry);
- if (!command->m_attributes.isEmpty() && (requiresFullVAOUpdate || requiresPartialVAOUpdate)) {
+ if (!command->m_activeAttributes.isEmpty() && (requiresFullVAOUpdate || requiresPartialVAOUpdate)) {
Profiling::GLTimeRecorder recorder(Profiling::VAOUpload);
// Activate shader
m_submissionContext->activateShader(shader->dna());
@@ -918,9 +918,8 @@ void Renderer::prepareCommandsSubmission(const QVector<RenderView *> &renderView
// Prepare the ShaderParameterPack based on the active uniforms of the shader
shader->prepareUniforms(command->m_parameterPack);
- // TO DO: The step below could be performed by the RenderCommand builder job
{ // Scoped to show extent
- command->m_isValid = !command->m_attributes.empty();
+ command->m_isValid = !command->m_activeAttributes.empty();
if (!command->m_isValid)
continue;
@@ -941,7 +940,7 @@ void Renderer::prepareCommandsSubmission(const QVector<RenderView *> &renderView
indirectAttribute = attribute;
break;
case QAttribute::VertexAttribute: {
- if (command->m_attributes.contains(attribute->nameId()))
+ if (command->m_activeAttributes.contains(attribute->nameId()))
estimatedCount = qMax(attribute->count(), estimatedCount);
break;
}
@@ -2174,7 +2173,7 @@ bool Renderer::updateVAOWithAttributes(Geometry *geometry,
if ((attributeWasDirty = attribute->isDirty()) == true || forceUpdate)
m_submissionContext->specifyIndices(buffer);
// Vertex Attribute
- } else if (command->m_attributes.contains(attribute->nameId())) {
+ } else if (command->m_activeAttributes.contains(attribute->nameId())) {
if ((attributeWasDirty = attribute->isDirty()) == true || forceUpdate) {
// Find the location for the attribute
const QVector<ShaderAttribute> shaderAttributes = shader->attributes();
@@ -2219,7 +2218,7 @@ bool Renderer::requiresVAOAttributeUpdate(Geometry *geometry,
continue;
if ((attribute->attributeType() == QAttribute::IndexAttribute && attribute->isDirty()) ||
- (command->m_attributes.contains(attribute->nameId()) && attribute->isDirty()))
+ (command->m_activeAttributes.contains(attribute->nameId()) && attribute->isDirty()))
return true;
}
return false;