blob: 5cf1baf5b4d8bb6b1d564d6360b2dd7b30a4a8a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#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
|