Split backend/common in backend/ and common/
This directory used to contain both the state tracking code for the
backends, and the common utilities that could be used both by the
backends and the rest of the code. Things are now:
- src/common is utility code for the whole repo
- src/backend contains libNXT's code
- src/utils is utility code that we don't want in libNXT
This commit also changes all includes to use global paths from src/
bacause it had to touch a bunch of #include statements anyway.
diff --git a/src/backend/common/BindGroup.cpp b/src/backend/BindGroup.cpp
similarity index 97%
rename from src/backend/common/BindGroup.cpp
rename to src/backend/BindGroup.cpp
index cd50ed8..1e17ed3 100644
--- a/src/backend/common/BindGroup.cpp
+++ b/src/backend/BindGroup.cpp
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BindGroup.h"
+#include "backend/BindGroup.h"
-#include "BindGroupLayout.h"
-#include "Buffer.h"
-#include "Device.h"
-#include "Texture.h"
+#include "backend/BindGroupLayout.h"
+#include "backend/Buffer.h"
+#include "backend/Device.h"
+#include "backend/Texture.h"
namespace backend {
diff --git a/src/backend/common/BindGroup.h b/src/backend/BindGroup.h
similarity index 93%
rename from src/backend/common/BindGroup.h
rename to src/backend/BindGroup.h
index 72ad021..9865513 100644
--- a/src/backend/common/BindGroup.h
+++ b/src/backend/BindGroup.h
@@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_BINDGROUP_H_
-#define BACKEND_COMMON_BINDGROUP_H_
+#ifndef BACKEND_BINDGROUP_H_
+#define BACKEND_BINDGROUP_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/Builder.h"
+#include "backend/Forward.h"
+#include "backend/RefCounted.h"
+#include "common/Constants.h"
#include "nxt/nxtcpp.h"
@@ -89,4 +90,4 @@
}
-#endif // BACKEND_COMMON_BINDGROUP_H_
+#endif // BACKEND_BINDGROUP_H_
diff --git a/src/backend/common/BindGroupLayout.cpp b/src/backend/BindGroupLayout.cpp
similarity index 98%
rename from src/backend/common/BindGroupLayout.cpp
rename to src/backend/BindGroupLayout.cpp
index e72faeb..a757139 100644
--- a/src/backend/common/BindGroupLayout.cpp
+++ b/src/backend/BindGroupLayout.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BindGroupLayout.h"
+#include "backend/BindGroupLayout.h"
-#include "Device.h"
+#include "backend/Device.h"
#include <functional>
diff --git a/src/backend/common/BindGroupLayout.h b/src/backend/BindGroupLayout.h
similarity index 90%
rename from src/backend/common/BindGroupLayout.h
rename to src/backend/BindGroupLayout.h
index d2334d2..77fcb57 100644
--- a/src/backend/common/BindGroupLayout.h
+++ b/src/backend/BindGroupLayout.h
@@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_BINDGROUPLAYOUT_H_
-#define BACKEND_COMMON_BINDGROUPLAYOUT_H_
+#ifndef BACKEND_BINDGROUPLAYOUT_H_
+#define BACKEND_BINDGROUPLAYOUT_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Builder.h"
+#include "backend/RefCounted.h"
+#include "common/Constants.h"
#include "nxt/nxtcpp.h"
@@ -72,4 +73,4 @@
}
-#endif // BACKEND_COMMON_BINDGROUPLAYOUT_H_
+#endif // BACKEND_BINDGROUPLAYOUT_H_
diff --git a/src/backend/common/Buffer.cpp b/src/backend/Buffer.cpp
similarity index 99%
rename from src/backend/common/Buffer.cpp
rename to src/backend/Buffer.cpp
index 0fa57db..5299f69 100644
--- a/src/backend/common/Buffer.cpp
+++ b/src/backend/Buffer.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "Buffer.h"
+#include "backend/Buffer.h"
-#include "Device.h"
+#include "backend/Device.h"
#include <utility>
#include <cstdio>
diff --git a/src/backend/common/Buffer.h b/src/backend/Buffer.h
similarity index 95%
rename from src/backend/common/Buffer.h
rename to src/backend/Buffer.h
index d09cae2..bace9df 100644
--- a/src/backend/common/Buffer.h
+++ b/src/backend/Buffer.h
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_BUFFER_H_
-#define BACKEND_COMMON_BUFFER_H_
+#ifndef BACKEND_BUFFER_H_
+#define BACKEND_BUFFER_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Builder.h"
+#include "backend/RefCounted.h"
#include "nxt/nxtcpp.h"
@@ -123,4 +123,4 @@
}
-#endif // BACKEND_COMMON_BUFFER_H_
+#endif // BACKEND_BUFFER_H_
diff --git a/src/backend/common/Builder.cpp b/src/backend/Builder.cpp
similarity index 97%
rename from src/backend/common/Builder.cpp
rename to src/backend/Builder.cpp
index 27e3318..de3c8de 100644
--- a/src/backend/common/Builder.cpp
+++ b/src/backend/Builder.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "Builder.h"
+#include "backend/Builder.h"
-#include "Device.h"
+#include "backend/Device.h"
namespace backend {
diff --git a/src/backend/common/Builder.h b/src/backend/Builder.h
similarity index 95%
rename from src/backend/common/Builder.h
rename to src/backend/Builder.h
index 6021e09..ccc57d0 100644
--- a/src/backend/common/Builder.h
+++ b/src/backend/Builder.h
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_BUILDER_H_
-#define BACKEND_COMMON_BUILDER_H_
+#ifndef BACKEND_BUILDER_H_
+#define BACKEND_BUILDER_H_
-#include "Forward.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/RefCounted.h"
#include "nxt/nxtcpp.h"
@@ -107,4 +107,4 @@
}
-#endif // BACKEND_COMMON_BUILDER_H_
+#endif // BACKEND_BUILDER_H_
diff --git a/src/backend/CMakeLists.txt b/src/backend/CMakeLists.txt
index a19870e..6da612b 100644
--- a/src/backend/CMakeLists.txt
+++ b/src/backend/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-set(COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/common)
+set(BACKEND_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(METAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/metal)
set(NULL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/null)
set(OPENGL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/opengl)
@@ -20,52 +20,48 @@
set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
list(APPEND BACKEND_SOURCES
- ${COMMON_DIR}/BindGroup.cpp
- ${COMMON_DIR}/BindGroup.h
- ${COMMON_DIR}/BindGroupLayout.cpp
- ${COMMON_DIR}/BindGroupLayout.h
- ${COMMON_DIR}/BitSetIterator.h
- ${COMMON_DIR}/Builder.cpp
- ${COMMON_DIR}/Builder.h
- ${COMMON_DIR}/Buffer.cpp
- ${COMMON_DIR}/Buffer.h
- ${COMMON_DIR}/CommandAllocator.cpp
- ${COMMON_DIR}/CommandAllocator.h
- ${COMMON_DIR}/CommandBuffer.cpp
- ${COMMON_DIR}/CommandBuffer.h
- ${COMMON_DIR}/DepthStencilState.cpp
- ${COMMON_DIR}/DepthStencilState.h
- ${COMMON_DIR}/CommandBufferStateTracker.cpp
- ${COMMON_DIR}/CommandBufferStateTracker.h
- ${COMMON_DIR}/Device.cpp
- ${COMMON_DIR}/Device.h
- ${COMMON_DIR}/Forward.h
- ${COMMON_DIR}/Framebuffer.cpp
- ${COMMON_DIR}/Framebuffer.h
- ${COMMON_DIR}/InputState.cpp
- ${COMMON_DIR}/InputState.h
- ${COMMON_DIR}/Math.cpp
- ${COMMON_DIR}/Math.h
- ${COMMON_DIR}/PerStage.cpp
- ${COMMON_DIR}/PerStage.h
- ${COMMON_DIR}/Pipeline.cpp
- ${COMMON_DIR}/Pipeline.h
- ${COMMON_DIR}/PipelineLayout.cpp
- ${COMMON_DIR}/PipelineLayout.h
- ${COMMON_DIR}/Queue.cpp
- ${COMMON_DIR}/Queue.h
- ${COMMON_DIR}/RenderPass.cpp
- ${COMMON_DIR}/RenderPass.h
- ${COMMON_DIR}/RefCounted.cpp
- ${COMMON_DIR}/RefCounted.h
- ${COMMON_DIR}/Sampler.cpp
- ${COMMON_DIR}/Sampler.h
- ${COMMON_DIR}/SerialQueue.h
- ${COMMON_DIR}/ShaderModule.cpp
- ${COMMON_DIR}/ShaderModule.h
- ${COMMON_DIR}/Texture.cpp
- ${COMMON_DIR}/Texture.h
- ${COMMON_DIR}/ToBackend.h
+ ${BACKEND_DIR}/BindGroup.cpp
+ ${BACKEND_DIR}/BindGroup.h
+ ${BACKEND_DIR}/BindGroupLayout.cpp
+ ${BACKEND_DIR}/BindGroupLayout.h
+ ${BACKEND_DIR}/Builder.cpp
+ ${BACKEND_DIR}/Builder.h
+ ${BACKEND_DIR}/Buffer.cpp
+ ${BACKEND_DIR}/Buffer.h
+ ${BACKEND_DIR}/CommandAllocator.cpp
+ ${BACKEND_DIR}/CommandAllocator.h
+ ${BACKEND_DIR}/CommandBuffer.cpp
+ ${BACKEND_DIR}/CommandBuffer.h
+ ${BACKEND_DIR}/DepthStencilState.cpp
+ ${BACKEND_DIR}/DepthStencilState.h
+ ${BACKEND_DIR}/CommandBufferStateTracker.cpp
+ ${BACKEND_DIR}/CommandBufferStateTracker.h
+ ${BACKEND_DIR}/Device.cpp
+ ${BACKEND_DIR}/Device.h
+ ${BACKEND_DIR}/Forward.h
+ ${BACKEND_DIR}/Framebuffer.cpp
+ ${BACKEND_DIR}/Framebuffer.h
+ ${BACKEND_DIR}/InputState.cpp
+ ${BACKEND_DIR}/InputState.h
+ ${BACKEND_DIR}/PerStage.cpp
+ ${BACKEND_DIR}/PerStage.h
+ ${BACKEND_DIR}/Pipeline.cpp
+ ${BACKEND_DIR}/Pipeline.h
+ ${BACKEND_DIR}/PipelineLayout.cpp
+ ${BACKEND_DIR}/PipelineLayout.h
+ ${BACKEND_DIR}/Queue.cpp
+ ${BACKEND_DIR}/Queue.h
+ ${BACKEND_DIR}/RenderPass.cpp
+ ${BACKEND_DIR}/RenderPass.h
+ ${BACKEND_DIR}/RefCounted.cpp
+ ${BACKEND_DIR}/RefCounted.h
+ ${BACKEND_DIR}/Sampler.cpp
+ ${BACKEND_DIR}/Sampler.h
+ ${BACKEND_DIR}/ShaderModule.cpp
+ ${BACKEND_DIR}/ShaderModule.h
+ ${BACKEND_DIR}/Texture.cpp
+ ${BACKEND_DIR}/Texture.h
+ ${BACKEND_DIR}/ToBackend.h
)
# OpenGL Backend
@@ -79,7 +75,7 @@
-T opengl
)
target_link_libraries(opengl_autogen glfw glad nxtcpp)
-target_include_directories(opengl_autogen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+target_include_directories(opengl_autogen PRIVATE ${SRC_DIR})
target_include_directories(opengl_autogen PUBLIC ${GENERATED_DIR})
SetCXX14(opengl_autogen)
SetPIC(opengl_autogen)
@@ -116,7 +112,7 @@
)
target_link_libraries(null_autogen nxtcpp)
target_include_directories(null_autogen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
-target_include_directories(null_autogen PUBLIC ${GENERATED_DIR})
+target_include_directories(null_autogen PUBLIC ${SRC_DIR})
SetCXX14(null_autogen)
SetPIC(null_autogen)
@@ -137,7 +133,7 @@
-T metal
)
target_link_libraries(metal_autogen glfw glad nxtcpp "-framework QuartzCore" "-framework Metal")
- target_include_directories(metal_autogen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+ target_include_directories(metal_autogen PRIVATE ${SRC_DIR})
target_include_directories(metal_autogen PUBLIC ${GENERATED_DIR})
SetCXX14(metal_autogen)
SetPIC(metal_autogen)
@@ -231,7 +227,7 @@
target_link_libraries(d3d12_autogen glfw nxtcpp ${D3D12_LIBRARIES})
target_include_directories(d3d12_autogen SYSTEM PRIVATE ${D3D12_INCLUDE_DIR} ${DXGI_INCLUDE_DIR})
- target_include_directories(d3d12_autogen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+ target_include_directories(d3d12_autogen PRIVATE ${SRC_DIR})
target_include_directories(d3d12_autogen PUBLIC ${GENERATED_DIR})
SetCXX14(d3d12_autogen)
SetPIC(d3d12_autogen)
@@ -274,12 +270,11 @@
add_library(nxt_backend STATIC ${BACKEND_SOURCES})
-target_link_libraries(nxt_backend opengl_autogen null_autogen glfw glad spirv-cross)
+target_link_libraries(nxt_backend nxt_common opengl_autogen null_autogen glfw glad spirv-cross)
if (APPLE)
target_link_libraries(nxt_backend metal_autogen)
endif()
if (WIN32)
target_link_libraries(nxt_backend d3d12_autogen)
endif()
-target_include_directories(nxt_backend PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
SetCXX14(nxt_backend)
diff --git a/src/backend/common/CommandAllocator.cpp b/src/backend/CommandAllocator.cpp
similarity index 98%
rename from src/backend/common/CommandAllocator.cpp
rename to src/backend/CommandAllocator.cpp
index e53ca0d..bc9513f 100644
--- a/src/backend/common/CommandAllocator.cpp
+++ b/src/backend/CommandAllocator.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "CommandAllocator.h"
+#include "backend/CommandAllocator.h"
-#include "Math.h"
+#include "common/Math.h"
#include <algorithm>
#include <cassert>
diff --git a/src/backend/common/CommandAllocator.h b/src/backend/CommandAllocator.h
similarity index 97%
rename from src/backend/common/CommandAllocator.h
rename to src/backend/CommandAllocator.h
index 3633d2e..716c26d 100644
--- a/src/backend/common/CommandAllocator.h
+++ b/src/backend/CommandAllocator.h
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_COMMAND_ALLOCATOR_H_
-#define BACKEND_COMMON_COMMAND_ALLOCATOR_H_
+#ifndef BACKEND_COMMAND_ALLOCATOR_H_
+#define BACKEND_COMMAND_ALLOCATOR_H_
#include <cstdint>
#include <cstddef>
@@ -147,4 +147,4 @@
}
-#endif // BACKEND_COMMON_COMMAND_ALLOCATOR_H_
+#endif // BACKEND_COMMAND_ALLOCATOR_H_
diff --git a/src/backend/common/CommandBuffer.cpp b/src/backend/CommandBuffer.cpp
similarity index 98%
rename from src/backend/common/CommandBuffer.cpp
rename to src/backend/CommandBuffer.cpp
index fbfa4c7..17c55aee 100644
--- a/src/backend/common/CommandBuffer.cpp
+++ b/src/backend/CommandBuffer.cpp
@@ -12,17 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "CommandBuffer.h"
+#include "backend/CommandBuffer.h"
-#include "BindGroup.h"
-#include "Buffer.h"
-#include "Commands.h"
-#include "CommandBufferStateTracker.h"
-#include "Device.h"
-#include "InputState.h"
-#include "Pipeline.h"
-#include "PipelineLayout.h"
-#include "Texture.h"
+#include "backend/BindGroup.h"
+#include "backend/Buffer.h"
+#include "backend/Commands.h"
+#include "backend/CommandBufferStateTracker.h"
+#include "backend/Device.h"
+#include "backend/InputState.h"
+#include "backend/Pipeline.h"
+#include "backend/PipelineLayout.h"
+#include "backend/Texture.h"
#include <cstring>
#include <map>
diff --git a/src/backend/common/CommandBuffer.h b/src/backend/CommandBuffer.h
similarity index 95%
rename from src/backend/common/CommandBuffer.h
rename to src/backend/CommandBuffer.h
index 2f62614..adc5be7 100644
--- a/src/backend/common/CommandBuffer.h
+++ b/src/backend/CommandBuffer.h
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_COMMANDBUFFER_H_
-#define BACKEND_COMMON_COMMANDBUFFER_H_
+#ifndef BACKEND_COMMANDBUFFER_H_
+#define BACKEND_COMMANDBUFFER_H_
#include "nxt/nxtcpp.h"
-#include "CommandAllocator.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/CommandAllocator.h"
+#include "backend/Builder.h"
+#include "backend/RefCounted.h"
#include <memory>
#include <set>
@@ -103,4 +103,4 @@
}
-#endif // BACKEND_COMMON_COMMANDBUFFER_H_
+#endif // BACKEND_COMMANDBUFFER_H_
diff --git a/src/backend/common/CommandBufferStateTracker.cpp b/src/backend/CommandBufferStateTracker.cpp
similarity index 97%
rename from src/backend/common/CommandBufferStateTracker.cpp
rename to src/backend/CommandBufferStateTracker.cpp
index a8ca513..45e5ba2 100644
--- a/src/backend/common/CommandBufferStateTracker.cpp
+++ b/src/backend/CommandBufferStateTracker.cpp
@@ -12,19 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "CommandBufferStateTracker.h"
+#include "backend/CommandBufferStateTracker.h"
-#include "Forward.h"
-#include "BindGroup.h"
-#include "BindGroupLayout.h"
-#include "BitSetIterator.h"
-#include "Buffer.h"
-#include "Framebuffer.h"
-#include "InputState.h"
-#include "Pipeline.h"
-#include "PipelineLayout.h"
-#include "RenderPass.h"
-#include "Texture.h"
+#include "backend/Forward.h"
+#include "backend/BindGroup.h"
+#include "backend/BindGroupLayout.h"
+#include "backend/Buffer.h"
+#include "backend/Framebuffer.h"
+#include "backend/InputState.h"
+#include "backend/Pipeline.h"
+#include "backend/PipelineLayout.h"
+#include "backend/RenderPass.h"
+#include "backend/Texture.h"
+#include "common/BitSetIterator.h"
namespace backend {
CommandBufferStateTracker::CommandBufferStateTracker(CommandBufferBuilder* builder)
diff --git a/src/backend/common/CommandBufferStateTracker.h b/src/backend/CommandBufferStateTracker.h
similarity index 95%
rename from src/backend/common/CommandBufferStateTracker.h
rename to src/backend/CommandBufferStateTracker.h
index 04f12b5..290596e 100644
--- a/src/backend/common/CommandBufferStateTracker.h
+++ b/src/backend/CommandBufferStateTracker.h
@@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_COMMANDBUFFERSTATETRACKER_H
-#define BACKEND_COMMON_COMMANDBUFFERSTATETRACKER_H
+#ifndef BACKEND_COMMANDBUFFERSTATETRACKER_H
+#define BACKEND_COMMANDBUFFERSTATETRACKER_H
-#include "CommandBuffer.h"
+#include "backend/CommandBuffer.h"
+#include "common/Constants.h"
#include <bitset>
#include <map>
@@ -100,4 +101,4 @@
};
}
-#endif // BACKEND_COMMON_COMMANDBUFFERSTATETRACKER_H
+#endif // BACKEND_COMMANDBUFFERSTATETRACKER_H
diff --git a/src/backend/common/Commands.h b/src/backend/Commands.h
similarity index 95%
rename from src/backend/common/Commands.h
rename to src/backend/Commands.h
index 4ba48c3..c02d955 100644
--- a/src/backend/common/Commands.h
+++ b/src/backend/Commands.h
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_COMMANDS_H_
-#define BACKEND_COMMON_COMMANDS_H_
+#ifndef BACKEND_COMMANDS_H_
+#define BACKEND_COMMANDS_H_
-#include "Framebuffer.h"
-#include "RenderPass.h"
-#include "Texture.h"
+#include "backend/Framebuffer.h"
+#include "backend/RenderPass.h"
+#include "backend/Texture.h"
#include "nxt/nxtcpp.h"
@@ -155,4 +155,4 @@
}
-#endif // BACKEND_COMMON_COMMANDS_H_
+#endif // BACKEND_COMMANDS_H_
diff --git a/src/backend/common/DepthStencilState.cpp b/src/backend/DepthStencilState.cpp
similarity index 98%
rename from src/backend/common/DepthStencilState.cpp
rename to src/backend/DepthStencilState.cpp
index 86e5b2e..130d4eb 100644
--- a/src/backend/common/DepthStencilState.cpp
+++ b/src/backend/DepthStencilState.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "DepthStencilState.h"
+#include "backend/DepthStencilState.h"
-#include "Device.h"
+#include "backend/Device.h"
namespace backend {
diff --git a/src/backend/common/DepthStencilState.h b/src/backend/DepthStencilState.h
similarity index 92%
rename from src/backend/common/DepthStencilState.h
rename to src/backend/DepthStencilState.h
index 5bcaf18..9013472 100644
--- a/src/backend/common/DepthStencilState.h
+++ b/src/backend/DepthStencilState.h
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_DEPTHSTENCILSTATE_H_
-#define BACKEND_COMMON_DEPTHSTENCILSTATE_H_
+#ifndef BACKEND_DEPTHSTENCILSTATE_H_
+#define BACKEND_DEPTHSTENCILSTATE_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Builder.h"
+#include "backend/RefCounted.h"
#include "nxt/nxtcpp.h"
@@ -81,4 +81,4 @@
}
-#endif // BACKEND_COMMON_DEPTHSTENCILSTATE_H_
+#endif // BACKEND_DEPTHSTENCILSTATE_H_
diff --git a/src/backend/common/Device.cpp b/src/backend/Device.cpp
similarity index 89%
rename from src/backend/common/Device.cpp
rename to src/backend/Device.cpp
index ce5ba62..ee6128d 100644
--- a/src/backend/common/Device.cpp
+++ b/src/backend/Device.cpp
@@ -12,22 +12,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "Device.h"
+#include "backend/Device.h"
-#include "BindGroup.h"
-#include "BindGroupLayout.h"
-#include "Buffer.h"
-#include "CommandBuffer.h"
-#include "DepthStencilState.h"
-#include "Framebuffer.h"
-#include "InputState.h"
-#include "Pipeline.h"
-#include "PipelineLayout.h"
-#include "Queue.h"
-#include "RenderPass.h"
-#include "Sampler.h"
-#include "ShaderModule.h"
-#include "Texture.h"
+#include "backend/BindGroup.h"
+#include "backend/BindGroupLayout.h"
+#include "backend/Buffer.h"
+#include "backend/CommandBuffer.h"
+#include "backend/DepthStencilState.h"
+#include "backend/Framebuffer.h"
+#include "backend/InputState.h"
+#include "backend/Pipeline.h"
+#include "backend/PipelineLayout.h"
+#include "backend/Queue.h"
+#include "backend/RenderPass.h"
+#include "backend/Sampler.h"
+#include "backend/ShaderModule.h"
+#include "backend/Texture.h"
#include <unordered_set>
diff --git a/src/backend/common/Device.h b/src/backend/Device.h
similarity index 96%
rename from src/backend/common/Device.h
rename to src/backend/Device.h
index e4f9902..f35707d 100644
--- a/src/backend/common/Device.h
+++ b/src/backend/Device.h
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_DEVICEBASE_H_
-#define BACKEND_COMMON_DEVICEBASE_H_
+#ifndef BACKEND_DEVICEBASE_H_
+#define BACKEND_DEVICEBASE_H_
-#include "common/Forward.h"
-#include "common/RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/RefCounted.h"
#include "nxt/nxtcpp.h"
@@ -103,4 +103,4 @@
}
-#endif // BACKEND_COMMON_DEVICEBASE_H_
+#endif // BACKEND_DEVICEBASE_H_
diff --git a/src/backend/common/Forward.h b/src/backend/Forward.h
similarity index 72%
rename from src/backend/common/Forward.h
rename to src/backend/Forward.h
index 10c8643..d08dd76 100644
--- a/src/backend/common/Forward.h
+++ b/src/backend/Forward.h
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_FORWARD_H_
-#define BACKEND_COMMON_FORWARD_H_
+#ifndef BACKEND_FORWARD_H_
+#define BACKEND_FORWARD_H_
#include <cassert>
#include <cstdint>
@@ -63,18 +63,7 @@
template<typename T>
class PerStage;
- using Serial = uint64_t;
-
- // TODO(cwallez@chromium.org): where should constants live?
- static constexpr uint32_t kMaxPushConstants = 32u;
- static constexpr uint32_t kMaxBindGroups = 4u;
- static constexpr uint32_t kMaxBindingsPerGroup = 16u; // TODO(cwallez@chromium.org): investigate bindgroup limits
- static constexpr uint32_t kMaxVertexAttributes = 16u;
- static constexpr uint32_t kMaxVertexInputs = 16u;
- static constexpr uint32_t kNumStages = 3;
- static constexpr uint32_t kMaxColorAttachments = 4u;
-
enum PushConstantType : uint8_t;
}
-#endif // BACKEND_COMMON_FORWARD_H_
+#endif // BACKEND_FORWARD_H_
diff --git a/src/backend/common/Framebuffer.cpp b/src/backend/Framebuffer.cpp
similarity index 96%
rename from src/backend/common/Framebuffer.cpp
rename to src/backend/Framebuffer.cpp
index e6a24d3..0de6521 100644
--- a/src/backend/common/Framebuffer.cpp
+++ b/src/backend/Framebuffer.cpp
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "Framebuffer.h"
+#include "backend/Framebuffer.h"
-#include "Buffer.h"
-#include "Device.h"
-#include "RenderPass.h"
-#include "Texture.h"
+#include "backend/Buffer.h"
+#include "backend/Device.h"
+#include "backend/RenderPass.h"
+#include "backend/Texture.h"
namespace backend {
diff --git a/src/backend/common/Framebuffer.h b/src/backend/Framebuffer.h
similarity index 90%
rename from src/backend/common/Framebuffer.h
rename to src/backend/Framebuffer.h
index 53c23aa..cdc87c4 100644
--- a/src/backend/common/Framebuffer.h
+++ b/src/backend/Framebuffer.h
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_FRAMEBUFFER_H_
-#define BACKEND_COMMON_FRAMEBUFFER_H_
+#ifndef BACKEND_FRAMEBUFFER_H_
+#define BACKEND_FRAMEBUFFER_H_
-#include "Builder.h"
-#include "Forward.h"
-#include "RefCounted.h"
+#include "backend/Builder.h"
+#include "backend/Forward.h"
+#include "backend/RefCounted.h"
#include "nxt/nxtcpp.h"
@@ -66,4 +66,4 @@
}
-#endif // BACKEND_COMMON_FRAMEBUFFER_H_
+#endif // BACKEND_FRAMEBUFFER_H_
diff --git a/src/backend/common/InputState.cpp b/src/backend/InputState.cpp
similarity index 98%
rename from src/backend/common/InputState.cpp
rename to src/backend/InputState.cpp
index e4c434e..c4a7dc1 100644
--- a/src/backend/common/InputState.cpp
+++ b/src/backend/InputState.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "InputState.h"
+#include "backend/InputState.h"
-#include "Device.h"
+#include "backend/Device.h"
namespace backend {
diff --git a/src/backend/common/InputState.h b/src/backend/InputState.h
similarity index 92%
rename from src/backend/common/InputState.h
rename to src/backend/InputState.h
index f14af2f..3ee8e50 100644
--- a/src/backend/common/InputState.h
+++ b/src/backend/InputState.h
@@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_INPUTSTATE_H_
-#define BACKEND_COMMON_INPUTSTATE_H_
+#ifndef BACKEND_INPUTSTATE_H_
+#define BACKEND_INPUTSTATE_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Builder.h"
+#include "backend/RefCounted.h"
+#include "common/Constants.h"
#include "nxt/nxtcpp.h"
@@ -80,4 +81,4 @@
}
-#endif // BACKEND_COMMON_INPUTSTATE_H_
+#endif // BACKEND_INPUTSTATE_H_
diff --git a/src/backend/common/PerStage.cpp b/src/backend/PerStage.cpp
similarity index 96%
rename from src/backend/common/PerStage.cpp
rename to src/backend/PerStage.cpp
index cdccac5..8cf48b7 100644
--- a/src/backend/common/PerStage.cpp
+++ b/src/backend/PerStage.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "PerStage.h"
+#include "backend/PerStage.h"
namespace backend {
diff --git a/src/backend/common/PerStage.h b/src/backend/PerStage.h
similarity index 92%
rename from src/backend/common/PerStage.h
rename to src/backend/PerStage.h
index c14dde8..90636e1 100644
--- a/src/backend/common/PerStage.h
+++ b/src/backend/PerStage.h
@@ -12,14 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_PERSTAGE_H_
-#define BACKEND_COMMON_PERSTAGE_H_
+#ifndef BACKEND_PERSTAGE_H_
+#define BACKEND_PERSTAGE_H_
-#include "BitSetIterator.h"
+#include "common/BitSetIterator.h"
+#include "common/Constants.h"
#include "nxt/nxtcpp.h"
#include <array>
+#include <cassert>
+#define ASSERT assert
namespace backend {
@@ -65,4 +68,4 @@
}
-#endif // BACKEND_COMMON_PERSTAGE_H_
+#endif // BACKEND_PERSTAGE_H_
diff --git a/src/backend/common/Pipeline.cpp b/src/backend/Pipeline.cpp
similarity index 95%
rename from src/backend/common/Pipeline.cpp
rename to src/backend/Pipeline.cpp
index 0722106..b5ece5a 100644
--- a/src/backend/common/Pipeline.cpp
+++ b/src/backend/Pipeline.cpp
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "Pipeline.h"
+#include "backend/Pipeline.h"
-#include "Device.h"
-#include "DepthStencilState.h"
-#include "InputState.h"
-#include "PipelineLayout.h"
-#include "RenderPass.h"
-#include "ShaderModule.h"
+#include "backend/Device.h"
+#include "backend/DepthStencilState.h"
+#include "backend/InputState.h"
+#include "backend/PipelineLayout.h"
+#include "backend/RenderPass.h"
+#include "backend/ShaderModule.h"
namespace backend {
diff --git a/src/backend/common/Pipeline.h b/src/backend/Pipeline.h
similarity index 93%
rename from src/backend/common/Pipeline.h
rename to src/backend/Pipeline.h
index 837f4fe..bf51e88 100644
--- a/src/backend/common/Pipeline.h
+++ b/src/backend/Pipeline.h
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_PIPELINE_H_
-#define BACKEND_COMMON_PIPELINE_H_
+#ifndef BACKEND_PIPELINE_H_
+#define BACKEND_PIPELINE_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "PerStage.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Builder.h"
+#include "backend/PerStage.h"
+#include "backend/RefCounted.h"
#include "nxt/nxtcpp.h"
@@ -97,4 +97,4 @@
}
-#endif // BACKEND_COMMON_PIPELINE_H_
+#endif // BACKEND_PIPELINE_H_
diff --git a/src/backend/common/PipelineLayout.cpp b/src/backend/PipelineLayout.cpp
similarity index 95%
rename from src/backend/common/PipelineLayout.cpp
rename to src/backend/PipelineLayout.cpp
index cbca824..0445f24 100644
--- a/src/backend/common/PipelineLayout.cpp
+++ b/src/backend/PipelineLayout.cpp
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "PipelineLayout.h"
+#include "backend/PipelineLayout.h"
-#include "BindGroupLayout.h"
-#include "Device.h"
+#include "backend/BindGroupLayout.h"
+#include "backend/Device.h"
namespace backend {
diff --git a/src/backend/common/PipelineLayout.h b/src/backend/PipelineLayout.h
similarity index 87%
rename from src/backend/common/PipelineLayout.h
rename to src/backend/PipelineLayout.h
index 2f28f16..6ad1d56 100644
--- a/src/backend/common/PipelineLayout.h
+++ b/src/backend/PipelineLayout.h
@@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_PIPELINELAYOUT_H_
-#define BACKEND_COMMON_PIPELINELAYOUT_H_
+#ifndef BACKEND_PIPELINELAYOUT_H_
+#define BACKEND_PIPELINELAYOUT_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Builder.h"
+#include "backend/RefCounted.h"
+#include "common/Constants.h"
#include "nxt/nxtcpp.h"
@@ -58,4 +59,4 @@
}
-#endif // BACKEND_COMMON_PIPELINELAYOUT_H_
+#endif // BACKEND_PIPELINELAYOUT_H_
diff --git a/src/backend/common/Queue.cpp b/src/backend/Queue.cpp
similarity index 92%
rename from src/backend/common/Queue.cpp
rename to src/backend/Queue.cpp
index e4e9cb9..7a72a0b 100644
--- a/src/backend/common/Queue.cpp
+++ b/src/backend/Queue.cpp
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "Queue.h"
+#include "backend/Queue.h"
-#include "Device.h"
-#include "CommandBuffer.h"
+#include "backend/Device.h"
+#include "backend/CommandBuffer.h"
namespace backend {
diff --git a/src/backend/common/Queue.h b/src/backend/Queue.h
similarity index 90%
rename from src/backend/common/Queue.h
rename to src/backend/Queue.h
index 4398276..017296b 100644
--- a/src/backend/common/Queue.h
+++ b/src/backend/Queue.h
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_QUEUE_H_
-#define BACKEND_COMMON_QUEUE_H_
+#ifndef BACKEND_QUEUE_H_
+#define BACKEND_QUEUE_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Builder.h"
+#include "backend/RefCounted.h"
#include "nxt/nxtcpp.h"
@@ -58,4 +58,4 @@
}
-#endif // BACKEND_COMMON_QUEUE_H_
+#endif // BACKEND_QUEUE_H_
diff --git a/src/backend/common/RefCounted.cpp b/src/backend/RefCounted.cpp
similarity index 97%
rename from src/backend/common/RefCounted.cpp
rename to src/backend/RefCounted.cpp
index 076b57f..4339b19 100644
--- a/src/backend/common/RefCounted.cpp
+++ b/src/backend/RefCounted.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "RefCounted.h"
+#include "backend/RefCounted.h"
#include <cassert>
#define ASSERT assert
diff --git a/src/backend/common/RefCounted.h b/src/backend/RefCounted.h
similarity index 96%
rename from src/backend/common/RefCounted.h
rename to src/backend/RefCounted.h
index a9aa304..fd77eb0 100644
--- a/src/backend/common/RefCounted.h
+++ b/src/backend/RefCounted.h
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_REFCOUNTED_H_
-#define BACKEND_COMMON_REFCOUNTED_H_
+#ifndef BACKEND_REFCOUNTED_H_
+#define BACKEND_REFCOUNTED_H_
#include <cstdint>
@@ -123,4 +123,4 @@
}
-#endif // BACKEND_COMMON_REFCOUNTED_H_
+#endif // BACKEND_REFCOUNTED_H_
diff --git a/src/backend/common/RenderPass.cpp b/src/backend/RenderPass.cpp
similarity index 97%
rename from src/backend/common/RenderPass.cpp
rename to src/backend/RenderPass.cpp
index 72a013b..dbdc5a2 100644
--- a/src/backend/common/RenderPass.cpp
+++ b/src/backend/RenderPass.cpp
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "RenderPass.h"
+#include "backend/RenderPass.h"
-#include "Buffer.h"
-#include "Device.h"
-#include "Texture.h"
+#include "backend/Buffer.h"
+#include "backend/Device.h"
+#include "backend/Texture.h"
namespace backend {
diff --git a/src/backend/common/RenderPass.h b/src/backend/RenderPass.h
similarity index 92%
rename from src/backend/common/RenderPass.h
rename to src/backend/RenderPass.h
index a5bee3b..449e5ba 100644
--- a/src/backend/common/RenderPass.h
+++ b/src/backend/RenderPass.h
@@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_RENDERPASS_H_
-#define BACKEND_COMMON_RENDERPASS_H_
+#ifndef BACKEND_RENDERPASS_H_
+#define BACKEND_RENDERPASS_H_
-#include "Builder.h"
-#include "Forward.h"
-#include "RefCounted.h"
+#include "backend/Builder.h"
+#include "backend/Forward.h"
+#include "backend/RefCounted.h"
+#include "common/Constants.h"
#include "nxt/nxtcpp.h"
@@ -80,4 +81,4 @@
}
-#endif // BACKEND_COMMON_RENDERPASS_H_
+#endif // BACKEND_RENDERPASS_H_
diff --git a/src/backend/common/Sampler.cpp b/src/backend/Sampler.cpp
similarity index 96%
rename from src/backend/common/Sampler.cpp
rename to src/backend/Sampler.cpp
index 17cd753..554f0a5 100644
--- a/src/backend/common/Sampler.cpp
+++ b/src/backend/Sampler.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "Sampler.h"
+#include "backend/Sampler.h"
-#include "Device.h"
+#include "backend/Device.h"
namespace backend {
diff --git a/src/backend/common/Sampler.h b/src/backend/Sampler.h
similarity index 89%
rename from src/backend/common/Sampler.h
rename to src/backend/Sampler.h
index f4fbcb6..4abcbe2 100644
--- a/src/backend/common/Sampler.h
+++ b/src/backend/Sampler.h
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_SAMPLER_H_
-#define BACKEND_COMMON_SAMPLER_H_
+#ifndef BACKEND_SAMPLER_H_
+#define BACKEND_SAMPLER_H_
-#include "Forward.h"
-#include "Buffer.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Buffer.h"
+#include "backend/RefCounted.h"
#include "nxt/nxtcpp.h"
@@ -53,4 +53,4 @@
}
-#endif // BACKEND_COMMON_SAMPLER_H_
+#endif // BACKEND_SAMPLER_H_
diff --git a/src/backend/common/ShaderModule.cpp b/src/backend/ShaderModule.cpp
similarity index 97%
rename from src/backend/common/ShaderModule.cpp
rename to src/backend/ShaderModule.cpp
index 50b46db..a119931 100644
--- a/src/backend/common/ShaderModule.cpp
+++ b/src/backend/ShaderModule.cpp
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ShaderModule.h"
+#include "backend/ShaderModule.h"
-#include "BindGroupLayout.h"
-#include "Device.h"
-#include "Pipeline.h"
-#include "PipelineLayout.h"
+#include "backend/BindGroupLayout.h"
+#include "backend/Device.h"
+#include "backend/Pipeline.h"
+#include "backend/PipelineLayout.h"
#include <spirv-cross/spirv_cross.hpp>
diff --git a/src/backend/common/ShaderModule.h b/src/backend/ShaderModule.h
similarity index 92%
rename from src/backend/common/ShaderModule.h
rename to src/backend/ShaderModule.h
index 816fd0d..c13fc9a 100644
--- a/src/backend/common/ShaderModule.h
+++ b/src/backend/ShaderModule.h
@@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_SHADERMODULE_H_
-#define BACKEND_COMMON_SHADERMODULE_H_
+#ifndef BACKEND_SHADERMODULE_H_
+#define BACKEND_SHADERMODULE_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Builder.h"
+#include "backend/RefCounted.h"
+#include "common/Constants.h"
#include "nxt/nxtcpp.h"
@@ -90,4 +91,4 @@
}
-#endif // BACKEND_COMMON_SHADERMODULE_H_
+#endif // BACKEND_SHADERMODULE_H_
diff --git a/src/backend/common/Texture.cpp b/src/backend/Texture.cpp
similarity index 98%
rename from src/backend/common/Texture.cpp
rename to src/backend/Texture.cpp
index 06cd5c0..7f0d865 100644
--- a/src/backend/common/Texture.cpp
+++ b/src/backend/Texture.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "Texture.h"
+#include "backend/Texture.h"
-#include "Device.h"
+#include "backend/Device.h"
namespace backend {
diff --git a/src/backend/common/Texture.h b/src/backend/Texture.h
similarity index 95%
rename from src/backend/common/Texture.h
rename to src/backend/Texture.h
index acad001..4f40f30 100644
--- a/src/backend/common/Texture.h
+++ b/src/backend/Texture.h
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_TEXTURE_H_
-#define BACKEND_COMMON_TEXTURE_H_
+#ifndef BACKEND_TEXTURE_H_
+#define BACKEND_TEXTURE_H_
-#include "Forward.h"
-#include "Builder.h"
-#include "RefCounted.h"
+#include "backend/Forward.h"
+#include "backend/Builder.h"
+#include "backend/RefCounted.h"
#include "nxt/nxtcpp.h"
@@ -115,4 +115,4 @@
}
-#endif // BACKEND_COMMON_TEXTURE_H_
+#endif // BACKEND_TEXTURE_H_
diff --git a/src/backend/common/ToBackend.h b/src/backend/ToBackend.h
similarity index 97%
rename from src/backend/common/ToBackend.h
rename to src/backend/ToBackend.h
index a822b3b..2c3466a 100644
--- a/src/backend/common/ToBackend.h
+++ b/src/backend/ToBackend.h
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_TOBACKEND_H_
-#define BACKEND_COMMON_TOBACKEND_H_
+#ifndef BACKEND_TOBACKEND_H_
+#define BACKEND_TOBACKEND_H_
-#include "Forward.h"
+#include "backend/Forward.h"
namespace backend {
@@ -137,4 +137,4 @@
}
-#endif // BACKEND_COMMON_TOBACKEND_H_
+#endif // BACKEND_TOBACKEND_H_
diff --git a/src/backend/d3d12/BindGroupD3D12.cpp b/src/backend/d3d12/BindGroupD3D12.cpp
index e278ed9..a5d16c9 100644
--- a/src/backend/d3d12/BindGroupD3D12.cpp
+++ b/src/backend/d3d12/BindGroupD3D12.cpp
@@ -13,13 +13,13 @@
// limitations under the License.
#include "common/BitSetIterator.h"
-#include "BindGroupD3D12.h"
-#include "BindGroupLayoutD3D12.h"
-#include "BufferD3D12.h"
-#include "SamplerD3D12.h"
-#include "TextureD3D12.h"
+#include "backend/d3d12/BindGroupD3D12.h"
+#include "backend/d3d12/BindGroupLayoutD3D12.h"
+#include "backend/d3d12/BufferD3D12.h"
+#include "backend/d3d12/SamplerD3D12.h"
+#include "backend/d3d12/TextureD3D12.h"
-#include "D3D12Backend.h"
+#include "backend/d3d12/D3D12Backend.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/BindGroupD3D12.h b/src/backend/d3d12/BindGroupD3D12.h
index 49d89fe..4b38c86 100644
--- a/src/backend/d3d12/BindGroupD3D12.h
+++ b/src/backend/d3d12/BindGroupD3D12.h
@@ -15,11 +15,11 @@
#ifndef BACKEND_D3D12_BINDGROUPD3D12_H_
#define BACKEND_D3D12_BINDGROUPD3D12_H_
-#include "common/BindGroup.h"
+#include "backend/BindGroup.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
-#include "DescriptorHeapAllocator.h"
+#include "backend/d3d12/DescriptorHeapAllocator.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/BindGroupLayoutD3D12.cpp b/src/backend/d3d12/BindGroupLayoutD3D12.cpp
index c7a5172..65db74b 100644
--- a/src/backend/d3d12/BindGroupLayoutD3D12.cpp
+++ b/src/backend/d3d12/BindGroupLayoutD3D12.cpp
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BindGroupLayoutD3D12.h"
+#include "backend/d3d12/BindGroupLayoutD3D12.h"
#include "common/BitSetIterator.h"
-#include "D3D12Backend.h"
+#include "backend/d3d12/D3D12Backend.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/BindGroupLayoutD3D12.h b/src/backend/d3d12/BindGroupLayoutD3D12.h
index 1d310703..96bd2ec 100644
--- a/src/backend/d3d12/BindGroupLayoutD3D12.h
+++ b/src/backend/d3d12/BindGroupLayoutD3D12.h
@@ -15,9 +15,9 @@
#ifndef BACKEND_D3D12_BINDGROUPLAYOUTD3D12_H_
#define BACKEND_D3D12_BINDGROUPLAYOUTD3D12_H_
-#include "common/BindGroupLayout.h"
+#include "backend/BindGroupLayout.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/BufferD3D12.cpp b/src/backend/d3d12/BufferD3D12.cpp
index 42085c3..5cb12ca 100644
--- a/src/backend/d3d12/BufferD3D12.cpp
+++ b/src/backend/d3d12/BufferD3D12.cpp
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BufferD3D12.h"
+#include "backend/d3d12/BufferD3D12.h"
-#include "D3D12Backend.h"
-#include "ResourceAllocator.h"
-#include "ResourceUploader.h"
+#include "backend/d3d12/D3D12Backend.h"
+#include "backend/d3d12/ResourceAllocator.h"
+#include "backend/d3d12/ResourceUploader.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/BufferD3D12.h b/src/backend/d3d12/BufferD3D12.h
index 7518abc..dd7ef07 100644
--- a/src/backend/d3d12/BufferD3D12.h
+++ b/src/backend/d3d12/BufferD3D12.h
@@ -15,10 +15,10 @@
#ifndef BACKEND_D3D12_BUFFERD3D12_H_
#define BACKEND_D3D12_BUFFERD3D12_H_
-#include "common/Buffer.h"
+#include "backend/Buffer.h"
#include "common/SerialQueue.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/CommandAllocatorManager.cpp b/src/backend/d3d12/CommandAllocatorManager.cpp
index 284e183..08531af 100644
--- a/src/backend/d3d12/CommandAllocatorManager.cpp
+++ b/src/backend/d3d12/CommandAllocatorManager.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "CommandAllocatorManager.h"
+#include "backend/d3d12/CommandAllocatorManager.h"
-#include "D3D12Backend.h"
+#include "backend/d3d12/D3D12Backend.h"
#include "common/BitSetIterator.h"
diff --git a/src/backend/d3d12/CommandAllocatorManager.h b/src/backend/d3d12/CommandAllocatorManager.h
index 1510afd..33817c7 100644
--- a/src/backend/d3d12/CommandAllocatorManager.h
+++ b/src/backend/d3d12/CommandAllocatorManager.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_D3D12_COMMANDALLOCATORMANAGER_H_
#define BACKEND_D3D12_COMMANDALLOCATORMANAGER_H_
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
#include "common/SerialQueue.h"
diff --git a/src/backend/d3d12/CommandBufferD3D12.cpp b/src/backend/d3d12/CommandBufferD3D12.cpp
index ba233d1..e4197e7 100644
--- a/src/backend/d3d12/CommandBufferD3D12.cpp
+++ b/src/backend/d3d12/CommandBufferD3D12.cpp
@@ -12,19 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "CommandBufferD3D12.h"
+#include "backend/d3d12/CommandBufferD3D12.h"
-#include "common/Commands.h"
-#include "D3D12Backend.h"
-#include "BindGroupD3D12.h"
-#include "BindGroupLayoutD3D12.h"
-#include "BufferD3D12.h"
-#include "DescriptorHeapAllocator.h"
-#include "InputStateD3D12.h"
-#include "PipelineD3D12.h"
-#include "PipelineLayoutD3D12.h"
-#include "SamplerD3D12.h"
-#include "TextureD3D12.h"
+#include "backend/Commands.h"
+#include "backend/d3d12/D3D12Backend.h"
+#include "backend/d3d12/BindGroupD3D12.h"
+#include "backend/d3d12/BindGroupLayoutD3D12.h"
+#include "backend/d3d12/BufferD3D12.h"
+#include "backend/d3d12/DescriptorHeapAllocator.h"
+#include "backend/d3d12/InputStateD3D12.h"
+#include "backend/d3d12/PipelineD3D12.h"
+#include "backend/d3d12/PipelineLayoutD3D12.h"
+#include "backend/d3d12/SamplerD3D12.h"
+#include "backend/d3d12/TextureD3D12.h"
#include "ResourceAllocator.h"
diff --git a/src/backend/d3d12/CommandBufferD3D12.h b/src/backend/d3d12/CommandBufferD3D12.h
index c9e434d..de2c3fb 100644
--- a/src/backend/d3d12/CommandBufferD3D12.h
+++ b/src/backend/d3d12/CommandBufferD3D12.h
@@ -15,10 +15,10 @@
#ifndef BACKEND_D3D12_COMMANDBUFFERD3D12_H_
#define BACKEND_D3D12_COMMANDBUFFERD3D12_H_
-#include "common/CommandAllocator.h"
-#include "common/CommandBuffer.h"
+#include "backend/CommandAllocator.h"
+#include "backend/CommandBuffer.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/D3D12Backend.cpp b/src/backend/d3d12/D3D12Backend.cpp
index 8e8dfe0..f6df78b 100644
--- a/src/backend/d3d12/D3D12Backend.cpp
+++ b/src/backend/d3d12/D3D12Backend.cpp
@@ -12,24 +12,24 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "D3D12Backend.h"
+#include "backend/d3d12/D3D12Backend.h"
-#include "BindGroupD3D12.h"
-#include "BindGroupLayoutD3D12.h"
-#include "BufferD3D12.h"
-#include "CommandBufferD3D12.h"
-#include "InputStateD3D12.h"
-#include "PipelineD3D12.h"
-#include "PipelineLayoutD3D12.h"
-#include "QueueD3D12.h"
-#include "SamplerD3D12.h"
-#include "ShaderModuleD3D12.h"
-#include "TextureD3D12.h"
+#include "backend/d3d12/BindGroupD3D12.h"
+#include "backend/d3d12/BindGroupLayoutD3D12.h"
+#include "backend/d3d12/BufferD3D12.h"
+#include "backend/d3d12/CommandBufferD3D12.h"
+#include "backend/d3d12/InputStateD3D12.h"
+#include "backend/d3d12/PipelineD3D12.h"
+#include "backend/d3d12/PipelineLayoutD3D12.h"
+#include "backend/d3d12/QueueD3D12.h"
+#include "backend/d3d12/SamplerD3D12.h"
+#include "backend/d3d12/ShaderModuleD3D12.h"
+#include "backend/d3d12/TextureD3D12.h"
-#include "CommandAllocatorManager.h"
-#include "DescriptorHeapAllocator.h"
-#include "ResourceAllocator.h"
-#include "ResourceUploader.h"
+#include "backend/d3d12/CommandAllocatorManager.h"
+#include "backend/d3d12/DescriptorHeapAllocator.h"
+#include "backend/d3d12/ResourceAllocator.h"
+#include "backend/d3d12/ResourceUploader.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/D3D12Backend.h b/src/backend/d3d12/D3D12Backend.h
index 4ea37ba..827249e 100644
--- a/src/backend/d3d12/D3D12Backend.h
+++ b/src/backend/d3d12/D3D12Backend.h
@@ -17,21 +17,21 @@
#include "nxt/nxtcpp.h"
-#include "common/Buffer.h"
-#include "common/BindGroup.h"
-#include "common/BindGroupLayout.h"
-#include "common/Device.h"
-#include "common/Framebuffer.h"
-#include "common/DepthStencilState.h"
-#include "common/InputState.h"
-#include "common/PipelineLayout.h"
-#include "common/Queue.h"
-#include "common/RenderPass.h"
-#include "common/Sampler.h"
-#include "common/Texture.h"
-#include "common/ToBackend.h"
+#include "backend/Buffer.h"
+#include "backend/BindGroup.h"
+#include "backend/BindGroupLayout.h"
+#include "backend/Device.h"
+#include "backend/Framebuffer.h"
+#include "backend/DepthStencilState.h"
+#include "backend/InputState.h"
+#include "backend/PipelineLayout.h"
+#include "backend/Queue.h"
+#include "backend/RenderPass.h"
+#include "backend/Sampler.h"
+#include "backend/Texture.h"
+#include "backend/ToBackend.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/DescriptorHeapAllocator.cpp b/src/backend/d3d12/DescriptorHeapAllocator.cpp
index 1e4c1ff..4ef34c7 100644
--- a/src/backend/d3d12/DescriptorHeapAllocator.cpp
+++ b/src/backend/d3d12/DescriptorHeapAllocator.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "DescriptorHeapAllocator.h"
+#include "backend/d3d12/DescriptorHeapAllocator.h"
-#include "D3D12Backend.h"
+#include "backend/d3d12/D3D12Backend.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/DescriptorHeapAllocator.h b/src/backend/d3d12/DescriptorHeapAllocator.h
index 07aab8f..1c5ad2e 100644
--- a/src/backend/d3d12/DescriptorHeapAllocator.h
+++ b/src/backend/d3d12/DescriptorHeapAllocator.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_D3D12_DESCRIPTORHEAPALLOCATOR_H_
#define BACKEND_D3D12_DESCRIPTORHEAPALLOCATOR_H_
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
#include "common/SerialQueue.h"
#include <array>
diff --git a/src/backend/d3d12/GeneratedCodeIncludes.h b/src/backend/d3d12/GeneratedCodeIncludes.h
index fbf10566..7ec9e6f 100644
--- a/src/backend/d3d12/GeneratedCodeIncludes.h
+++ b/src/backend/d3d12/GeneratedCodeIncludes.h
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "D3D12Backend.h"
-#include "BindGroupD3D12.h"
-#include "BindGroupLayoutD3D12.h"
-#include "BufferD3D12.h"
-#include "CommandBufferD3D12.h"
-#include "InputStateD3D12.h"
-#include "PipelineD3D12.h"
-#include "PipelineLayoutD3D12.h"
-#include "QueueD3D12.h"
-#include "SamplerD3D12.h"
-#include "ShaderModuleD3D12.h"
-#include "TextureD3D12.h"
+#include "backend/d3d12/D3D12Backend.h"
+#include "backend/d3d12/BindGroupD3D12.h"
+#include "backend/d3d12/BindGroupLayoutD3D12.h"
+#include "backend/d3d12/BufferD3D12.h"
+#include "backend/d3d12/CommandBufferD3D12.h"
+#include "backend/d3d12/InputStateD3D12.h"
+#include "backend/d3d12/PipelineD3D12.h"
+#include "backend/d3d12/PipelineLayoutD3D12.h"
+#include "backend/d3d12/QueueD3D12.h"
+#include "backend/d3d12/SamplerD3D12.h"
+#include "backend/d3d12/ShaderModuleD3D12.h"
+#include "backend/d3d12/TextureD3D12.h"
diff --git a/src/backend/d3d12/InputStateD3D12.cpp b/src/backend/d3d12/InputStateD3D12.cpp
index 0d53e85..5a9e559 100644
--- a/src/backend/d3d12/InputStateD3D12.cpp
+++ b/src/backend/d3d12/InputStateD3D12.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "InputStateD3D12.h"
+#include "backend/d3d12/InputStateD3D12.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/InputStateD3D12.h b/src/backend/d3d12/InputStateD3D12.h
index 5dc2187..be48238 100644
--- a/src/backend/d3d12/InputStateD3D12.h
+++ b/src/backend/d3d12/InputStateD3D12.h
@@ -15,9 +15,9 @@
#ifndef BACKEND_D3D12_INPUTSTATED3D12_H_
#define BACKEND_D3D12_INPUTSTATED3D12_H_
-#include "common/InputState.h"
+#include "backend/InputState.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/PipelineD3D12.cpp b/src/backend/d3d12/PipelineD3D12.cpp
index 290dd98..d1eeec1 100644
--- a/src/backend/d3d12/PipelineD3D12.cpp
+++ b/src/backend/d3d12/PipelineD3D12.cpp
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "PipelineD3D12.h"
+#include "backend/d3d12/PipelineD3D12.h"
-#include "D3D12Backend.h"
-#include "InputStateD3D12.h"
-#include "ShaderModuleD3D12.h"
-#include "PipelineLayoutD3D12.h"
+#include "backend/d3d12/D3D12Backend.h"
+#include "backend/d3d12/InputStateD3D12.h"
+#include "backend/d3d12/ShaderModuleD3D12.h"
+#include "backend/d3d12/PipelineLayoutD3D12.h"
#include <d3dcompiler.h>
diff --git a/src/backend/d3d12/PipelineD3D12.h b/src/backend/d3d12/PipelineD3D12.h
index ec88b46..2b9faa7 100644
--- a/src/backend/d3d12/PipelineD3D12.h
+++ b/src/backend/d3d12/PipelineD3D12.h
@@ -15,9 +15,9 @@
#ifndef BACKEND_D3D12_PIPELINED3D12_H_
#define BACKEND_D3D12_PIPELINED3D12_H_
-#include "common/Pipeline.h"
+#include "backend/Pipeline.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/PipelineLayoutD3D12.cpp b/src/backend/d3d12/PipelineLayoutD3D12.cpp
index 883cd2d..4c27fed 100644
--- a/src/backend/d3d12/PipelineLayoutD3D12.cpp
+++ b/src/backend/d3d12/PipelineLayoutD3D12.cpp
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "PipelineLayoutD3D12.h"
+#include "backend/d3d12/PipelineLayoutD3D12.h"
-#include "D3D12Backend.h"
-#include "BindGroupLayoutD3D12.h"
+#include "backend/d3d12/D3D12Backend.h"
+#include "backend/d3d12/BindGroupLayoutD3D12.h"
using Microsoft::WRL::ComPtr;
diff --git a/src/backend/d3d12/PipelineLayoutD3D12.h b/src/backend/d3d12/PipelineLayoutD3D12.h
index fe87a05..8309c66 100644
--- a/src/backend/d3d12/PipelineLayoutD3D12.h
+++ b/src/backend/d3d12/PipelineLayoutD3D12.h
@@ -15,9 +15,9 @@
#ifndef BACKEND_D3D12_PIPELINELAYOUTD3D12_H_
#define BACKEND_D3D12_PIPELINELAYOUTD3D12_H_
-#include "common/PipelineLayout.h"
+#include "backend/PipelineLayout.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/QueueD3D12.cpp b/src/backend/d3d12/QueueD3D12.cpp
index a03162a..48ef895 100644
--- a/src/backend/d3d12/QueueD3D12.cpp
+++ b/src/backend/d3d12/QueueD3D12.cpp
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "QueueD3D12.h"
+#include "backend/d3d12/QueueD3D12.h"
-#include "D3D12Backend.h"
-#include "CommandBufferD3D12.h"
+#include "backend/d3d12/D3D12Backend.h"
+#include "backend/d3d12/CommandBufferD3D12.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/QueueD3D12.h b/src/backend/d3d12/QueueD3D12.h
index 1e14d99..839bb91 100644
--- a/src/backend/d3d12/QueueD3D12.h
+++ b/src/backend/d3d12/QueueD3D12.h
@@ -15,9 +15,9 @@
#ifndef BACKEND_D3D12_QUEUED3D12_H_
#define BACKEND_D3D12_QUEUED3D12_H_
-#include "common/Queue.h"
+#include "backend/Queue.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/ResourceAllocator.cpp b/src/backend/d3d12/ResourceAllocator.cpp
index c2e1fde..f7f5e5f 100644
--- a/src/backend/d3d12/ResourceAllocator.cpp
+++ b/src/backend/d3d12/ResourceAllocator.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ResourceAllocator.h"
+#include "backend/d3d12/ResourceAllocator.h"
-#include "D3D12Backend.h"
+#include "backend/d3d12/D3D12Backend.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/ResourceAllocator.h b/src/backend/d3d12/ResourceAllocator.h
index 19aef02..63823d3 100644
--- a/src/backend/d3d12/ResourceAllocator.h
+++ b/src/backend/d3d12/ResourceAllocator.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_D3D12_RESOURCEALLOCATIONMANAGER_H_
#define BACKEND_D3D12_RESOURCEALLOCATIONMANAGER_H_
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
#include "common/SerialQueue.h"
diff --git a/src/backend/d3d12/ResourceUploader.cpp b/src/backend/d3d12/ResourceUploader.cpp
index 80f1137..972b615 100644
--- a/src/backend/d3d12/ResourceUploader.cpp
+++ b/src/backend/d3d12/ResourceUploader.cpp
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ResourceUploader.h"
+#include "backend/d3d12/ResourceUploader.h"
-#include "D3D12Backend.h"
-#include "ResourceAllocator.h"
+#include "backend/d3d12/D3D12Backend.h"
+#include "backend/d3d12/ResourceAllocator.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/ResourceUploader.h b/src/backend/d3d12/ResourceUploader.h
index 470f001..2550625 100644
--- a/src/backend/d3d12/ResourceUploader.h
+++ b/src/backend/d3d12/ResourceUploader.h
@@ -15,9 +15,9 @@
#ifndef BACKEND_D3D12_RESOURCEUPLOADER_H_
#define BACKEND_D3D12_RESOURCEUPLOADER_H_
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
-#include "common/Forward.h"
+#include "backend/Forward.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/SamplerD3D12.cpp b/src/backend/d3d12/SamplerD3D12.cpp
index b337b39..67e5d91 100644
--- a/src/backend/d3d12/SamplerD3D12.cpp
+++ b/src/backend/d3d12/SamplerD3D12.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "SamplerD3D12.h"
+#include "backend/d3d12/SamplerD3D12.h"
-#include "D3D12Backend.h"
+#include "backend/d3d12/D3D12Backend.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/SamplerD3D12.h b/src/backend/d3d12/SamplerD3D12.h
index 87198b7..9201cd3 100644
--- a/src/backend/d3d12/SamplerD3D12.h
+++ b/src/backend/d3d12/SamplerD3D12.h
@@ -15,9 +15,9 @@
#ifndef BACKEND_D3D12_SAMPLERD3D12_H_
#define BACKEND_D3D12_SAMPLERD3D12_H_
-#include "common/Sampler.h"
+#include "backend/Sampler.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/ShaderModuleD3D12.cpp b/src/backend/d3d12/ShaderModuleD3D12.cpp
index ee52a28..ec6fc9f 100644
--- a/src/backend/d3d12/ShaderModuleD3D12.cpp
+++ b/src/backend/d3d12/ShaderModuleD3D12.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ShaderModuleD3D12.h"
+#include "backend/d3d12/ShaderModuleD3D12.h"
#include <spirv-cross/spirv_hlsl.hpp>
diff --git a/src/backend/d3d12/ShaderModuleD3D12.h b/src/backend/d3d12/ShaderModuleD3D12.h
index d703cd8..4670f82 100644
--- a/src/backend/d3d12/ShaderModuleD3D12.h
+++ b/src/backend/d3d12/ShaderModuleD3D12.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_D3D12_SHADERMODULED3D12_H_
#define BACKEND_D3D12_SHADERMODULED3D12_H_
-#include "common/ShaderModule.h"
+#include "backend/ShaderModule.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/TextureD3D12.cpp b/src/backend/d3d12/TextureD3D12.cpp
index a4b94af..6ac6666 100644
--- a/src/backend/d3d12/TextureD3D12.cpp
+++ b/src/backend/d3d12/TextureD3D12.cpp
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "TextureD3D12.h"
+#include "backend/d3d12/TextureD3D12.h"
-#include "D3D12Backend.h"
-#include "ResourceAllocator.h"
+#include "backend/d3d12/D3D12Backend.h"
+#include "backend/d3d12/ResourceAllocator.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/d3d12/TextureD3D12.h b/src/backend/d3d12/TextureD3D12.h
index 26f45d8..e8029b4 100644
--- a/src/backend/d3d12/TextureD3D12.h
+++ b/src/backend/d3d12/TextureD3D12.h
@@ -15,9 +15,9 @@
#ifndef BACKEND_D3D12_TEXTURED3D12_H_
#define BACKEND_D3D12_TEXTURED3D12_H_
-#include "common/Texture.h"
+#include "backend/Texture.h"
-#include "d3d12_platform.h"
+#include "backend/d3d12/d3d12_platform.h"
namespace backend {
namespace d3d12 {
diff --git a/src/backend/metal/BufferMTL.h b/src/backend/metal/BufferMTL.h
index 26b29a3..d14a79b 100644
--- a/src/backend/metal/BufferMTL.h
+++ b/src/backend/metal/BufferMTL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_METAL_BUFFERMTL_H_
#define BACKEND_METAL_BUFFERMTL_H_
-#include "common/Buffer.h"
+#include "backend/Buffer.h"
#include "common/SerialQueue.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/BufferMTL.mm b/src/backend/metal/BufferMTL.mm
index ed1bf18..4f8f99f 100644
--- a/src/backend/metal/BufferMTL.mm
+++ b/src/backend/metal/BufferMTL.mm
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BufferMTL.h"
+#include "backend/metal/BufferMTL.h"
-#include "MetalBackend.h"
-#include "ResourceUploader.h"
+#include "backend/metal/MetalBackend.h"
+#include "backend/metal/ResourceUploader.h"
namespace backend {
namespace metal {
diff --git a/src/backend/metal/CommandBufferMTL.h b/src/backend/metal/CommandBufferMTL.h
index 0c95dca..2c390e3 100644
--- a/src/backend/metal/CommandBufferMTL.h
+++ b/src/backend/metal/CommandBufferMTL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_METAL_COMMANDBUFFERMTL_H_
#define BACKEND_METAL_COMMANDBUFFERMTL_H_
-#include "common/CommandBuffer.h"
+#include "backend/CommandBuffer.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/CommandBufferMTL.mm b/src/backend/metal/CommandBufferMTL.mm
index 44c8c72..24fbdd4 100644
--- a/src/backend/metal/CommandBufferMTL.mm
+++ b/src/backend/metal/CommandBufferMTL.mm
@@ -12,17 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "CommandBufferMTL.h"
+#include "backend/metal/CommandBufferMTL.h"
-#include "common/Commands.h"
-#include "BufferMTL.h"
-#include "DepthStencilStateMTL.h"
-#include "InputStateMTL.h"
-#include "MetalBackend.h"
-#include "PipelineMTL.h"
-#include "PipelineLayoutMTL.h"
-#include "SamplerMTL.h"
-#include "TextureMTL.h"
+#include "backend/Commands.h"
+#include "backend/metal/BufferMTL.h"
+#include "backend/metal/DepthStencilStateMTL.h"
+#include "backend/metal/InputStateMTL.h"
+#include "backend/metal/MetalBackend.h"
+#include "backend/metal/PipelineMTL.h"
+#include "backend/metal/PipelineLayoutMTL.h"
+#include "backend/metal/SamplerMTL.h"
+#include "backend/metal/TextureMTL.h"
namespace backend {
namespace metal {
diff --git a/src/backend/metal/DepthStencilStateMTL.h b/src/backend/metal/DepthStencilStateMTL.h
index e0dc97f..e8f3df7 100644
--- a/src/backend/metal/DepthStencilStateMTL.h
+++ b/src/backend/metal/DepthStencilStateMTL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_METAL_DEPTHSTENCILSTATEMTL_H_
#define BACKEND_METAL_DEPTHSTENCILSTATEMTL_H_
-#include "common/DepthStencilState.h"
+#include "backend/DepthStencilState.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/DepthStencilStateMTL.mm b/src/backend/metal/DepthStencilStateMTL.mm
index 3c727f9..b41bbe5 100644
--- a/src/backend/metal/DepthStencilStateMTL.mm
+++ b/src/backend/metal/DepthStencilStateMTL.mm
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "DepthStencilStateMTL.h"
+#include "backend/metal/DepthStencilStateMTL.h"
-#include "MetalBackend.h"
+#include "backend/metal/MetalBackend.h"
namespace backend {
namespace metal {
diff --git a/src/backend/metal/GeneratedCodeIncludes.h b/src/backend/metal/GeneratedCodeIncludes.h
index 808462e..37bd1a1 100644
--- a/src/backend/metal/GeneratedCodeIncludes.h
+++ b/src/backend/metal/GeneratedCodeIncludes.h
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "MetalBackend.h"
-#include "BufferMTL.h"
-#include "CommandBufferMTL.h"
-#include "DepthStencilStateMTL.h"
-#include "InputStateMTL.h"
-#include "PipelineMTL.h"
-#include "PipelineLayoutMTL.h"
-#include "SamplerMTL.h"
-#include "ShaderModuleMTL.h"
-#include "TextureMTL.h"
+#include "backend/metal/MetalBackend.h"
+#include "backend/metal/BufferMTL.h"
+#include "backend/metal/CommandBufferMTL.h"
+#include "backend/metal/DepthStencilStateMTL.h"
+#include "backend/metal/InputStateMTL.h"
+#include "backend/metal/PipelineMTL.h"
+#include "backend/metal/PipelineLayoutMTL.h"
+#include "backend/metal/SamplerMTL.h"
+#include "backend/metal/ShaderModuleMTL.h"
+#include "backend/metal/TextureMTL.h"
diff --git a/src/backend/metal/InputStateMTL.h b/src/backend/metal/InputStateMTL.h
index 8011f40..771bf2b 100644
--- a/src/backend/metal/InputStateMTL.h
+++ b/src/backend/metal/InputStateMTL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_METAL_INPUTSTATEMTL_H_
#define BACKEND_METAL_INPUTSTATEMTL_H_
-#include "common/InputState.h"
+#include "backend/InputState.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/InputStateMTL.mm b/src/backend/metal/InputStateMTL.mm
index 2867f73..bbe75a8 100644
--- a/src/backend/metal/InputStateMTL.mm
+++ b/src/backend/metal/InputStateMTL.mm
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "InputStateMTL.h"
+#include "backend/metal/InputStateMTL.h"
-#include "MetalBackend.h"
+#include "backend/metal/MetalBackend.h"
namespace backend {
namespace metal {
diff --git a/src/backend/metal/MetalBackend.h b/src/backend/metal/MetalBackend.h
index 33c01b4..c72d942 100644
--- a/src/backend/metal/MetalBackend.h
+++ b/src/backend/metal/MetalBackend.h
@@ -17,13 +17,14 @@
#include "nxt/nxtcpp.h"
-#include "common/BindGroup.h"
-#include "common/BindGroupLayout.h"
-#include "common/Device.h"
-#include "common/Framebuffer.h"
-#include "common/Queue.h"
-#include "common/RenderPass.h"
-#include "common/ToBackend.h"
+#include "backend/BindGroup.h"
+#include "backend/BindGroupLayout.h"
+#include "backend/Device.h"
+#include "backend/Framebuffer.h"
+#include "backend/Queue.h"
+#include "backend/RenderPass.h"
+#include "backend/ToBackend.h"
+#include "common/Serial.h"
#include <type_traits>
#import <Metal/Metal.h>
diff --git a/src/backend/metal/MetalBackend.mm b/src/backend/metal/MetalBackend.mm
index 64789de..e3d1f0a 100644
--- a/src/backend/metal/MetalBackend.mm
+++ b/src/backend/metal/MetalBackend.mm
@@ -12,20 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// TODO(kainino@chromium.org): split this backend into many files
+#include "backend/metal/MetalBackend.h"
-#include "MetalBackend.h"
-
-#include "BufferMTL.h"
-#include "CommandBufferMTL.h"
-#include "DepthStencilStateMTL.h"
-#include "InputStateMTL.h"
-#include "PipelineMTL.h"
-#include "PipelineLayoutMTL.h"
-#include "ResourceUploader.h"
-#include "SamplerMTL.h"
-#include "ShaderModuleMTL.h"
-#include "TextureMTL.h"
+#include "backend/metal/BufferMTL.h"
+#include "backend/metal/CommandBufferMTL.h"
+#include "backend/metal/DepthStencilStateMTL.h"
+#include "backend/metal/InputStateMTL.h"
+#include "backend/metal/PipelineMTL.h"
+#include "backend/metal/PipelineLayoutMTL.h"
+#include "backend/metal/ResourceUploader.h"
+#include "backend/metal/SamplerMTL.h"
+#include "backend/metal/ShaderModuleMTL.h"
+#include "backend/metal/TextureMTL.h"
namespace backend {
namespace metal {
diff --git a/src/backend/metal/PipelineLayoutMTL.h b/src/backend/metal/PipelineLayoutMTL.h
index e944e33..34b4fda 100644
--- a/src/backend/metal/PipelineLayoutMTL.h
+++ b/src/backend/metal/PipelineLayoutMTL.h
@@ -15,9 +15,9 @@
#ifndef BACKEND_METAL_PIPELINELAYOUTMTL_H_
#define BACKEND_METAL_PIPELINELAYOUTMTL_H_
-#include "common/PipelineLayout.h"
+#include "backend/PipelineLayout.h"
-#include "common/PerStage.h"
+#include "backend/PerStage.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/PipelineLayoutMTL.mm b/src/backend/metal/PipelineLayoutMTL.mm
index 5fcadb9..071c144 100644
--- a/src/backend/metal/PipelineLayoutMTL.mm
+++ b/src/backend/metal/PipelineLayoutMTL.mm
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "PipelineLayoutMTL.h"
+#include "backend/metal/PipelineLayoutMTL.h"
-#include "MetalBackend.h"
+#include "backend/metal/MetalBackend.h"
namespace backend {
namespace metal {
diff --git a/src/backend/metal/PipelineMTL.h b/src/backend/metal/PipelineMTL.h
index d3e97f2..9d049f3 100644
--- a/src/backend/metal/PipelineMTL.h
+++ b/src/backend/metal/PipelineMTL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_METAL_PIPELINEMTL_H_
#define BACKEND_METAL_PIPELINEMTL_H_
-#include "common/Pipeline.h"
+#include "backend/Pipeline.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/PipelineMTL.mm b/src/backend/metal/PipelineMTL.mm
index 8b92aee..6f77a4b 100644
--- a/src/backend/metal/PipelineMTL.mm
+++ b/src/backend/metal/PipelineMTL.mm
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "PipelineMTL.h"
+#include "backend/metal/PipelineMTL.h"
-#include "DepthStencilStateMTL.h"
-#include "InputStateMTL.h"
-#include "MetalBackend.h"
-#include "PipelineLayoutMTL.h"
-#include "ShaderModuleMTL.h"
+#include "backend/metal/DepthStencilStateMTL.h"
+#include "backend/metal/InputStateMTL.h"
+#include "backend/metal/MetalBackend.h"
+#include "backend/metal/PipelineLayoutMTL.h"
+#include "backend/metal/ShaderModuleMTL.h"
namespace backend {
namespace metal {
diff --git a/src/backend/metal/ResourceUploader.h b/src/backend/metal/ResourceUploader.h
index ecd307b..c95f74f 100644
--- a/src/backend/metal/ResourceUploader.h
+++ b/src/backend/metal/ResourceUploader.h
@@ -15,6 +15,7 @@
#ifndef BACKEND_METAL_RESOURCEUPLOADER_H_
#define BACKEND_METAL_RESOURCEUPLOADER_H_
+#include "common/Serial.h"
#include "common/SerialQueue.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/ResourceUploader.mm b/src/backend/metal/ResourceUploader.mm
index 1d8c6f0..058bfc6 100644
--- a/src/backend/metal/ResourceUploader.mm
+++ b/src/backend/metal/ResourceUploader.mm
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ResourceUploader.h"
+#include "backend/metal/ResourceUploader.h"
-#include "MetalBackend.h"
+#include "backend/metal/MetalBackend.h"
namespace backend {
namespace metal {
diff --git a/src/backend/metal/SamplerMTL.h b/src/backend/metal/SamplerMTL.h
index 5990e55..84b485d 100644
--- a/src/backend/metal/SamplerMTL.h
+++ b/src/backend/metal/SamplerMTL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_METAL_SAMPLERMTL_H_
#define BACKEND_METAL_SAMPLERMTL_H_
-#include "common/Sampler.h"
+#include "backend/Sampler.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/SamplerMTL.mm b/src/backend/metal/SamplerMTL.mm
index fbaa8b2..a3ef42c 100644
--- a/src/backend/metal/SamplerMTL.mm
+++ b/src/backend/metal/SamplerMTL.mm
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "SamplerMTL.h"
+#include "backend/metal/SamplerMTL.h"
-#include "MetalBackend.h"
+#include "backend/metal/MetalBackend.h"
namespace backend {
namespace metal {
diff --git a/src/backend/metal/ShaderModuleMTL.h b/src/backend/metal/ShaderModuleMTL.h
index 6b7c3f7..3896922 100644
--- a/src/backend/metal/ShaderModuleMTL.h
+++ b/src/backend/metal/ShaderModuleMTL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_METAL_SHADERMODULEMTL_H_
#define BACKEND_METAL_SHADERMODULEMTL_H_
-#include "common/ShaderModule.h"
+#include "backend/ShaderModule.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/ShaderModuleMTL.mm b/src/backend/metal/ShaderModuleMTL.mm
index 5247eaf..5b2b804 100644
--- a/src/backend/metal/ShaderModuleMTL.mm
+++ b/src/backend/metal/ShaderModuleMTL.mm
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ShaderModuleMTL.h"
+#include "backend/metal/ShaderModuleMTL.h"
-#include "MetalBackend.h"
+#include "backend/metal/MetalBackend.h"
#include <spirv-cross/spirv_msl.hpp>
diff --git a/src/backend/metal/TextureMTL.h b/src/backend/metal/TextureMTL.h
index bc72cd1..019276c 100644
--- a/src/backend/metal/TextureMTL.h
+++ b/src/backend/metal/TextureMTL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_METAL_TEXTUREMTL_H_
#define BACKEND_METAL_TEXTUREMTL_H_
-#include "common/Texture.h"
+#include "backend/Texture.h"
#import <Metal/Metal.h>
diff --git a/src/backend/metal/TextureMTL.mm b/src/backend/metal/TextureMTL.mm
index 46119ab..b00faf4 100644
--- a/src/backend/metal/TextureMTL.mm
+++ b/src/backend/metal/TextureMTL.mm
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "TextureMTL.h"
+#include "backend/metal/TextureMTL.h"
-#include "MetalBackend.h"
+#include "backend/metal/MetalBackend.h"
namespace backend {
namespace metal {
diff --git a/src/backend/null/GeneratedCodeIncludes.h b/src/backend/null/GeneratedCodeIncludes.h
index 22c328d..d06abba 100644
--- a/src/backend/null/GeneratedCodeIncludes.h
+++ b/src/backend/null/GeneratedCodeIncludes.h
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "NullBackend.h"
+#include "backend/null/NullBackend.h"
diff --git a/src/backend/null/NullBackend.cpp b/src/backend/null/NullBackend.cpp
index 0e0ff38..397e4b4 100644
--- a/src/backend/null/NullBackend.cpp
+++ b/src/backend/null/NullBackend.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "NullBackend.h"
+#include "backend/null/NullBackend.h"
#include <spirv-cross/spirv_cross.hpp>
diff --git a/src/backend/null/NullBackend.h b/src/backend/null/NullBackend.h
index d2ebf72..0c5ea7b 100644
--- a/src/backend/null/NullBackend.h
+++ b/src/backend/null/NullBackend.h
@@ -17,22 +17,22 @@
#include "nxt/nxtcpp.h"
-#include "common/Buffer.h"
-#include "common/BindGroup.h"
-#include "common/BindGroupLayout.h"
-#include "common/Device.h"
-#include "common/CommandBuffer.h"
-#include "common/DepthStencilState.h"
-#include "common/InputState.h"
-#include "common/Framebuffer.h"
-#include "common/Pipeline.h"
-#include "common/PipelineLayout.h"
-#include "common/Queue.h"
-#include "common/RenderPass.h"
-#include "common/Sampler.h"
-#include "common/ShaderModule.h"
-#include "common/Texture.h"
-#include "common/ToBackend.h"
+#include "backend/Buffer.h"
+#include "backend/BindGroup.h"
+#include "backend/BindGroupLayout.h"
+#include "backend/Device.h"
+#include "backend/CommandBuffer.h"
+#include "backend/DepthStencilState.h"
+#include "backend/InputState.h"
+#include "backend/Framebuffer.h"
+#include "backend/Pipeline.h"
+#include "backend/PipelineLayout.h"
+#include "backend/Queue.h"
+#include "backend/RenderPass.h"
+#include "backend/Sampler.h"
+#include "backend/ShaderModule.h"
+#include "backend/Texture.h"
+#include "backend/ToBackend.h"
namespace backend {
namespace null {
diff --git a/src/backend/opengl/CommandBufferGL.cpp b/src/backend/opengl/CommandBufferGL.cpp
index 9a86d5a..485035c 100644
--- a/src/backend/opengl/CommandBufferGL.cpp
+++ b/src/backend/opengl/CommandBufferGL.cpp
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "CommandBufferGL.h"
+#include "backend/opengl/CommandBufferGL.h"
-#include "common/Commands.h"
-#include "OpenGLBackend.h"
-#include "PersistentPipelineStateGL.h"
-#include "PipelineGL.h"
-#include "PipelineLayoutGL.h"
-#include "SamplerGL.h"
-#include "TextureGL.h"
+#include "backend/Commands.h"
+#include "backend/opengl/OpenGLBackend.h"
+#include "backend/opengl/PersistentPipelineStateGL.h"
+#include "backend/opengl/PipelineGL.h"
+#include "backend/opengl/PipelineLayoutGL.h"
+#include "backend/opengl/SamplerGL.h"
+#include "backend/opengl/TextureGL.h"
#include <cstring>
diff --git a/src/backend/opengl/CommandBufferGL.h b/src/backend/opengl/CommandBufferGL.h
index 69aa8a9..79891de 100644
--- a/src/backend/opengl/CommandBufferGL.h
+++ b/src/backend/opengl/CommandBufferGL.h
@@ -15,8 +15,8 @@
#ifndef BACKEND_OPENGL_COMMANDBUFFERGL_H_
#define BACKEND_OPENGL_COMMANDBUFFERGL_H_
-#include "common/CommandAllocator.h"
-#include "common/CommandBuffer.h"
+#include "backend/CommandAllocator.h"
+#include "backend/CommandBuffer.h"
namespace backend {
namespace opengl {
diff --git a/src/backend/opengl/DepthStencilStateGL.cpp b/src/backend/opengl/DepthStencilStateGL.cpp
index fd947e8..97d1830 100644
--- a/src/backend/opengl/DepthStencilStateGL.cpp
+++ b/src/backend/opengl/DepthStencilStateGL.cpp
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "DepthStencilStateGL.h"
+#include "backend/opengl/DepthStencilStateGL.h"
-#include "OpenGLBackend.h"
-#include "PersistentPipelineStateGL.h"
+#include "backend/opengl/OpenGLBackend.h"
+#include "backend/opengl/PersistentPipelineStateGL.h"
namespace backend {
namespace opengl {
diff --git a/src/backend/opengl/DepthStencilStateGL.h b/src/backend/opengl/DepthStencilStateGL.h
index 8245a87..5c5d781 100644
--- a/src/backend/opengl/DepthStencilStateGL.h
+++ b/src/backend/opengl/DepthStencilStateGL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_OPENGL_DEPTHSTENCILSTATEGL_H_
#define BACKEND_OPENGL_DEPTHSTENCILSTATEGL_H_
-#include "common/DepthStencilState.h"
+#include "backend/DepthStencilState.h"
namespace backend {
namespace opengl {
diff --git a/src/backend/opengl/GeneratedCodeIncludes.h b/src/backend/opengl/GeneratedCodeIncludes.h
index bc9913f..47ae6bd 100644
--- a/src/backend/opengl/GeneratedCodeIncludes.h
+++ b/src/backend/opengl/GeneratedCodeIncludes.h
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "OpenGLBackend.h"
-#include "CommandBufferGL.h"
-#include "DepthStencilStateGL.h"
-#include "PersistentPipelineStateGL.h"
-#include "PipelineGL.h"
-#include "PipelineLayoutGL.h"
-#include "SamplerGL.h"
-#include "ShaderModuleGL.h"
-#include "TextureGL.h"
+#include "backend/opengl/OpenGLBackend.h"
+#include "backend/opengl/CommandBufferGL.h"
+#include "backend/opengl/DepthStencilStateGL.h"
+#include "backend/opengl/PersistentPipelineStateGL.h"
+#include "backend/opengl/PipelineGL.h"
+#include "backend/opengl/PipelineLayoutGL.h"
+#include "backend/opengl/SamplerGL.h"
+#include "backend/opengl/ShaderModuleGL.h"
+#include "backend/opengl/TextureGL.h"
diff --git a/src/backend/opengl/OpenGLBackend.cpp b/src/backend/opengl/OpenGLBackend.cpp
index 4cf071c..8a771ff 100644
--- a/src/backend/opengl/OpenGLBackend.cpp
+++ b/src/backend/opengl/OpenGLBackend.cpp
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "OpenGLBackend.h"
+#include "backend/opengl/OpenGLBackend.h"
-#include "CommandBufferGL.h"
-#include "DepthStencilStateGL.h"
-#include "PipelineGL.h"
-#include "PipelineLayoutGL.h"
-#include "ShaderModuleGL.h"
-#include "SamplerGL.h"
-#include "TextureGL.h"
+#include "backend/opengl/CommandBufferGL.h"
+#include "backend/opengl/DepthStencilStateGL.h"
+#include "backend/opengl/PipelineGL.h"
+#include "backend/opengl/PipelineLayoutGL.h"
+#include "backend/opengl/ShaderModuleGL.h"
+#include "backend/opengl/SamplerGL.h"
+#include "backend/opengl/TextureGL.h"
namespace backend {
namespace opengl {
diff --git a/src/backend/opengl/OpenGLBackend.h b/src/backend/opengl/OpenGLBackend.h
index a6ab353..82dcfbe 100644
--- a/src/backend/opengl/OpenGLBackend.h
+++ b/src/backend/opengl/OpenGLBackend.h
@@ -17,16 +17,16 @@
#include "nxt/nxtcpp.h"
-#include "common/Buffer.h"
-#include "common/BindGroup.h"
-#include "common/BindGroupLayout.h"
-#include "common/Device.h"
-#include "common/DepthStencilState.h"
-#include "common/Framebuffer.h"
-#include "common/InputState.h"
-#include "common/Queue.h"
-#include "common/RenderPass.h"
-#include "common/ToBackend.h"
+#include "backend/Buffer.h"
+#include "backend/BindGroup.h"
+#include "backend/BindGroupLayout.h"
+#include "backend/Device.h"
+#include "backend/DepthStencilState.h"
+#include "backend/Framebuffer.h"
+#include "backend/InputState.h"
+#include "backend/Queue.h"
+#include "backend/RenderPass.h"
+#include "backend/ToBackend.h"
#include "glad/glad.h"
diff --git a/src/backend/opengl/PersistentPipelineStateGL.cpp b/src/backend/opengl/PersistentPipelineStateGL.cpp
index 480c521..bb81e75 100644
--- a/src/backend/opengl/PersistentPipelineStateGL.cpp
+++ b/src/backend/opengl/PersistentPipelineStateGL.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "PersistentPipelineStateGL.h"
+#include "backend/opengl/PersistentPipelineStateGL.h"
-#include "OpenGLBackend.h"
+#include "backend/opengl/OpenGLBackend.h"
namespace backend {
namespace opengl {
diff --git a/src/backend/opengl/PipelineGL.cpp b/src/backend/opengl/PipelineGL.cpp
index ae0edbe..01cbfee 100644
--- a/src/backend/opengl/PipelineGL.cpp
+++ b/src/backend/opengl/PipelineGL.cpp
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "PipelineGL.h"
+#include "backend/opengl/PipelineGL.h"
-#include "DepthStencilStateGL.h"
-#include "OpenGLBackend.h"
-#include "PersistentPipelineStateGL.h"
-#include "PipelineLayoutGL.h"
-#include "ShaderModuleGL.h"
+#include "backend/opengl/DepthStencilStateGL.h"
+#include "backend/opengl/OpenGLBackend.h"
+#include "backend/opengl/PersistentPipelineStateGL.h"
+#include "backend/opengl/PipelineLayoutGL.h"
+#include "backend/opengl/ShaderModuleGL.h"
#include <iostream>
#include <set>
diff --git a/src/backend/opengl/PipelineGL.h b/src/backend/opengl/PipelineGL.h
index 89b54e8..1dc8af6 100644
--- a/src/backend/opengl/PipelineGL.h
+++ b/src/backend/opengl/PipelineGL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_OPENGL_PIPELINEGL_H_
#define BACKEND_OPENGL_PIPELINEGL_H_
-#include "common/Pipeline.h"
+#include "backend/Pipeline.h"
#include "glad/glad.h"
diff --git a/src/backend/opengl/PipelineLayoutGL.cpp b/src/backend/opengl/PipelineLayoutGL.cpp
index 1ee6b12..cff8413 100644
--- a/src/backend/opengl/PipelineLayoutGL.cpp
+++ b/src/backend/opengl/PipelineLayoutGL.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "PipelineLayoutGL.h"
+#include "backend/opengl/PipelineLayoutGL.h"
-#include "OpenGLBackend.h"
+#include "backend/opengl/OpenGLBackend.h"
namespace backend {
namespace opengl {
diff --git a/src/backend/opengl/PipelineLayoutGL.h b/src/backend/opengl/PipelineLayoutGL.h
index e285ccd..3ebfe0e8 100644
--- a/src/backend/opengl/PipelineLayoutGL.h
+++ b/src/backend/opengl/PipelineLayoutGL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_OPENGL_PIPELINELAYOUTGL_H_
#define BACKEND_OPENGL_PIPELINELAYOUTGL_H_
-#include "common/PipelineLayout.h"
+#include "backend/PipelineLayout.h"
#include "glad/glad.h"
diff --git a/src/backend/opengl/SamplerGL.cpp b/src/backend/opengl/SamplerGL.cpp
index c48fc96..35489c5 100644
--- a/src/backend/opengl/SamplerGL.cpp
+++ b/src/backend/opengl/SamplerGL.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "SamplerGL.h"
+#include "backend/opengl/SamplerGL.h"
namespace backend {
namespace opengl {
diff --git a/src/backend/opengl/SamplerGL.h b/src/backend/opengl/SamplerGL.h
index eeae99d..86c729d 100644
--- a/src/backend/opengl/SamplerGL.h
+++ b/src/backend/opengl/SamplerGL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_OPENGL_SAMPLERGL_H_
#define BACKEND_OPENGL_SAMPLERGL_H_
-#include "common/Sampler.h"
+#include "backend/Sampler.h"
#include "glad/glad.h"
diff --git a/src/backend/opengl/ShaderModuleGL.cpp b/src/backend/opengl/ShaderModuleGL.cpp
index 80939e2..8f3e0c8 100644
--- a/src/backend/opengl/ShaderModuleGL.cpp
+++ b/src/backend/opengl/ShaderModuleGL.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ShaderModuleGL.h"
+#include "backend/opengl/ShaderModuleGL.h"
#include <spirv-cross/spirv_glsl.hpp>
diff --git a/src/backend/opengl/ShaderModuleGL.h b/src/backend/opengl/ShaderModuleGL.h
index d4f3860..8d8f0d6 100644
--- a/src/backend/opengl/ShaderModuleGL.h
+++ b/src/backend/opengl/ShaderModuleGL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_OPENGL_SHADERMODULEGL_H_
#define BACKEND_OPENGL_SHADERMODULEGL_H_
-#include "common/ShaderModule.h"
+#include "backend/ShaderModule.h"
#include "glad/glad.h"
diff --git a/src/backend/opengl/TextureGL.cpp b/src/backend/opengl/TextureGL.cpp
index bd9d1e2..9670b67 100644
--- a/src/backend/opengl/TextureGL.cpp
+++ b/src/backend/opengl/TextureGL.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "TextureGL.h"
+#include "backend/opengl/TextureGL.h"
#include <algorithm>
#include <vector>
diff --git a/src/backend/opengl/TextureGL.h b/src/backend/opengl/TextureGL.h
index 0c46f8d..08b37d1 100644
--- a/src/backend/opengl/TextureGL.h
+++ b/src/backend/opengl/TextureGL.h
@@ -15,7 +15,7 @@
#ifndef BACKEND_OPENGL_TEXTUREGL_H_
#define BACKEND_OPENGL_TEXTUREGL_H_
-#include "common/Texture.h"
+#include "backend/Texture.h"
#include "glad/glad.h"
diff --git a/src/backend/common/BitSetIterator.h b/src/common/BitSetIterator.h
similarity index 95%
rename from src/backend/common/BitSetIterator.h
rename to src/common/BitSetIterator.h
index 32337dd..df0702c 100644
--- a/src/backend/common/BitSetIterator.h
+++ b/src/common/BitSetIterator.h
@@ -12,15 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_BITSETITERATOR_H_
-#define BACKEND_COMMON_BITSETITERATOR_H_
+#ifndef COMMON_BITSETITERATOR_H_
+#define COMMON_BITSETITERATOR_H_
-#include "Forward.h"
-#include "Math.h"
+#include "common/Math.h"
+#include <cassert>
#include <bitset>
#include <limits>
+#define ASSERT assert
+
// This is ANGLE's BitSetIterator class with a customizable return type
// TODO(cwallez@chromium.org): it could be optimized, in particular when N <= 64
@@ -132,4 +134,4 @@
}
-#endif // BACKEND_COMMON_BITSETITERATOR_H_
+#endif // COMMON_BITSETITERATOR_H_
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
new file mode 100644
index 0000000..7eabb07
--- /dev/null
+++ b/src/common/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Copyright 2017 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.
+
+set(COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+
+list(APPEND COMMON_SOURCES
+ ${COMMON_DIR}/BitSetIterator.h
+ ${COMMON_DIR}/Math.cpp
+ ${COMMON_DIR}/Math.h
+ ${COMMON_DIR}/Serial.h
+ ${COMMON_DIR}/SerialQueue.h
+)
+
+add_library(nxt_common STATIC ${COMMON_SOURCES})
+target_include_directories(nxt_common PUBLIC ${SRC_DIR})
+SetCXX14(nxt_common)
diff --git a/src/common/Constants.h b/src/common/Constants.h
new file mode 100644
index 0000000..1d8f295
--- /dev/null
+++ b/src/common/Constants.h
@@ -0,0 +1,28 @@
+// Copyright 2017 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 COMMON_CONSTANTS_H_
+#define COMMON_CONSTANTS_H_
+
+#include <cstdint>
+
+static constexpr uint32_t kMaxPushConstants = 32u;
+static constexpr uint32_t kMaxBindGroups = 4u;
+static constexpr uint32_t kMaxBindingsPerGroup = 16u; // TODO(cwallez@chromium.org): investigate bindgroup limits
+static constexpr uint32_t kMaxVertexAttributes = 16u;
+static constexpr uint32_t kMaxVertexInputs = 16u;
+static constexpr uint32_t kNumStages = 3;
+static constexpr uint32_t kMaxColorAttachments = 4u;
+
+#endif // COMMON_CONSTANTS_H_
diff --git a/src/backend/common/Math.cpp b/src/common/Math.cpp
similarity index 96%
rename from src/backend/common/Math.cpp
rename to src/common/Math.cpp
index 874aee0..ec9b3e9 100644
--- a/src/backend/common/Math.cpp
+++ b/src/common/Math.cpp
@@ -12,13 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "Math.h"
+#include "common/Math.h"
#if defined(_WIN32) || defined(_WIN64)
#include <intrin.h>
#endif
-#include "Forward.h"
+#include <cassert>
+#define ASSERT assert
namespace backend {
diff --git a/src/backend/common/Math.h b/src/common/Math.h
similarity index 91%
rename from src/backend/common/Math.h
rename to src/common/Math.h
index 9eaafd3..acc5629 100644
--- a/src/backend/common/Math.h
+++ b/src/common/Math.h
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_MATH_H_
-#define BACKEND_COMMON_MATH_H_
+#ifndef COMMON_MATH_H_
+#define COMMON_MATH_H_
#include <cstddef>
-#include "cstdint"
+#include <cstdint>
namespace backend {
@@ -40,4 +40,4 @@
}
-#endif // BACKEND_COMMON_MATH_H_
+#endif // COMMON_MATH_H_
diff --git a/src/common/Serial.h b/src/common/Serial.h
new file mode 100644
index 0000000..d97c786
--- /dev/null
+++ b/src/common/Serial.h
@@ -0,0 +1,22 @@
+// Copyright 2017 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 COMMON_SERIAL_H_
+#define COMMON_SERIAL_H_
+
+#include <cstdint>
+
+using Serial = uint64_t;
+
+#endif // COMMON_SERIAL_H_
diff --git a/src/backend/common/SerialQueue.h b/src/common/SerialQueue.h
similarity index 98%
rename from src/backend/common/SerialQueue.h
rename to src/common/SerialQueue.h
index 09dcbfc..eef7c38 100644
--- a/src/backend/common/SerialQueue.h
+++ b/src/common/SerialQueue.h
@@ -12,14 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef BACKEND_COMMON_SERIALQUEUE_H_
-#define BACKEND_COMMON_SERIALQUEUE_H_
+#ifndef COMMON_SERIALQUEUE_H_
+#define COMMON_SERIALQUEUE_H_
-#include "Forward.h"
+#include "common/Serial.h"
+#include <cassert>
#include <cstdint>
#include <vector>
+#define ASSERT assert
+
namespace backend {
template<typename T>
@@ -330,4 +333,4 @@
}
}
-#endif // BACKEND_COMMON_SERIALQUEUE_H_
+#endif // COMMON_SERIALQUEUE_H_
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 87759c5..6eb9ab3 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -40,8 +40,7 @@
${VALIDATION_TESTS_DIR}/ValidationTest.h
${TESTS_DIR}/UnittestsMain.cpp
)
-target_link_libraries(nxt_unittests gtest nxt_backend mock_nxt nxt_wire utils)
-target_include_directories(nxt_unittests PRIVATE ${SRC_DIR})
+target_link_libraries(nxt_unittests nxt_common gtest nxt_backend mock_nxt nxt_wire utils)
SetCXX14(nxt_unittests)
add_executable(nxt_end2end_tests
@@ -51,6 +50,5 @@
${TESTS_DIR}/NXTTest.cpp
${TESTS_DIR}/NXTTest.h
)
-target_link_libraries(nxt_end2end_tests gtest utils)
-target_include_directories(nxt_end2end_tests PRIVATE ${SRC_DIR})
+target_link_libraries(nxt_end2end_tests nxt_common gtest utils)
SetCXX14(nxt_end2end_tests)
diff --git a/src/tests/NXTTest.cpp b/src/tests/NXTTest.cpp
index dd6a22b..2f93939 100644
--- a/src/tests/NXTTest.cpp
+++ b/src/tests/NXTTest.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "NXTTest.h"
+#include "tests/NXTTest.h"
#include "utils/BackendBinding.h"
diff --git a/src/tests/unittests/BitSetIteratorTests.cpp b/src/tests/unittests/BitSetIteratorTests.cpp
index 652550f..b1ac2e7 100644
--- a/src/tests/unittests/BitSetIteratorTests.cpp
+++ b/src/tests/unittests/BitSetIteratorTests.cpp
@@ -14,7 +14,7 @@
#include <gtest/gtest.h>
-#include "backend/common/BitSetIterator.h"
+#include "common/BitSetIterator.h"
// This is ANGLE's BitSetIterator_unittests.cpp file.
diff --git a/src/tests/unittests/CommandAllocatorTests.cpp b/src/tests/unittests/CommandAllocatorTests.cpp
index e958377..faccdff 100644
--- a/src/tests/unittests/CommandAllocatorTests.cpp
+++ b/src/tests/unittests/CommandAllocatorTests.cpp
@@ -14,7 +14,7 @@
#include <gtest/gtest.h>
-#include "backend/common/CommandAllocator.h"
+#include "backend/CommandAllocator.h"
using namespace backend;
diff --git a/src/tests/unittests/MathTests.cpp b/src/tests/unittests/MathTests.cpp
index 0f7a73a..eded294 100644
--- a/src/tests/unittests/MathTests.cpp
+++ b/src/tests/unittests/MathTests.cpp
@@ -14,7 +14,7 @@
#include <gtest/gtest.h>
-#include "backend/common/Math.h"
+#include "common/Math.h"
using namespace backend;
diff --git a/src/tests/unittests/PerStageTests.cpp b/src/tests/unittests/PerStageTests.cpp
index c3e7169..4af11ff 100644
--- a/src/tests/unittests/PerStageTests.cpp
+++ b/src/tests/unittests/PerStageTests.cpp
@@ -14,7 +14,7 @@
#include <gtest/gtest.h>
-#include "backend/common/PerStage.h"
+#include "backend/PerStage.h"
using namespace backend;
diff --git a/src/tests/unittests/RefCountedTests.cpp b/src/tests/unittests/RefCountedTests.cpp
index fb9c671..1ba3a97 100644
--- a/src/tests/unittests/RefCountedTests.cpp
+++ b/src/tests/unittests/RefCountedTests.cpp
@@ -14,7 +14,7 @@
#include <gtest/gtest.h>
-#include "backend/common/RefCounted.h"
+#include "backend/RefCounted.h"
using namespace backend;
diff --git a/src/tests/unittests/SerialQueueTests.cpp b/src/tests/unittests/SerialQueueTests.cpp
index 1819c2d..f4f22aa 100644
--- a/src/tests/unittests/SerialQueueTests.cpp
+++ b/src/tests/unittests/SerialQueueTests.cpp
@@ -14,7 +14,7 @@
#include <gtest/gtest.h>
-#include "backend/common/SerialQueue.h"
+#include "common/SerialQueue.h"
using SerialQueue = backend::SerialQueue<int>;
diff --git a/src/tests/unittests/ToBackendTests.cpp b/src/tests/unittests/ToBackendTests.cpp
index 62405d0..d7612d9 100644
--- a/src/tests/unittests/ToBackendTests.cpp
+++ b/src/tests/unittests/ToBackendTests.cpp
@@ -14,8 +14,8 @@
#include <gtest/gtest.h>
-#include "backend/common/RefCounted.h"
-#include "backend/common/ToBackend.h"
+#include "backend/RefCounted.h"
+#include "backend/ToBackend.h"
#include <type_traits>
diff --git a/src/tests/unittests/WireTests.cpp b/src/tests/unittests/WireTests.cpp
index 55de62d..06a3585 100644
--- a/src/tests/unittests/WireTests.cpp
+++ b/src/tests/unittests/WireTests.cpp
@@ -18,8 +18,6 @@
#include "wire/TerribleCommandBuffer.h"
#include "wire/Wire.h"
-#include <iostream>
-
using namespace testing;
using namespace nxt::wire;
diff --git a/src/tests/unittests/validation/BufferValidationTests.cpp b/src/tests/unittests/validation/BufferValidationTests.cpp
index 928cee4..1c2b914 100644
--- a/src/tests/unittests/validation/BufferValidationTests.cpp
+++ b/src/tests/unittests/validation/BufferValidationTests.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ValidationTest.h"
+#include "tests/unittests/validation/ValidationTest.h"
#include <gmock/gmock.h>
diff --git a/src/tests/unittests/validation/CommandBufferValidationTests.cpp b/src/tests/unittests/validation/CommandBufferValidationTests.cpp
index f6feaf8..3c2ad87 100644
--- a/src/tests/unittests/validation/CommandBufferValidationTests.cpp
+++ b/src/tests/unittests/validation/CommandBufferValidationTests.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ValidationTest.h"
+#include "tests/unittests/validation/ValidationTest.h"
class CommandBufferValidationTest : public ValidationTest {
};
diff --git a/src/tests/unittests/validation/ComputeValidationTests.cpp b/src/tests/unittests/validation/ComputeValidationTests.cpp
index 59a8ccc..59b963a 100644
--- a/src/tests/unittests/validation/ComputeValidationTests.cpp
+++ b/src/tests/unittests/validation/ComputeValidationTests.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ValidationTest.h"
+#include "tests/unittests/validation/ValidationTest.h"
class ComputeValidationTest : public ValidationTest {
};
diff --git a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
index bda37fc..47de480 100644
--- a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
+++ b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ValidationTest.h"
+#include "tests/unittests/validation/ValidationTest.h"
class CopyCommandTest : public ValidationTest {
protected:
diff --git a/src/tests/unittests/validation/DepthStencilStateValidationTests.cpp b/src/tests/unittests/validation/DepthStencilStateValidationTests.cpp
index b7f6aff..a961890 100644
--- a/src/tests/unittests/validation/DepthStencilStateValidationTests.cpp
+++ b/src/tests/unittests/validation/DepthStencilStateValidationTests.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ValidationTest.h"
+#include "tests/unittests/validation/ValidationTest.h"
class DepthStencilStateValidationTest : public ValidationTest {
};
diff --git a/src/tests/unittests/validation/FramebufferValidationTests.cpp b/src/tests/unittests/validation/FramebufferValidationTests.cpp
index 027ca8e..cc90e10 100644
--- a/src/tests/unittests/validation/FramebufferValidationTests.cpp
+++ b/src/tests/unittests/validation/FramebufferValidationTests.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ValidationTest.h"
+#include "tests/unittests/validation/ValidationTest.h"
class FramebufferValidationTest : public ValidationTest {
};
diff --git a/src/tests/unittests/validation/InputStateValidationTests.cpp b/src/tests/unittests/validation/InputStateValidationTests.cpp
index 745d8e5..442e7f6 100644
--- a/src/tests/unittests/validation/InputStateValidationTests.cpp
+++ b/src/tests/unittests/validation/InputStateValidationTests.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ValidationTest.h"
+#include "tests/unittests/validation/ValidationTest.h"
#include "utils/NXTHelpers.h"
diff --git a/src/tests/unittests/validation/RenderPassValidationTests.cpp b/src/tests/unittests/validation/RenderPassValidationTests.cpp
index 5d6b448..071d58b 100644
--- a/src/tests/unittests/validation/RenderPassValidationTests.cpp
+++ b/src/tests/unittests/validation/RenderPassValidationTests.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ValidationTest.h"
+#include "tests/unittests/validation/ValidationTest.h"
class RenderPassValidationTest : public ValidationTest {
};
diff --git a/src/tests/unittests/validation/ValidationTest.cpp b/src/tests/unittests/validation/ValidationTest.cpp
index 2bbd0a0..dadc600 100644
--- a/src/tests/unittests/validation/ValidationTest.cpp
+++ b/src/tests/unittests/validation/ValidationTest.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "ValidationTest.h"
+#include "tests/unittests/validation/ValidationTest.h"
#include "nxt/nxt.h"
diff --git a/src/utils/BackendBinding.cpp b/src/utils/BackendBinding.cpp
index e3eb497..917c4d6 100644
--- a/src/utils/BackendBinding.cpp
+++ b/src/utils/BackendBinding.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BackendBinding.h"
+#include "utils/BackendBinding.h"
namespace utils {
diff --git a/src/utils/D3D12Binding.cpp b/src/utils/D3D12Binding.cpp
index c616dde..3780088 100644
--- a/src/utils/D3D12Binding.cpp
+++ b/src/utils/D3D12Binding.cpp
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BackendBinding.h"
+#include "utils/BackendBinding.h"
#define GLFW_EXPOSE_NATIVE_WIN32
#include "GLFW/glfw3.h"
#include "GLFW/glfw3native.h"
-#include <assert.h>
+#include <cassert>
#include <initializer_list>
#include <wrl.h>
#include <d3d12.h>
diff --git a/src/utils/MetalBinding.mm b/src/utils/MetalBinding.mm
index 417c122..74271ff 100644
--- a/src/utils/MetalBinding.mm
+++ b/src/utils/MetalBinding.mm
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BackendBinding.h"
+#include "utils/BackendBinding.h"
#define GLFW_EXPOSE_NATIVE_COCOA
#include "GLFW/glfw3.h"
diff --git a/src/utils/NXTHelpers.cpp b/src/utils/NXTHelpers.cpp
index 9fc6808..cecdb36 100644
--- a/src/utils/NXTHelpers.cpp
+++ b/src/utils/NXTHelpers.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "NXTHelpers.h"
+#include "utils/NXTHelpers.h"
#include <shaderc/shaderc.hpp>
diff --git a/src/utils/NullBinding.cpp b/src/utils/NullBinding.cpp
index 8ef8502..9336434 100644
--- a/src/utils/NullBinding.cpp
+++ b/src/utils/NullBinding.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BackendBinding.h"
+#include "utils/BackendBinding.h"
namespace backend {
namespace null {
diff --git a/src/utils/OpenGLBinding.cpp b/src/utils/OpenGLBinding.cpp
index b948a78..6f5f999 100644
--- a/src/utils/OpenGLBinding.cpp
+++ b/src/utils/OpenGLBinding.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "BackendBinding.h"
+#include "utils/BackendBinding.h"
#include "GLFW/glfw3.h"
diff --git a/src/wire/CMakeLists.txt b/src/wire/CMakeLists.txt
index 1a68638..311f455 100644
--- a/src/wire/CMakeLists.txt
+++ b/src/wire/CMakeLists.txt
@@ -29,7 +29,7 @@
)
target_include_directories(wire_autogen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(wire_autogen PUBLIC ${GENERATED_DIR})
-target_link_libraries(wire_autogen nxt)
+target_link_libraries(wire_autogen nxt nxt_common)
SetCXX14(wire_autogen)
SetPic(wire_autogen)
diff --git a/src/wire/TerribleCommandBuffer.cpp b/src/wire/TerribleCommandBuffer.cpp
index f54f5c6..7dcfb10 100644
--- a/src/wire/TerribleCommandBuffer.cpp
+++ b/src/wire/TerribleCommandBuffer.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "TerribleCommandBuffer.h"
+#include "wire/TerribleCommandBuffer.h"
namespace nxt {
namespace wire {
diff --git a/src/wire/TerribleCommandBuffer.h b/src/wire/TerribleCommandBuffer.h
index 4c0ab5f..32cd3d4 100644
--- a/src/wire/TerribleCommandBuffer.h
+++ b/src/wire/TerribleCommandBuffer.h
@@ -17,7 +17,7 @@
#include <vector>
-#include "Wire.h"
+#include "wire/Wire.h"
namespace nxt {
namespace wire {
diff --git a/src/wire/WireCmd.cpp b/src/wire/WireCmd.cpp
index 6033bb2..589a057 100644
--- a/src/wire/WireCmd.cpp
+++ b/src/wire/WireCmd.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "WireCmd.h"
+#include "wire/WireCmd.h"
namespace nxt {
namespace wire {