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_D3D12_FORWARD_H_ 16 #define DAWNNATIVE_D3D12_FORWARD_H_ 17 18 #include "dawn_native/ToBackend.h" 19 20 namespace dawn_native { namespace d3d12 { 21 22 class Adapter; 23 class BindGroup; 24 class BindGroupLayout; 25 class Buffer; 26 class CommandBuffer; 27 class ComputePipeline; 28 class Device; 29 class Heap; 30 class PipelineLayout; 31 class Queue; 32 class RenderPipeline; 33 class Sampler; 34 class ShaderModule; 35 class StagingBuffer; 36 class SwapChain; 37 class Texture; 38 class TextureView; 39 40 struct D3D12BackendTraits { 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 QueueType = Queue; 50 using RenderPipelineType = RenderPipeline; 51 using ResourceHeapType = Heap; 52 using SamplerType = Sampler; 53 using ShaderModuleType = ShaderModule; 54 using StagingBufferType = StagingBuffer; 55 using SwapChainType = SwapChain; 56 using TextureType = Texture; 57 using TextureViewType = TextureView; 58 }; 59 60 template <typename T> 61 auto ToBackend(T&& common) -> decltype(ToBackendBase<D3D12BackendTraits>(common)) { 62 return ToBackendBase<D3D12BackendTraits>(common); 63 } 64 65 }} // namespace dawn_native::d3d12 66 67 #endif // DAWNNATIVE_D3D12_FORWARD_H_ 68