projects
/
platform
/
core
/
uifw
/
dali-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement some more speed-up : Reserve TextureBindings + don't copy geometry
[platform/core/uifw/dali-core.git]
/
dali
/
internal
/
render
/
renderers
/
render-renderer.cpp
diff --git
a/dali/internal/render/renderers/render-renderer.cpp
b/dali/internal/render/renderers/render-renderer.cpp
index
9c8dd47
..
b76c15f
100644
(file)
--- a/
dali/internal/render/renderers/render-renderer.cpp
+++ b/
dali/internal/render/renderers/render-renderer.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 202
1
Samsung Electronics Co., Ltd.
+ * Copyright (c) 202
2
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-229,10
+229,14
@@
void Renderer::BindTextures(Graphics::CommandBuffer& commandBuffer, Vector<Graph
if(textures != nullptr)
{
if(textures != nullptr)
{
- for(uint32_t i = 0; i < static_cast<uint32_t>(textures->Count()); ++i) // not expecting more than uint32_t of textures
+ const std::uint32_t texturesCount(static_cast<std::uint32_t>(textures->Count()));
+ textureBindings.reserve(texturesCount);
+
+ for(uint32_t i = 0; i < texturesCount; ++i) // not expecting more than uint32_t of textures
{
if((*textures)[i] && (*textures)[i]->GetGraphicsObject())
{
{
if((*textures)[i] && (*textures)[i]->GetGraphicsObject())
{
+ Graphics::Texture* graphicsTexture = (*textures)[i]->GetGraphicsObject();
// if the sampler exists,
// if it's default, delete the graphics object
// otherwise re-initialize it if dirty
// if the sampler exists,
// if it's default, delete the graphics object
// otherwise re-initialize it if dirty
@@
-241,8
+245,8
@@
void Renderer::BindTextures(Graphics::CommandBuffer& commandBuffer, Vector<Graph
: nullptr)
: nullptr;
: nullptr)
: nullptr;
- boundTextures.PushBack(
(*textures)[i]->GetGraphicsObject()
);
- const Graphics::TextureBinding textureBinding{
(*textures)[i]->GetGraphicsObject()
, graphicsSampler, textureUnit};
+ boundTextures.PushBack(
graphicsTexture
);
+ const Graphics::TextureBinding textureBinding{
graphicsTexture
, graphicsSampler, textureUnit};
textureBindings.push_back(textureBinding);
++textureUnit;
textureBindings.push_back(textureBinding);
++textureUnit;