MCPcopy Create free account
hub / github.com/comaps/comaps / InitForOpenGL

Method InitForOpenGL

libs/shaders/program_manager.cpp:59–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void ProgramManager::InitForOpenGL(ref_ptr<dp::GraphicsContext> context)
60{
61 std::string globalDefines;
62
63 // This feature is not supported on some Android devices (especially on Android 4.x version).
64 // Since we can't predict on which devices it'll work fine, we have to turn off for all devices.
65#if !defined(OMIM_OS_ANDROID)
66 if (GLFunctions::glGetInteger(gl_const::GLMaxVertexTextures) > 0)
67 {
68 LOG(LINFO, ("VTF enabled"));
69 globalDefines.append("#define ENABLE_VTF\n"); // VTF == Vertex Texture Fetch
70 }
71#endif
72
73 auto const apiVersion = context->GetApiVersion();
74 m_pool = make_unique_dp<GLProgramPool>(apiVersion);
75 ref_ptr<GLProgramPool> pool = make_ref(m_pool);
76 pool->SetDefines(globalDefines);
77
78 m_paramsSetter = make_unique_dp<GLProgramParamsSetter>();
79}
80
81void ProgramManager::InitForVulkan(ref_ptr<dp::GraphicsContext> context)
82{

Callers

nothing calls this directly

Calls 4

make_refFunction · 0.85
SetDefinesMethod · 0.80
appendMethod · 0.45
GetApiVersionMethod · 0.45

Tested by

no test coverage detected