16 std::unique_ptr<ProcTableGLES> gl,
17 const std::vector<std::shared_ptr<fml::Mapping>>& shader_libraries,
18 bool enable_gpu_tracing) {
19 return std::shared_ptr<ContextGLES>(
20 new ContextGLES(std::move(gl), shader_libraries, enable_gpu_tracing));
23 ContextGLES::ContextGLES(
24 std::unique_ptr<ProcTableGLES> gl,
25 const std::vector<std::shared_ptr<fml::Mapping>>& shader_libraries_mappings,
26 bool enable_gpu_tracing) {
27 reactor_ = std::make_shared<ReactorGLES>(std::move(gl));
28 if (!reactor_->IsValid()) {
35 auto library = std::shared_ptr<ShaderLibraryGLES>(
36 new ShaderLibraryGLES(shader_libraries_mappings));
37 if (!library->IsValid()) {
41 shader_library_ = std::move(library);
47 std::shared_ptr<PipelineLibraryGLES>(
new PipelineLibraryGLES(reactor_));
53 std::shared_ptr<AllocatorGLES>(
new AllocatorGLES(reactor_));
54 if (!resource_allocator_->IsValid()) {
60 device_capabilities_ = reactor_->GetProcTable().GetCapabilities();
65 std::shared_ptr<SamplerLibraryGLES>(
new SamplerLibraryGLES(
66 device_capabilities_->SupportsDecalSamplerAddressMode()));
68 gpu_tracer_ = std::make_shared<GPUTracerGLES>(
GetReactor()->GetProcTable(),
84 const std::shared_ptr<ReactorGLES::Worker>& worker) {
88 return reactor_->AddWorker(worker);
95 return reactor_->RemoveWorker(
id);
98 bool ContextGLES::IsValid()
const {
102 void ContextGLES::Shutdown() {}
105 std::string ContextGLES::DescribeGpuModel()
const {
106 return reactor_->GetProcTable().GetDescription()->GetString();
110 std::shared_ptr<Allocator> ContextGLES::GetResourceAllocator()
const {
111 return resource_allocator_;
115 std::shared_ptr<ShaderLibrary> ContextGLES::GetShaderLibrary()
const {
116 return shader_library_;
120 std::shared_ptr<SamplerLibrary> ContextGLES::GetSamplerLibrary()
const {
121 return sampler_library_;
125 std::shared_ptr<PipelineLibrary> ContextGLES::GetPipelineLibrary()
const {
126 return pipeline_library_;
130 std::shared_ptr<CommandBuffer> ContextGLES::CreateCommandBuffer()
const {
131 return std::shared_ptr<CommandBufferGLES>(
132 new CommandBufferGLES(weak_from_this(), reactor_));
136 const std::shared_ptr<const Capabilities>& ContextGLES::GetCapabilities()
138 return device_capabilities_;