Files
comaps/shaders/program_manager_metal.mm
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

29 lines
1.2 KiB
Plaintext

#include "shaders/program_manager.hpp"
#include "shaders/metal_program_params.hpp"
#include "shaders/metal_program_pool.hpp"
#include "drape/metal/metal_base_context.hpp"
namespace gpu
{
void ProgramManager::InitForMetal(ref_ptr<dp::GraphicsContext> context)
{
ASSERT(dynamic_cast<dp::metal::MetalBaseContext *>(context.get()) != nullptr, ());
ref_ptr<dp::metal::MetalBaseContext> metalContext = context;
m_pool = make_unique_dp<metal::MetalProgramPool>(metalContext->GetMetalDevice());
m_paramsSetter = make_unique_dp<metal::MetalProgramParamsSetter>();
ref_ptr<metal::MetalProgramPool> metalPool = make_ref(m_pool);
metalContext->SetSystemPrograms(metalPool->GetSystemProgram(SystemProgram::ClearColor),
metalPool->GetSystemProgram(SystemProgram::ClearDepth),
metalPool->GetSystemProgram(SystemProgram::ClearColorAndDepth));
}
void ProgramManager::DestroyForMetal(ref_ptr<dp::GraphicsContext> context)
{
ASSERT(dynamic_cast<dp::metal::MetalBaseContext *>(context.get()) != nullptr, ());
ref_ptr<dp::metal::MetalBaseContext> metalContext = context;
metalContext->ResetPipelineStatesCache();
}
} // namespace gpu