diff options
Diffstat (limited to 'src/render/backend/renderview.cpp')
-rw-r--r-- | src/render/backend/renderview.cpp | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/src/render/backend/renderview.cpp b/src/render/backend/renderview.cpp index 22aa581a7..120142c51 100644 --- a/src/render/backend/renderview.cpp +++ b/src/render/backend/renderview.cpp @@ -621,41 +621,44 @@ void RenderView::setUniformBlockValue(QUniformPack &uniformPack, Shader *shader, // Note: we assume that if a buffer is shared accross multiple shaders // then it implies that they share the same layout - BufferShaderKey uboKey(shaderData->peerUuid(), - shader->peerUuid()); - - BlockToUBO uniformBlockUBO; - uniformBlockUBO.m_blockIndex = block.m_index; - uniformBlockUBO.m_shaderDataID = shaderData->peerUuid(); - bool uboNeedsUpdate = false; - - // build UBO at uboId if not created before - if (!m_manager->glBufferManager()->contains(uboKey)) { - m_manager->glBufferManager()->getOrCreateResource(uboKey); - uboNeedsUpdate = true; - } - - // If shaderData has been updated (property has changed or one of the nested properties has changed) - // foreach property defined in the QShaderData, we try to fill the value of the corresponding active uniform(s) - // for all the updated properties (all the properties if the UBO was just created) - if (shaderData->updateViewTransform(*m_data->m_viewMatrix) || uboNeedsUpdate) { - // Clear previous values remaining in the hash - m_data->m_uniformBlockBuilder.activeUniformNamesToValue.clear(); - // Update only update properties if uboNeedsUpdate is true, otherwise update the whole block - m_data->m_uniformBlockBuilder.updatedPropertiesOnly = uboNeedsUpdate; - // Retrieve names and description of each active uniforms in the uniform block - m_data->m_uniformBlockBuilder.uniforms = shader->activeUniformsForUniformBlock(block.m_index); - // Builds the name-value map for the block - m_data->m_uniformBlockBuilder.buildActiveUniformNameValueMapStructHelper(shaderData, block.m_name); - if (!uboNeedsUpdate) - shaderData->markDirty(); - // copy the name-value map into the BlockToUBO - uniformBlockUBO.m_updatedProperties = m_data->m_uniformBlockBuilder.activeUniformNamesToValue; - uboNeedsUpdate = true; - } - uniformBlockUBO.m_needsUpdate = uboNeedsUpdate; - uniformPack.setUniformBuffer(uniformBlockUBO); + // Temporarly disabled + + // BufferShaderKey uboKey(shaderData->peerUuid(), + // shader->peerUuid()); + + // BlockToUBO uniformBlockUBO; + // uniformBlockUBO.m_blockIndex = block.m_index; + // uniformBlockUBO.m_shaderDataID = shaderData->peerUuid(); + // bool uboNeedsUpdate = false; + + // // build UBO at uboId if not created before + // if (!m_manager->glBufferManager()->contains(uboKey)) { + // m_manager->glBufferManager()->getOrCreateResource(uboKey); + // uboNeedsUpdate = true; + // } + + // // If shaderData has been updated (property has changed or one of the nested properties has changed) + // // foreach property defined in the QShaderData, we try to fill the value of the corresponding active uniform(s) + // // for all the updated properties (all the properties if the UBO was just created) + // if (shaderData->updateViewTransform(*m_data->m_viewMatrix) || uboNeedsUpdate) { + // // Clear previous values remaining in the hash + // m_data->m_uniformBlockBuilder.activeUniformNamesToValue.clear(); + // // Update only update properties if uboNeedsUpdate is true, otherwise update the whole block + // m_data->m_uniformBlockBuilder.updatedPropertiesOnly = uboNeedsUpdate; + // // Retrieve names and description of each active uniforms in the uniform block + // m_data->m_uniformBlockBuilder.uniforms = shader->activeUniformsForUniformBlock(block.m_index); + // // Builds the name-value map for the block + // m_data->m_uniformBlockBuilder.buildActiveUniformNameValueMapStructHelper(shaderData, block.m_name); + // if (!uboNeedsUpdate) + // shaderData->markDirty(); + // // copy the name-value map into the BlockToUBO + // uniformBlockUBO.m_updatedProperties = m_data->m_uniformBlockBuilder.activeUniformNamesToValue; + // uboNeedsUpdate = true; + // } + + // uniformBlockUBO.m_needsUpdate = uboNeedsUpdate; + // uniformPack.setUniformBuffer(uniformBlockUBO); } } |