forked from organicmaps/organicmaps
introduced multiBlitStorage resource type.
This commit is contained in:
parent
a83ecf8226
commit
4add1820c1
2 changed files with 43 additions and 1 deletions
|
@ -75,6 +75,17 @@ namespace yg
|
|||
LOG(LINFO, ("allocating ", fontTexCount * fontTexWidth * fontTexHeight * sizeof(TDynamicTexture::pixel_t), " bytes for font textures"));
|
||||
}
|
||||
|
||||
void ResourceManager::initMultiBlitStorage(size_t multiBlitVBSize, size_t multiBlitIBSize, size_t multiBlitStoragesCount)
|
||||
{
|
||||
m_multiBlitVBSize = multiBlitVBSize;
|
||||
m_multiBlitIBSize = multiBlitIBSize;
|
||||
|
||||
for (size_t i = 0; i < multiBlitStoragesCount; ++i)
|
||||
m_multiBlitStorages.PushBack(gl::Storage(multiBlitVBSize, multiBlitIBSize, m_useVA));
|
||||
|
||||
LOG(LINFO, ("allocating ", (multiBlitVBSize + multiBlitIBSize) * multiBlitStoragesCount, " bytes for multi-blit storages"));
|
||||
}
|
||||
|
||||
void ResourceManager::initRenderTargets(size_t renderTargetWidth, size_t renderTargetHeight, size_t renderTargetsCount)
|
||||
{
|
||||
m_renderTargetWidth = renderTargetWidth;
|
||||
|
@ -180,14 +191,26 @@ namespace yg
|
|||
m_blitStoragesCount = m_blitStorages.Size();
|
||||
m_dynamicTexturesCount = m_dynamicTextures.Size();
|
||||
m_fontTexturesCount = m_fontTextures.Size();
|
||||
m_multiBlitStoragesCount = m_multiBlitStorages.Size();
|
||||
m_renderTargetsCount = m_renderTargets.Size();
|
||||
|
||||
m_storages.Clear();
|
||||
m_smallStorages.Clear();
|
||||
m_blitStorages.Clear();
|
||||
m_multiBlitStorages.Clear();
|
||||
|
||||
m_dynamicTextures.Clear();
|
||||
m_fontTextures.Clear();
|
||||
m_renderTargets.Clear();
|
||||
|
||||
LOG(LINFO, ("freed ", m_storagesCount, " storages, ", m_smallStoragesCount, " small storages, ", m_blitStoragesCount, " blit storages, ", m_dynamicTexturesCount, " dynamic textures and ", m_fontTexturesCount, " font textures"));
|
||||
|
||||
/* LOG(LINFO, ("freed ", m_storagesCount, " storages, ",
|
||||
m_smallStoragesCount, " small storages, ",
|
||||
m_blitStoragesCount, " blit storages, ",
|
||||
m_dynamicTexturesCount, " dynamic textures, ",
|
||||
m_fontTexturesCount, " font textures, ",
|
||||
m_renderTargetsCount, " render targets and ",
|
||||
m_multiBlitStoragesCount, " multi-blit storages"));*/
|
||||
}
|
||||
|
||||
void ResourceManager::enterForeground()
|
||||
|
@ -200,11 +223,16 @@ namespace yg
|
|||
m_smallStorages.PushBack(gl::Storage(m_smallVBSize, m_smallIBSize, m_useVA));
|
||||
for (size_t i = 0; i < m_blitStoragesCount; ++i)
|
||||
m_blitStorages.PushBack(gl::Storage(m_blitVBSize, m_blitIBSize, m_useVA));
|
||||
for (size_t i = 0; i < m_multiBlitStoragesCount; ++i)
|
||||
m_multiBlitStorages.PushBack(gl::Storage(m_multiBlitVBSize, m_multiBlitIBSize, m_useVA));
|
||||
|
||||
for (size_t i = 0; i < m_dynamicTexturesCount; ++i)
|
||||
m_dynamicTextures.PushBack(shared_ptr<gl::BaseTexture>(new TDynamicTexture(m_dynamicTextureWidth, m_dynamicTextureHeight)));
|
||||
for (size_t i = 0; i < m_fontTexturesCount; ++i)
|
||||
m_fontTextures.PushBack(shared_ptr<gl::BaseTexture>(new TDynamicTexture(m_fontTextureWidth, m_fontTextureHeight)));
|
||||
for (size_t i = 0; i < m_renderTargetsCount; ++i)
|
||||
m_renderTargets.PushBack(shared_ptr<gl::BaseTexture>(new TDynamicTexture(m_renderTargetWidth, m_renderTargetHeight)));
|
||||
|
||||
}
|
||||
|
||||
shared_ptr<yg::gl::BaseTexture> ResourceManager::createRenderTarget(unsigned w, unsigned h)
|
||||
|
@ -245,6 +273,11 @@ namespace yg
|
|||
return m_blitStorages;
|
||||
}
|
||||
|
||||
ThreadedList<gl::Storage> & ResourceManager::multiBlitStorages()
|
||||
{
|
||||
return m_multiBlitStorages;
|
||||
}
|
||||
|
||||
ThreadedList<shared_ptr<gl::BaseTexture> > & ResourceManager::dynamicTextures()
|
||||
{
|
||||
return m_dynamicTextures;
|
||||
|
|
|
@ -63,9 +63,13 @@ namespace yg
|
|||
size_t m_blitVBSize;
|
||||
size_t m_blitIBSize;
|
||||
|
||||
size_t m_multiBlitVBSize;
|
||||
size_t m_multiBlitIBSize;
|
||||
|
||||
ThreadedList<gl::Storage> m_storages;
|
||||
ThreadedList<gl::Storage> m_smallStorages;
|
||||
ThreadedList<gl::Storage> m_blitStorages;
|
||||
ThreadedList<gl::Storage> m_multiBlitStorages;
|
||||
|
||||
vector<GlyphCache> m_glyphCaches;
|
||||
|
||||
|
@ -75,6 +79,8 @@ namespace yg
|
|||
|
||||
size_t m_storagesCount;
|
||||
size_t m_smallStoragesCount;
|
||||
size_t m_multiBlitStoragesCount;
|
||||
size_t m_renderTargetsCount;
|
||||
size_t m_blitStoragesCount;
|
||||
size_t m_dynamicTexturesCount;
|
||||
size_t m_fontTexturesCount;
|
||||
|
@ -92,6 +98,7 @@ namespace yg
|
|||
RtFormat fmt,
|
||||
bool useVA);
|
||||
|
||||
void initMultiBlitStorage(size_t multiBlitVBSize, size_t multiBlitIBSize, size_t multiBlitStoragesCount);
|
||||
void initRenderTargets(size_t renderTargetWidth, size_t renderTargetHeight, size_t renderTargetCount);
|
||||
|
||||
shared_ptr<gl::BaseTexture> const & getTexture(string const & fileName);
|
||||
|
@ -99,6 +106,8 @@ namespace yg
|
|||
ThreadedList<gl::Storage> & storages();
|
||||
ThreadedList<gl::Storage> & smallStorages();
|
||||
ThreadedList<gl::Storage> & blitStorages();
|
||||
ThreadedList<gl::Storage> & multiBlitStorages();
|
||||
|
||||
ThreadedList<shared_ptr<gl::BaseTexture> > & dynamicTextures();
|
||||
ThreadedList<shared_ptr<gl::BaseTexture> > & fontTextures();
|
||||
ThreadedList<shared_ptr<gl::BaseTexture> > & renderTargets();
|
||||
|
|
Loading…
Add table
Reference in a new issue