D3D12: Split D3D12Backend in Forward.h and DeviceD3D12

This commit is contained in:
Corentin Wallez 2018-06-18 19:26:12 -04:00 committed by Corentin Wallez
parent 1f51263672
commit a2f9277dac
23 changed files with 98 additions and 74 deletions

View File

@ -233,8 +233,9 @@ if (NXT_ENABLE_D3D12)
${D3D12_DIR}/DepthStencilStateD3D12.h
${D3D12_DIR}/DescriptorHeapAllocator.cpp
${D3D12_DIR}/DescriptorHeapAllocator.h
${D3D12_DIR}/D3D12Backend.cpp
${D3D12_DIR}/D3D12Backend.h
${D3D12_DIR}/DeviceD3D12.cpp
${D3D12_DIR}/DeviceD3D12.h
${D3D12_DIR}/Forward.h
${D3D12_DIR}/InputStateD3D12.cpp
${D3D12_DIR}/InputStateD3D12.h
${D3D12_DIR}/NativeSwapChainImplD3D12.cpp

View File

@ -19,7 +19,7 @@
#include "backend/d3d12/TextureD3D12.h"
#include "common/BitSetIterator.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
namespace backend { namespace d3d12 {

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/BindGroupLayoutD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "common/BitSetIterator.h"
namespace backend { namespace d3d12 {

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/BlendStateD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "common/Assert.h"
namespace backend { namespace d3d12 {

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/BufferD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/ResourceAllocator.h"
#include "backend/d3d12/ResourceUploader.h"
#include "common/Assert.h"

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/CommandAllocatorManager.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "common/Assert.h"
#include "common/BitSetIterator.h"

View File

@ -19,8 +19,8 @@
#include "backend/d3d12/BindGroupLayoutD3D12.h"
#include "backend/d3d12/BufferD3D12.h"
#include "backend/d3d12/ComputePipelineD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DescriptorHeapAllocator.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/InputStateD3D12.h"
#include "backend/d3d12/PipelineLayoutD3D12.h"
#include "backend/d3d12/RenderPassDescriptorD3D12.h"

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/ComputePipelineD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/PipelineLayoutD3D12.h"
#include "backend/d3d12/ShaderModuleD3D12.h"
#include "common/Assert.h"

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/DescriptorHeapAllocator.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "common/Assert.h"
namespace backend { namespace d3d12 {

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/BindGroupD3D12.h"
#include "backend/d3d12/BindGroupLayoutD3D12.h"

View File

@ -12,72 +12,24 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef BACKEND_D3D12_D3D12BACKEND_H_
#define BACKEND_D3D12_D3D12BACKEND_H_
#ifndef BACKEND_D3D12_DEVICED3D12_H_
#define BACKEND_D3D12_DEVICED3D12_H_
#include "nxt/nxtcpp.h"
#include "backend/DepthStencilState.h"
#include "backend/Device.h"
#include "backend/ToBackend.h"
#include "backend/d3d12/Forward.h"
#include "backend/d3d12/d3d12_platform.h"
#include "common/SerialQueue.h"
namespace backend { namespace d3d12 {
class BindGroup;
class BindGroupLayout;
class BlendState;
class Buffer;
class BufferView;
class CommandBuffer;
class ComputePipeline;
class DepthStencilState;
class Device;
class InputState;
class PipelineLayout;
class Queue;
class RenderPassDescriptor;
class RenderPipeline;
class Sampler;
class ShaderModule;
class SwapChain;
class Texture;
class TextureView;
class CommandAllocatorManager;
class DescriptorHeapAllocator;
class MapRequestTracker;
class ResourceAllocator;
class ResourceUploader;
struct D3D12BackendTraits {
using BindGroupType = BindGroup;
using BindGroupLayoutType = BindGroupLayout;
using BlendStateType = BlendState;
using BufferType = Buffer;
using BufferViewType = BufferView;
using CommandBufferType = CommandBuffer;
using ComputePipelineType = ComputePipeline;
using DepthStencilStateType = DepthStencilState;
using DeviceType = Device;
using InputStateType = InputState;
using PipelineLayoutType = PipelineLayout;
using QueueType = Queue;
using RenderPassDescriptorType = RenderPassDescriptor;
using RenderPipelineType = RenderPipeline;
using SamplerType = Sampler;
using ShaderModuleType = ShaderModule;
using SwapChainType = SwapChain;
using TextureType = Texture;
using TextureViewType = TextureView;
};
template <typename T>
auto ToBackend(T&& common) -> decltype(ToBackendBase<D3D12BackendTraits>(common)) {
return ToBackendBase<D3D12BackendTraits>(common);
}
void ASSERT_SUCCESS(HRESULT hr);
// Definition of backend types
@ -156,4 +108,4 @@ namespace backend { namespace d3d12 {
}} // namespace backend::d3d12
#endif // BACKEND_D3D12_D3D12BACKEND_H_
#endif // BACKEND_D3D12_DEVICED3D12_H_

View File

@ -0,0 +1,71 @@
// Copyright 2018 The NXT Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef BACKEND_D3D12_FORWARD_H_
#define BACKEND_D3D12_FORWARD_H_
#include "backend/ToBackend.h"
namespace backend { namespace d3d12 {
class BindGroup;
class BindGroupLayout;
class BlendState;
class Buffer;
class BufferView;
class CommandBuffer;
class ComputePipeline;
class DepthStencilState;
class Device;
class InputState;
class PipelineLayout;
class Queue;
class RenderPassDescriptor;
class RenderPipeline;
class Sampler;
class ShaderModule;
class SwapChain;
class Texture;
class TextureView;
struct D3D12BackendTraits {
using BindGroupType = BindGroup;
using BindGroupLayoutType = BindGroupLayout;
using BlendStateType = BlendState;
using BufferType = Buffer;
using BufferViewType = BufferView;
using CommandBufferType = CommandBuffer;
using ComputePipelineType = ComputePipeline;
using DepthStencilStateType = DepthStencilState;
using DeviceType = Device;
using InputStateType = InputState;
using PipelineLayoutType = PipelineLayout;
using QueueType = Queue;
using RenderPassDescriptorType = RenderPassDescriptor;
using RenderPipelineType = RenderPipeline;
using SamplerType = Sampler;
using ShaderModuleType = ShaderModule;
using SwapChainType = SwapChain;
using TextureType = Texture;
using TextureViewType = TextureView;
};
template <typename T>
auto ToBackend(T&& common) -> decltype(ToBackendBase<D3D12BackendTraits>(common)) {
return ToBackendBase<D3D12BackendTraits>(common);
}
}} // namespace backend::d3d12
#endif // BACKEND_D3D12_FORWARD_H_

View File

@ -18,8 +18,8 @@
#include "backend/d3d12/BufferD3D12.h"
#include "backend/d3d12/CommandBufferD3D12.h"
#include "backend/d3d12/ComputePipelineD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DepthStencilStateD3D12.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/InputStateD3D12.h"
#include "backend/d3d12/PipelineLayoutD3D12.h"
#include "backend/d3d12/QueueD3D12.h"

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/NativeSwapChainImplD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/TextureD3D12.h"
#include "common/Assert.h"

View File

@ -15,7 +15,7 @@
#include "backend/d3d12/PipelineLayoutD3D12.h"
#include "backend/d3d12/BindGroupLayoutD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "common/Assert.h"
using Microsoft::WRL::ComPtr;

View File

@ -15,7 +15,7 @@
#include "backend/d3d12/QueueD3D12.h"
#include "backend/d3d12/CommandBufferD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
namespace backend { namespace d3d12 {

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/RenderPassDescriptorD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/TextureD3D12.h"
#include "common/BitSetIterator.h"

View File

@ -15,8 +15,8 @@
#include "backend/d3d12/RenderPipelineD3D12.h"
#include "backend/d3d12/BlendStateD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DepthStencilStateD3D12.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/InputStateD3D12.h"
#include "backend/d3d12/PipelineLayoutD3D12.h"
#include "backend/d3d12/ShaderModuleD3D12.h"

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/ResourceAllocator.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
namespace backend { namespace d3d12 {

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/ResourceUploader.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/ResourceAllocator.h"
namespace backend { namespace d3d12 {

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/SamplerD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
namespace backend { namespace d3d12 {

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/SwapChainD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/TextureD3D12.h"
#include <nxt/nxt_wsi.h>

View File

@ -14,7 +14,7 @@
#include "backend/d3d12/TextureD3D12.h"
#include "backend/d3d12/D3D12Backend.h"
#include "backend/d3d12/DeviceD3D12.h"
#include "backend/d3d12/ResourceAllocator.h"
namespace backend { namespace d3d12 {