X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Frenderers%2Frender-renderer.cpp;h=40490fb81438a675a20ebf5f4f2af4207fb92e98;hb=fb91f027aa740dd18f01eef6aa1ec7b08fe21401;hp=afd7656da68f148f40a2817e72dc8d774afc2321;hpb=95884a507c37a224d1e231c06a492e397795fc8d;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/renderers/render-renderer.cpp b/dali/internal/render/renderers/render-renderer.cpp index afd7656..40490fb 100644 --- a/dali/internal/render/renderers/render-renderer.cpp +++ b/dali/internal/render/renderers/render-renderer.cpp @@ -572,13 +572,15 @@ void Renderer::BuildUniformIndexMap(BufferIndex bufferIndex, const SceneGraph::N const SceneGraph::CollectedUniformMap& uniformMap = uniformMapDataProvider.GetUniformMap(bufferIndex); const SceneGraph::CollectedUniformMap& uniformMapNode = node.GetUniformMap(bufferIndex); - auto maxMaps = static_cast(uniformMap.Count() + uniformMapNode.Count()); // 4,294,967,295 maps should be enough - mUniformIndexMap.Clear(); // Clear contents, but keep memory if we don't change size - mUniformIndexMap.Resize(maxMaps); + const uint32_t mapCount = uniformMap.Count(); + const uint32_t mapNodeCount = uniformMapNode.Count(); + + mUniformIndexMap.Clear(); // Clear contents, but keep memory if we don't change size + mUniformIndexMap.Resize(mapCount + mapNodeCount); // Copy uniform map into mUniformIndexMap uint32_t mapIndex = 0; - for(; mapIndex < uniformMap.Count(); ++mapIndex) + for(; mapIndex < mapCount; ++mapIndex) { mUniformIndexMap[mapIndex].propertyValue = uniformMap[mapIndex].propertyPtr; mUniformIndexMap[mapIndex].uniformName = uniformMap[mapIndex].uniformName; @@ -587,12 +589,12 @@ void Renderer::BuildUniformIndexMap(BufferIndex bufferIndex, const SceneGraph::N mUniformIndexMap[mapIndex].arrayIndex = uniformMap[mapIndex].arrayIndex; } - for(uint32_t nodeMapIndex = 0; nodeMapIndex < uniformMapNode.Count(); ++nodeMapIndex) + for(uint32_t nodeMapIndex = 0; nodeMapIndex < mapNodeCount; ++nodeMapIndex) { auto hash = uniformMapNode[nodeMapIndex].uniformNameHash; auto& name = uniformMapNode[nodeMapIndex].uniformName; bool found(false); - for(uint32_t i = 0; i < uniformMap.Count(); ++i) + for(uint32_t i = 0; i < mapCount; ++i) { if(mUniformIndexMap[i].uniformNameHash == hash && mUniformIndexMap[i].uniformName == name) @@ -642,8 +644,7 @@ void Renderer::WriteUniformBuffer( if(uniformBlockAllocationBytes) { auto uboPoolView = mUniformBufferManager->GetUniformBufferViewPool(bufferIndex); - - uboView = uboPoolView->CreateUniformBufferView(uniformBlockAllocationBytes); + uboView = uboPoolView->CreateUniformBufferView(uniformBlockAllocationBytes); } // update the uniform buffer @@ -758,7 +759,7 @@ void Renderer::FillUniformBuffer(Program& p if(!uniform.uniformFunc) { auto uniformInfo = Graphics::UniformInfo{}; - auto uniformFound = program.GetUniform(uniform.uniformName.GetCString(), + auto uniformFound = program.GetUniform(uniform.uniformName.GetStringView(), uniform.uniformNameHash, uniform.uniformNameHashNoArray, uniformInfo);