1 // Copyright 2018 The Dawn Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef DAWNNATIVE_OPENGL_FORWARD_H_ 16 #define DAWNNATIVE_OPENGL_FORWARD_H_ 17 18 #include "dawn_native/ToBackend.h" 19 20 namespace dawn_native { namespace opengl { 21 22 class Adapter; 23 class BindGroup; 24 class BindGroupLayout; 25 class Buffer; 26 class CommandBuffer; 27 class ComputePipeline; 28 class Device; 29 class PersistentPipelineState; 30 class PipelineLayout; 31 class QuerySet; 32 class Queue; 33 class RenderPipeline; 34 class Sampler; 35 class ShaderModule; 36 class SwapChain; 37 class Texture; 38 class TextureView; 39 40 struct OpenGLBackendTraits { 41 using AdapterType = Adapter; 42 using BindGroupType = BindGroup; 43 using BindGroupLayoutType = BindGroupLayout; 44 using BufferType = Buffer; 45 using CommandBufferType = CommandBuffer; 46 using ComputePipelineType = ComputePipeline; 47 using DeviceType = Device; 48 using PipelineLayoutType = PipelineLayout; 49 using QuerySetType = QuerySet; 50 using QueueType = Queue; 51 using RenderPipelineType = RenderPipeline; 52 using SamplerType = Sampler; 53 using ShaderModuleType = ShaderModule; 54 using SwapChainType = SwapChain; 55 using TextureType = Texture; 56 using TextureViewType = TextureView; 57 }; 58 59 template <typename T> 60 auto ToBackend(T&& common) -> decltype(ToBackendBase<OpenGLBackendTraits>(common)) { 61 return ToBackendBase<OpenGLBackendTraits>(common); 62 } 63 64 }} // namespace dawn_native::opengl 65 66 #endif // DAWNNATIVE_OPENGL_FORWARD_H_ 67