17 std::unique_ptr<ProcTableGLES> gl,
18 const std::vector<std::shared_ptr<fml::Mapping>>& shader_libraries,
19 bool enable_gpu_tracing) {
20 return std::shared_ptr<ContextGLES>(
21 new ContextGLES(std::move(gl), shader_libraries, enable_gpu_tracing));
24 ContextGLES::ContextGLES(
25 std::unique_ptr<ProcTableGLES> gl,
26 const std::vector<std::shared_ptr<fml::Mapping>>& shader_libraries_mappings,
27 bool enable_gpu_tracing) {
28 reactor_ = std::make_shared<ReactorGLES>(std::move(gl));
29 if (!reactor_->IsValid()) {
36 auto library = std::shared_ptr<ShaderLibraryGLES>(
37 new ShaderLibraryGLES(shader_libraries_mappings));
38 if (!library->IsValid()) {
42 shader_library_ = std::move(library);
48 std::shared_ptr<PipelineLibraryGLES>(
new PipelineLibraryGLES(reactor_));
54 std::shared_ptr<AllocatorGLES>(
new AllocatorGLES(reactor_));
55 if (!resource_allocator_->IsValid()) {
61 device_capabilities_ = reactor_->GetProcTable().GetCapabilities();
66 std::shared_ptr<SamplerLibraryGLES>(
new SamplerLibraryGLES(
67 device_capabilities_->SupportsDecalSamplerAddressMode()));
71 command_queue_ = std::make_shared<CommandQueue>();
86 const std::shared_ptr<ReactorGLES::Worker>& worker) {
90 return reactor_->AddWorker(worker);
97 return reactor_->RemoveWorker(
id);
100 bool ContextGLES::IsValid()
const {
104 void ContextGLES::Shutdown() {}
107 std::string ContextGLES::DescribeGpuModel()
const {
108 return reactor_->GetProcTable().GetDescription()->GetString();
112 std::shared_ptr<Allocator> ContextGLES::GetResourceAllocator()
const {
113 return resource_allocator_;
117 std::shared_ptr<ShaderLibrary> ContextGLES::GetShaderLibrary()
const {
118 return shader_library_;
122 std::shared_ptr<SamplerLibrary> ContextGLES::GetSamplerLibrary()
const {
123 return sampler_library_;
127 std::shared_ptr<PipelineLibrary> ContextGLES::GetPipelineLibrary()
const {
128 return pipeline_library_;
132 std::shared_ptr<CommandBuffer> ContextGLES::CreateCommandBuffer()
const {
133 return std::shared_ptr<CommandBufferGLES>(
134 new CommandBufferGLES(weak_from_this(), reactor_));
138 const std::shared_ptr<const Capabilities>& ContextGLES::GetCapabilities()
140 return device_capabilities_;
144 std::shared_ptr<CommandQueue> ContextGLES::GetCommandQueue()
const {
145 return command_queue_;