• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 QuerySet;
32     class Queue;
33     class RenderPipeline;
34     class Sampler;
35     class ShaderModule;
36     class StagingBuffer;
37     class SwapChain;
38     class Texture;
39     class TextureView;
40 
41     struct D3D12BackendTraits {
42         using AdapterType = Adapter;
43         using BindGroupType = BindGroup;
44         using BindGroupLayoutType = BindGroupLayout;
45         using BufferType = Buffer;
46         using CommandBufferType = CommandBuffer;
47         using ComputePipelineType = ComputePipeline;
48         using DeviceType = Device;
49         using PipelineLayoutType = PipelineLayout;
50         using QuerySetType = QuerySet;
51         using QueueType = Queue;
52         using RenderPipelineType = RenderPipeline;
53         using ResourceHeapType = Heap;
54         using SamplerType = Sampler;
55         using ShaderModuleType = ShaderModule;
56         using StagingBufferType = StagingBuffer;
57         using SwapChainType = SwapChain;
58         using TextureType = Texture;
59         using TextureViewType = TextureView;
60     };
61 
62     template <typename T>
63     auto ToBackend(T&& common) -> decltype(ToBackendBase<D3D12BackendTraits>(common)) {
64         return ToBackendBase<D3D12BackendTraits>(common);
65     }
66 
67 }}  // namespace dawn_native::d3d12
68 
69 #endif  // DAWNNATIVE_D3D12_FORWARD_H_
70