Remove some useless #include files and forward declarations
BUG=chromium:1161355
Change-Id: Ie4d0e5da22f4b7a66591265d101f2fbe75a2e00a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/42180
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn_native/CommandEncoder.h b/src/dawn_native/CommandEncoder.h
index f54888f..6698396 100644
--- a/src/dawn_native/CommandEncoder.h
+++ b/src/dawn_native/CommandEncoder.h
@@ -27,8 +27,6 @@
namespace dawn_native {
- struct BeginRenderPassCmd;
-
using QueryAvailabilityMap = std::map<QuerySetBase*, std::vector<bool>>;
class CommandEncoder final : public ObjectBase {
diff --git a/src/dawn_native/CommandValidation.h b/src/dawn_native/CommandValidation.h
index 3909203..f0fbb10 100644
--- a/src/dawn_native/CommandValidation.h
+++ b/src/dawn_native/CommandValidation.h
@@ -23,9 +23,7 @@
namespace dawn_native {
- class AttachmentState;
class QuerySetBase;
- struct BeginRenderPassCmd;
struct PassResourceUsage;
struct TexelBlockInfo;
diff --git a/src/dawn_native/CreatePipelineAsyncTracker.h b/src/dawn_native/CreatePipelineAsyncTracker.h
index 73e366c..438427a 100644
--- a/src/dawn_native/CreatePipelineAsyncTracker.h
+++ b/src/dawn_native/CreatePipelineAsyncTracker.h
@@ -25,7 +25,6 @@
class ComputePipelineBase;
class DeviceBase;
- class PipelineBase;
class RenderPipelineBase;
struct CreatePipelineAsyncTaskBase {
diff --git a/src/dawn_native/ProgrammablePassEncoder.h b/src/dawn_native/ProgrammablePassEncoder.h
index fcb7474..05300e7 100644
--- a/src/dawn_native/ProgrammablePassEncoder.h
+++ b/src/dawn_native/ProgrammablePassEncoder.h
@@ -25,7 +25,6 @@
namespace dawn_native {
- class CommandAllocator;
class DeviceBase;
// Base class for shared functionality between ComputePassEncoder and RenderPassEncoder.
diff --git a/src/dawn_native/QueryHelper.h b/src/dawn_native/QueryHelper.h
index 4f05f09..6e31beb 100644
--- a/src/dawn_native/QueryHelper.h
+++ b/src/dawn_native/QueryHelper.h
@@ -20,7 +20,6 @@
namespace dawn_native {
class BufferBase;
- class DeviceBase;
class CommandEncoder;
struct TimestampParams {
diff --git a/src/dawn_native/RenderBundle.h b/src/dawn_native/RenderBundle.h
index 312954e..41d686a 100644
--- a/src/dawn_native/RenderBundle.h
+++ b/src/dawn_native/RenderBundle.h
@@ -28,7 +28,6 @@
namespace dawn_native {
- struct BeginRenderPassCmd;
struct RenderBundleDescriptor;
class RenderBundleEncoder;
diff --git a/src/dawn_native/RenderPipeline.h b/src/dawn_native/RenderPipeline.h
index b6f047b..812f7ec 100644
--- a/src/dawn_native/RenderPipeline.h
+++ b/src/dawn_native/RenderPipeline.h
@@ -27,11 +27,7 @@
namespace dawn_native {
- struct BeginRenderPassCmd;
-
class DeviceBase;
- struct EntryPointMetadata;
- class RenderBundleEncoder;
MaybeError ValidateRenderPipelineDescriptor(DeviceBase* device,
const RenderPipelineDescriptor* descriptor);
diff --git a/src/dawn_native/d3d12/BindGroupD3D12.h b/src/dawn_native/d3d12/BindGroupD3D12.h
index 60b8368..a48fc14 100644
--- a/src/dawn_native/d3d12/BindGroupD3D12.h
+++ b/src/dawn_native/d3d12/BindGroupD3D12.h
@@ -25,7 +25,6 @@
class Device;
class SamplerHeapCacheEntry;
class ShaderVisibleDescriptorAllocator;
- class StagingDescriptorAllocator;
class BindGroup final : public BindGroupBase, public PlacementAllocated {
public:
diff --git a/src/dawn_native/d3d12/BindGroupLayoutD3D12.h b/src/dawn_native/d3d12/BindGroupLayoutD3D12.h
index c5f32f5..6ee4623 100644
--- a/src/dawn_native/d3d12/BindGroupLayoutD3D12.h
+++ b/src/dawn_native/d3d12/BindGroupLayoutD3D12.h
@@ -26,7 +26,6 @@
class BindGroup;
class CPUDescriptorHeapAllocation;
class Device;
- class SamplerHeapCacheEntry;
class StagingDescriptorAllocator;
class BindGroupLayout final : public BindGroupLayoutBase {
diff --git a/src/dawn_native/d3d12/CommandBufferD3D12.cpp b/src/dawn_native/d3d12/CommandBufferD3D12.cpp
index 861d674..4a9051d 100644
--- a/src/dawn_native/d3d12/CommandBufferD3D12.cpp
+++ b/src/dawn_native/d3d12/CommandBufferD3D12.cpp
@@ -14,17 +14,11 @@
#include "dawn_native/d3d12/CommandBufferD3D12.h"
-#include "common/Assert.h"
#include "dawn_native/BindGroupTracker.h"
-#include "dawn_native/CommandEncoder.h"
#include "dawn_native/CommandValidation.h"
-#include "dawn_native/Commands.h"
-#include "dawn_native/EnumMaskIterator.h"
#include "dawn_native/RenderBundle.h"
#include "dawn_native/d3d12/BindGroupD3D12.h"
#include "dawn_native/d3d12/BindGroupLayoutD3D12.h"
-#include "dawn_native/d3d12/BufferD3D12.h"
-#include "dawn_native/d3d12/CommandRecordingContext.h"
#include "dawn_native/d3d12/ComputePipelineD3D12.h"
#include "dawn_native/d3d12/DeviceD3D12.h"
#include "dawn_native/d3d12/PipelineLayoutD3D12.h"
@@ -32,16 +26,10 @@
#include "dawn_native/d3d12/QuerySetD3D12.h"
#include "dawn_native/d3d12/RenderPassBuilderD3D12.h"
#include "dawn_native/d3d12/RenderPipelineD3D12.h"
-#include "dawn_native/d3d12/SamplerD3D12.h"
-#include "dawn_native/d3d12/SamplerHeapCacheD3D12.h"
#include "dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h"
#include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h"
-#include "dawn_native/d3d12/TextureCopySplitter.h"
-#include "dawn_native/d3d12/TextureD3D12.h"
#include "dawn_native/d3d12/UtilsD3D12.h"
-#include <deque>
-
namespace dawn_native { namespace d3d12 {
namespace {
diff --git a/src/dawn_native/d3d12/CommandBufferD3D12.h b/src/dawn_native/d3d12/CommandBufferD3D12.h
index f4d858c..cf4c451 100644
--- a/src/dawn_native/d3d12/CommandBufferD3D12.h
+++ b/src/dawn_native/d3d12/CommandBufferD3D12.h
@@ -15,12 +15,8 @@
#ifndef DAWNNATIVE_D3D12_COMMANDBUFFERD3D12_H_
#define DAWNNATIVE_D3D12_COMMANDBUFFERD3D12_H_
-#include "common/Constants.h"
#include "dawn_native/CommandBuffer.h"
#include "dawn_native/Error.h"
-#include "dawn_native/d3d12/Forward.h"
-
-#include <array>
namespace dawn_native {
struct BeginRenderPassCmd;
@@ -30,10 +26,7 @@
class BindGroupStateTracker;
class CommandRecordingContext;
- class Device;
- class RenderPassDescriptorHeapTracker;
class RenderPassBuilder;
- class RenderPipeline;
class CommandBuffer final : public CommandBufferBase {
public:
diff --git a/src/dawn_native/d3d12/CommandRecordingContext.h b/src/dawn_native/d3d12/CommandRecordingContext.h
index d734b44..4fc089d 100644
--- a/src/dawn_native/d3d12/CommandRecordingContext.h
+++ b/src/dawn_native/d3d12/CommandRecordingContext.h
@@ -15,13 +15,15 @@
#define DAWNNATIVE_D3D12_COMMANDRECORDINGCONTEXT_H_
#include "dawn_native/Error.h"
-#include "dawn_native/d3d12/TextureD3D12.h"
+#include "dawn_native/IntegerTypes.h"
#include "dawn_native/d3d12/d3d12_platform.h"
#include <set>
namespace dawn_native { namespace d3d12 {
class CommandAllocatorManager;
+ class Device;
+ class Heap;
class Texture;
class CommandRecordingContext {
diff --git a/src/dawn_native/d3d12/DeviceD3D12.cpp b/src/dawn_native/d3d12/DeviceD3D12.cpp
index d116303..9d5041f 100644
--- a/src/dawn_native/d3d12/DeviceD3D12.cpp
+++ b/src/dawn_native/d3d12/DeviceD3D12.cpp
@@ -14,16 +14,11 @@
#include "dawn_native/d3d12/DeviceD3D12.h"
-#include "common/Assert.h"
-#include "dawn_native/BackendConnection.h"
-#include "dawn_native/ErrorData.h"
-#include "dawn_native/Format.h"
#include "dawn_native/Instance.h"
#include "dawn_native/d3d12/AdapterD3D12.h"
#include "dawn_native/d3d12/BackendD3D12.h"
#include "dawn_native/d3d12/BindGroupD3D12.h"
#include "dawn_native/d3d12/BindGroupLayoutD3D12.h"
-#include "dawn_native/d3d12/BufferD3D12.h"
#include "dawn_native/d3d12/CommandAllocatorManager.h"
#include "dawn_native/d3d12/CommandBufferD3D12.h"
#include "dawn_native/d3d12/ComputePipelineD3D12.h"
@@ -42,7 +37,6 @@
#include "dawn_native/d3d12/StagingBufferD3D12.h"
#include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h"
#include "dawn_native/d3d12/SwapChainD3D12.h"
-#include "dawn_native/d3d12/TextureD3D12.h"
#include "dawn_native/d3d12/UtilsD3D12.h"
#include <sstream>
diff --git a/src/dawn_native/d3d12/DeviceD3D12.h b/src/dawn_native/d3d12/DeviceD3D12.h
index c35df07..113f819 100644
--- a/src/dawn_native/d3d12/DeviceD3D12.h
+++ b/src/dawn_native/d3d12/DeviceD3D12.h
@@ -15,24 +15,16 @@
#ifndef DAWNNATIVE_D3D12_DEVICED3D12_H_
#define DAWNNATIVE_D3D12_DEVICED3D12_H_
-#include "dawn_native/dawn_platform.h"
-
-#include "common/Constants.h"
#include "common/SerialQueue.h"
-#include "dawn_native/BindingInfo.h"
-#include "dawn_native/Commands.h"
#include "dawn_native/Device.h"
#include "dawn_native/d3d12/CommandRecordingContext.h"
#include "dawn_native/d3d12/D3D12Info.h"
#include "dawn_native/d3d12/Forward.h"
-#include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h"
-
-#include <memory>
+#include "dawn_native/d3d12/TextureD3D12.h"
namespace dawn_native { namespace d3d12 {
class CommandAllocatorManager;
- class DescriptorHeapAllocator;
class PlatformFunctions;
class ResidencyManager;
class ResourceAllocatorManager;
diff --git a/src/dawn_native/d3d12/QueueD3D12.h b/src/dawn_native/d3d12/QueueD3D12.h
index f211d0b..311c607 100644
--- a/src/dawn_native/d3d12/QueueD3D12.h
+++ b/src/dawn_native/d3d12/QueueD3D12.h
@@ -23,7 +23,6 @@
namespace dawn_native { namespace d3d12 {
class Device;
- class CommandBuffer;
class Queue final : public QueueBase {
public:
diff --git a/src/dawn_native/d3d12/SamplerHeapCacheD3D12.h b/src/dawn_native/d3d12/SamplerHeapCacheD3D12.h
index 2e5a2d4..3e2cf4c 100644
--- a/src/dawn_native/d3d12/SamplerHeapCacheD3D12.h
+++ b/src/dawn_native/d3d12/SamplerHeapCacheD3D12.h
@@ -21,7 +21,6 @@
#include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h"
#include <unordered_set>
-#include <vector>
// |SamplerHeapCacheEntry| maintains a cache of sampler descriptor heap allocations.
// Each entry represents one or more sampler descriptors that co-exist in a CPU and
diff --git a/src/dawn_native/d3d12/StagingBufferD3D12.h b/src/dawn_native/d3d12/StagingBufferD3D12.h
index 291400d..aafe60d 100644
--- a/src/dawn_native/d3d12/StagingBufferD3D12.h
+++ b/src/dawn_native/d3d12/StagingBufferD3D12.h
@@ -21,7 +21,6 @@
namespace dawn_native { namespace d3d12 {
- class CommandRecordingContext;
class Device;
class StagingBuffer : public StagingBufferBase {
diff --git a/src/dawn_native/metal/BindGroupMTL.h b/src/dawn_native/metal/BindGroupMTL.h
index 60cbf31..791dbf9 100644
--- a/src/dawn_native/metal/BindGroupMTL.h
+++ b/src/dawn_native/metal/BindGroupMTL.h
@@ -20,7 +20,6 @@
namespace dawn_native { namespace metal {
- class BindGroupLayout;
class Device;
class BindGroup final : public BindGroupBase, public PlacementAllocated {
diff --git a/src/dawn_native/metal/QueueMTL.h b/src/dawn_native/metal/QueueMTL.h
index 2dd718e..38e79ed 100644
--- a/src/dawn_native/metal/QueueMTL.h
+++ b/src/dawn_native/metal/QueueMTL.h
@@ -19,7 +19,6 @@
namespace dawn_native { namespace metal {
- class CommandBuffer;
class Device;
class Queue final : public QueueBase {
diff --git a/src/dawn_native/opengl/BindGroupGL.h b/src/dawn_native/opengl/BindGroupGL.h
index f9f1151..5544a49 100644
--- a/src/dawn_native/opengl/BindGroupGL.h
+++ b/src/dawn_native/opengl/BindGroupGL.h
@@ -20,7 +20,6 @@
namespace dawn_native { namespace opengl {
- class BindGroupLayout;
class Device;
MaybeError ValidateGLBindGroupDescriptor(const BindGroupDescriptor* descriptor);
diff --git a/src/dawn_native/opengl/CommandBufferGL.h b/src/dawn_native/opengl/CommandBufferGL.h
index 8f300be..c21f574 100644
--- a/src/dawn_native/opengl/CommandBufferGL.h
+++ b/src/dawn_native/opengl/CommandBufferGL.h
@@ -24,7 +24,6 @@
namespace dawn_native { namespace opengl {
class Device;
- struct OpenGLFunctions;
class CommandBuffer final : public CommandBufferBase {
public:
diff --git a/src/dawn_native/opengl/PipelineGL.h b/src/dawn_native/opengl/PipelineGL.h
index 1d995d0..33e5341 100644
--- a/src/dawn_native/opengl/PipelineGL.h
+++ b/src/dawn_native/opengl/PipelineGL.h
@@ -29,7 +29,6 @@
namespace dawn_native { namespace opengl {
struct OpenGLFunctions;
- class PersistentPipelineState;
class PipelineLayout;
class Sampler;
diff --git a/src/dawn_native/opengl/QueueGL.h b/src/dawn_native/opengl/QueueGL.h
index d34ee16..a95e1a4 100644
--- a/src/dawn_native/opengl/QueueGL.h
+++ b/src/dawn_native/opengl/QueueGL.h
@@ -19,7 +19,6 @@
namespace dawn_native { namespace opengl {
- class CommandBuffer;
class Device;
class Queue final : public QueueBase {
diff --git a/src/dawn_native/vulkan/CommandRecordingContext.h b/src/dawn_native/vulkan/CommandRecordingContext.h
index 2749fd2..a8dd68d 100644
--- a/src/dawn_native/vulkan/CommandRecordingContext.h
+++ b/src/dawn_native/vulkan/CommandRecordingContext.h
@@ -18,11 +18,7 @@
#include "dawn_native/vulkan/BufferVk.h"
-#include <vector>
-
namespace dawn_native { namespace vulkan {
- class Buffer;
-
// Used to track operations that are handled after recording.
// Currently only tracks semaphores, but may be used to do barrier coalescing in the future.
struct CommandRecordingContext {
diff --git a/src/dawn_native/vulkan/QueueVk.h b/src/dawn_native/vulkan/QueueVk.h
index d5d15af..b3aa665 100644
--- a/src/dawn_native/vulkan/QueueVk.h
+++ b/src/dawn_native/vulkan/QueueVk.h
@@ -19,7 +19,6 @@
namespace dawn_native { namespace vulkan {
- class CommandBuffer;
class Device;
class Queue final : public QueueBase {