forked from organicmaps/organicmaps-tmp
filtering "Vivante Corporation" chipsets to use vertex arrays instead of vertex buffers.
This commit is contained in:
parent
b1740c4329
commit
ab02f8cee9
8 changed files with 18 additions and 14 deletions
|
@ -15,7 +15,7 @@ RenderPolicyMT::RenderPolicyMT(VideoTimer * videoTimer,
|
|||
{
|
||||
yg::ResourceManager::Params rmp = rmParams;
|
||||
|
||||
rmp.selectTexRTFormat();
|
||||
rmp.checkDeviceCaps();
|
||||
|
||||
rmp.m_primaryStoragesParams = yg::ResourceManager::StoragePoolParams(5000 * sizeof(yg::gl::Vertex),
|
||||
sizeof(yg::gl::Vertex),
|
||||
|
@ -109,7 +109,6 @@ RenderPolicyMT::RenderPolicyMT(VideoTimer * videoTimer,
|
|||
1);
|
||||
|
||||
rmp.m_useSingleThreadedOGL = false;
|
||||
rmp.m_useVA = !yg::gl::g_isBufferObjectsSupported;
|
||||
|
||||
rmp.fitIntoLimits();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ RenderPolicyST::RenderPolicyST(VideoTimer * videoTimer,
|
|||
{
|
||||
yg::ResourceManager::Params rmp = rmParams;
|
||||
|
||||
rmp.selectTexRTFormat();
|
||||
rmp.checkDeviceCaps();
|
||||
|
||||
rmp.m_primaryStoragesParams = yg::ResourceManager::StoragePoolParams(5000 * sizeof(yg::gl::Vertex),
|
||||
sizeof(yg::gl::Vertex),
|
||||
|
@ -110,7 +110,6 @@ RenderPolicyST::RenderPolicyST(VideoTimer * videoTimer,
|
|||
1);
|
||||
|
||||
rmp.m_useSingleThreadedOGL = true;
|
||||
rmp.m_useVA = !yg::gl::g_isBufferObjectsSupported;
|
||||
|
||||
rmp.fitIntoLimits();
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ SimpleRenderPolicy::SimpleRenderPolicy(VideoTimer * videoTimer,
|
|||
{
|
||||
yg::ResourceManager::Params rmp = rmParams;
|
||||
|
||||
rmp.selectTexRTFormat();
|
||||
rmp.checkDeviceCaps();
|
||||
|
||||
rmp.m_primaryStoragesParams = yg::ResourceManager::StoragePoolParams(50000 * sizeof(yg::gl::Vertex),
|
||||
sizeof(yg::gl::Vertex),
|
||||
|
@ -90,7 +90,7 @@ SimpleRenderPolicy::SimpleRenderPolicy(VideoTimer * videoTimer,
|
|||
|
||||
|
||||
rmp.m_useSingleThreadedOGL = false;
|
||||
rmp.m_useVA = !yg::gl::g_isBufferObjectsSupported;
|
||||
rmp.fitIntoLimits();
|
||||
|
||||
m_resourceManager.reset(new yg::ResourceManager(rmp));
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ TestRenderPolicy::TestRenderPolicy(VideoTimer * videoTimer,
|
|||
{
|
||||
yg::ResourceManager::Params rmp = rmParams;
|
||||
|
||||
rmp.checkDeviceCaps();
|
||||
|
||||
rmp.m_primaryStoragesParams = yg::ResourceManager::StoragePoolParams(50000 * sizeof(yg::gl::Vertex),
|
||||
sizeof(yg::gl::Vertex),
|
||||
10000 * sizeof(unsigned short),
|
||||
|
@ -87,7 +89,7 @@ TestRenderPolicy::TestRenderPolicy(VideoTimer * videoTimer,
|
|||
|
||||
|
||||
rmp.m_useSingleThreadedOGL = false;
|
||||
rmp.m_useVA = !yg::gl::g_isBufferObjectsSupported;
|
||||
rmp.fitIntoLimits();
|
||||
|
||||
m_resourceManager.reset(new yg::ResourceManager(rmp));
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ TilingRenderPolicyMT::TilingRenderPolicyMT(VideoTimer * videoTimer,
|
|||
{
|
||||
yg::ResourceManager::Params rmp = rmParams;
|
||||
|
||||
rmp.selectTexRTFormat();
|
||||
rmp.checkDeviceCaps();
|
||||
|
||||
rmp.m_primaryTexturesParams = yg::ResourceManager::TexturePoolParams(512,
|
||||
256,
|
||||
|
@ -113,7 +113,7 @@ TilingRenderPolicyMT::TilingRenderPolicyMT(VideoTimer * videoTimer,
|
|||
0);
|
||||
|
||||
rmp.m_useSingleThreadedOGL = false;
|
||||
rmp.m_useVA = !yg::gl::g_isBufferObjectsSupported;
|
||||
rmp.fitIntoLimits();
|
||||
|
||||
m_resourceManager.reset(new yg::ResourceManager(rmp));
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ TilingRenderPolicyST::TilingRenderPolicyST(VideoTimer * videoTimer,
|
|||
{
|
||||
yg::ResourceManager::Params rmp = rmParams;
|
||||
|
||||
rmp.selectTexRTFormat();
|
||||
rmp.checkDeviceCaps();
|
||||
|
||||
rmp.m_primaryTexturesParams = yg::ResourceManager::TexturePoolParams(512,
|
||||
256,
|
||||
|
@ -123,8 +123,6 @@ TilingRenderPolicyST::TilingRenderPolicyST(VideoTimer * videoTimer,
|
|||
// delete [] debuggingFlags;
|
||||
|
||||
rmp.m_useSingleThreadedOGL = true;
|
||||
rmp.m_useVA = !yg::gl::g_isBufferObjectsSupported;
|
||||
|
||||
rmp.fitIntoLimits();
|
||||
|
||||
m_maxTilesCount = rmp.m_renderTargetTexturesParams.m_texCount;
|
||||
|
|
|
@ -403,10 +403,11 @@ namespace
|
|||
&& (m_rendererName.find(rendererName) != string::npos);
|
||||
}
|
||||
|
||||
void ResourceManager::Params::selectTexRTFormat()
|
||||
void ResourceManager::Params::checkDeviceCaps()
|
||||
{
|
||||
/// general case
|
||||
m_texRtFormat = yg::Data4Bpp;
|
||||
m_useVA = !yg::gl::g_isBufferObjectsSupported;
|
||||
|
||||
if (isGPU("Qualcomm", "Adreno", false))
|
||||
m_texRtFormat = yg::Data8Bpp;
|
||||
|
@ -419,6 +420,11 @@ namespace
|
|||
m_rtFormat = yg::Data8Bpp;
|
||||
m_texRtFormat = yg::Data8Bpp;
|
||||
}
|
||||
|
||||
/// filtering all devices from Vivante Corporation
|
||||
/// to use vertex arrays
|
||||
if (isGPU("Vivante Corporation", "", false))
|
||||
m_useVA = true;
|
||||
}
|
||||
|
||||
void ResourceManager::Params::fitIntoLimits()
|
||||
|
|
|
@ -248,7 +248,7 @@ namespace yg
|
|||
Params();
|
||||
|
||||
void distributeFreeMemory(int freeVideoMemory);
|
||||
void selectTexRTFormat();
|
||||
void checkDeviceCaps();
|
||||
void fitIntoLimits();
|
||||
int memoryUsage() const;
|
||||
int fixedMemoryUsage() const;
|
||||
|
|
Loading…
Add table
Reference in a new issue