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.
This commit is contained in:
Corentin Wallez
2017-07-06 14:41:13 -04:00
committed by Corentin Wallez
parent a9b2a9871c
commit fffe6dfa16
161 changed files with 673 additions and 599 deletions

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_BINDGROUP_H_
#endif // BACKEND_BINDGROUP_H_

View File

@@ -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>

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_BINDGROUPLAYOUT_H_
#endif // BACKEND_BINDGROUPLAYOUT_H_

View File

@@ -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>

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_BUFFER_H_
#endif // BACKEND_BUFFER_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_BUILDER_H_
#endif // BACKEND_BUILDER_H_

View File

@@ -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(D3D12_DIR ${CMAKE_CURRENT_SOURCE_DIR}/d3d12)
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 @@ Generate(
-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 @@ Generate(
)
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 @@ if (APPLE)
-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 @@ if (WIN32)
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 @@ endif()
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)

View File

@@ -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>

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_COMMAND_ALLOCATOR_H_
#endif // BACKEND_COMMAND_ALLOCATOR_H_

View File

@@ -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>

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_COMMANDBUFFER_H_
#endif // BACKEND_COMMANDBUFFER_H_

View File

@@ -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)

View File

@@ -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 @@ namespace backend {
};
}
#endif // BACKEND_COMMON_COMMANDBUFFERSTATETRACKER_H
#endif // BACKEND_COMMANDBUFFERSTATETRACKER_H

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_COMMANDS_H_
#endif // BACKEND_COMMANDS_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_DEPTHSTENCILSTATE_H_
#endif // BACKEND_DEPTHSTENCILSTATE_H_

View File

@@ -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>

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_DEVICEBASE_H_
#endif // BACKEND_DEVICEBASE_H_

View File

@@ -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 @@ namespace backend {
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_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_FRAMEBUFFER_H_
#endif // BACKEND_FRAMEBUFFER_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_INPUTSTATE_H_
#endif // BACKEND_INPUTSTATE_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_PERSTAGE_H_
#endif // BACKEND_PERSTAGE_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_PIPELINE_H_
#endif // BACKEND_PIPELINE_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_PIPELINELAYOUT_H_
#endif // BACKEND_PIPELINELAYOUT_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_QUEUE_H_
#endif // BACKEND_QUEUE_H_

View File

@@ -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

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_REFCOUNTED_H_
#endif // BACKEND_REFCOUNTED_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_RENDERPASS_H_
#endif // BACKEND_RENDERPASS_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_SAMPLER_H_
#endif // BACKEND_SAMPLER_H_

View File

@@ -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>

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_SHADERMODULE_H_
#endif // BACKEND_SHADERMODULE_H_

View File

@@ -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 {

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_TEXTURE_H_
#endif // BACKEND_TEXTURE_H_

View File

@@ -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 @@ namespace backend {
}
#endif // BACKEND_COMMON_TOBACKEND_H_
#endif // BACKEND_TOBACKEND_H_

View File

@@ -1,135 +0,0 @@
// 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 BACKEND_COMMON_BITSETITERATOR_H_
#define BACKEND_COMMON_BITSETITERATOR_H_
#include "Forward.h"
#include "Math.h"
#include <bitset>
#include <limits>
// This is ANGLE's BitSetIterator class with a customizable return type
// TODO(cwallez@chromium.org): it could be optimized, in particular when N <= 64
namespace backend {
template <typename T>
T roundUp(const T value, const T alignment) {
auto temp = value + alignment - static_cast<T>(1);
return temp - temp % alignment;
}
template <size_t N, typename T>
class BitSetIterator final {
public:
BitSetIterator(const std::bitset<N>& bitset);
BitSetIterator(const BitSetIterator& other);
BitSetIterator &operator=(const BitSetIterator& other);
class Iterator final {
public:
Iterator(const std::bitset<N>& bits);
Iterator& operator++();
bool operator==(const Iterator& other) const;
bool operator!=(const Iterator& other) const;
T operator*() const { return static_cast<T>(mCurrentBit); }
private:
unsigned long getNextBit();
static const size_t BitsPerWord = sizeof(uint32_t) * 8;
std::bitset<N> mBits;
unsigned long mCurrentBit;
unsigned long mOffset;
};
Iterator begin() const { return Iterator(mBits); }
Iterator end() const { return Iterator(std::bitset<N>(0)); }
private:
const std::bitset<N> mBits;
};
template <size_t N, typename T>
BitSetIterator<N, T>::BitSetIterator(const std::bitset<N>& bitset)
: mBits(bitset) {
}
template <size_t N, typename T>
BitSetIterator<N, T>::BitSetIterator(const BitSetIterator& other)
: mBits(other.mBits) {
}
template <size_t N, typename T>
BitSetIterator<N, T>& BitSetIterator<N, T>::operator=(const BitSetIterator& other) {
mBits = other.mBits;
return *this;
}
template <size_t N, typename T>
BitSetIterator<N, T>::Iterator::Iterator(const std::bitset<N>& bits)
: mBits(bits), mCurrentBit(0), mOffset(0) {
if (bits.any()) {
mCurrentBit = getNextBit();
} else {
mOffset = static_cast<unsigned long>(roundUp(N, BitsPerWord));
}
}
template <size_t N, typename T>
typename BitSetIterator<N, T>::Iterator& BitSetIterator<N, T>::Iterator::operator++() {
ASSERT(mBits.any());
mBits.set(mCurrentBit - mOffset, 0);
mCurrentBit = getNextBit();
return *this;
}
template <size_t N, typename T>
bool BitSetIterator<N, T>::Iterator::operator==(const Iterator& other) const {
return mOffset == other.mOffset && mBits == other.mBits;
}
template <size_t N, typename T>
bool BitSetIterator<N, T>::Iterator::operator!=(const Iterator& other) const {
return !(*this == other);
}
template <size_t N, typename T>
unsigned long BitSetIterator<N, T>::Iterator::getNextBit() {
static std::bitset<N> wordMask(std::numeric_limits<uint32_t>::max());
while (mOffset < N) {
uint32_t wordBits = (mBits & wordMask).to_ulong();
if (wordBits != 0ul) {
return ScanForward(wordBits) + mOffset;
}
mBits >>= BitsPerWord;
mOffset += BitsPerWord;
}
return 0;
}
// Helper to avoid needing to specify the template parameter size
template <size_t N>
BitSetIterator<N, uint32_t> IterateBitSet(const std::bitset<N>& bitset) {
return BitSetIterator<N, uint32_t>(bitset);
}
}
#endif // BACKEND_COMMON_BITSETITERATOR_H_

View File

@@ -1,65 +0,0 @@
// 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.
#include "Math.h"
#if defined(_WIN32) || defined(_WIN64)
#include <intrin.h>
#endif
#include "Forward.h"
namespace backend {
uint32_t ScanForward(uint32_t bits) {
ASSERT(bits != 0);
#if defined(_WIN32) || defined(_WIN64)
unsigned long firstBitIndex = 0ul;
unsigned char ret = _BitScanForward(&firstBitIndex, bits);
ASSERT(ret != 0);
return firstBitIndex;
#else
return static_cast<unsigned long>(__builtin_ctz(bits));
#endif
}
uint32_t Log2(uint32_t value) {
ASSERT(value != 0);
#if defined(_WIN32) || defined(_WIN64)
unsigned long firstBitIndex = 0ul;
unsigned char ret = _BitScanReverse(&firstBitIndex, value);
ASSERT(ret != 0);
return firstBitIndex;
#else
return 31 - __builtin_clz(value);
#endif
}
bool IsPowerOfTwo(size_t n) {
ASSERT(n != 0);
return (n & (n - 1)) == 0;
}
bool IsAligned(const void* ptr, size_t alignment) {
ASSERT(IsPowerOfTwo(alignment));
ASSERT(alignment != 0);
return (reinterpret_cast<intptr_t>(ptr) & (alignment - 1)) == 0;
}
void* AlignVoidPtr(void* ptr, size_t alignment) {
ASSERT(alignment != 0);
return reinterpret_cast<void*>((reinterpret_cast<intptr_t>(ptr) + (alignment - 1)) & ~(alignment - 1));
}
}

View File

@@ -1,43 +0,0 @@
// 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 BACKEND_COMMON_MATH_H_
#define BACKEND_COMMON_MATH_H_
#include <cstddef>
#include "cstdint"
namespace backend {
// The following are not valid for 0
uint32_t ScanForward(uint32_t bits);
uint32_t Log2(uint32_t value);
bool IsPowerOfTwo(size_t n);
bool IsAligned(const void* ptr, size_t alignment);
void* AlignVoidPtr(void* ptr, size_t alignment);
template<typename T>
T* Align(T* ptr, size_t alignment) {
return reinterpret_cast<T*>(AlignVoidPtr(ptr, alignment));
}
template<typename T>
const T* Align(const T* ptr, size_t alignment) {
return reinterpret_cast<const T*>(AlignVoidPtr(const_cast<T*>(ptr), alignment));
}
}
#endif // BACKEND_COMMON_MATH_H_

View File

@@ -1,333 +0,0 @@
// 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 BACKEND_COMMON_SERIALQUEUE_H_
#define BACKEND_COMMON_SERIALQUEUE_H_
#include "Forward.h"
#include <cstdint>
#include <vector>
namespace backend {
template<typename T>
class SerialQueue {
private:
using SerialPair = std::pair<Serial, std::vector<T>>;
using Storage = std::vector<SerialPair>;
using StorageIterator = typename Storage::iterator;
using ConstStorageIterator = typename Storage::const_iterator;
public:
class Iterator {
public:
Iterator(StorageIterator start);
Iterator& operator++();
bool operator==(const Iterator& other) const;
bool operator!=(const Iterator& other) const;
T& operator*() const;
private:
StorageIterator storageIterator;
// Special case the serialIterator when it should be equal to storageIterator.begin()
// otherwise we could ask storageIterator.begin() when storageIterator is storage.end()
// which is invalid. storageIterator.begin() is tagged with a nullptr.
T* serialIterator;
};
class ConstIterator {
public:
ConstIterator(ConstStorageIterator start);
ConstIterator& operator++();
bool operator==(const ConstIterator& other) const;
bool operator!=(const ConstIterator& other) const;
const T& operator*() const;
private:
ConstStorageIterator storageIterator;
const T* serialIterator;
};
class BeginEnd {
public:
BeginEnd(StorageIterator start, StorageIterator end);
Iterator begin() const;
Iterator end() const;
private:
StorageIterator startIt;
StorageIterator endIt;
};
class ConstBeginEnd {
public:
ConstBeginEnd(ConstStorageIterator start, ConstStorageIterator end);
ConstIterator begin() const;
ConstIterator end() const;
private:
ConstStorageIterator startIt;
ConstStorageIterator endIt;
};
// The serial must be given in (not strictly) increasing order.
void Enqueue(const T& value, Serial serial);
void Enqueue(T&& value, Serial serial);
void Enqueue(const std::vector<T>& values, Serial serial);
void Enqueue(std::vector<T>&& values, Serial serial);
bool Empty() const;
// The UpTo variants of Iterate and Clear affect all values associated to a serial
// that is smaller OR EQUAL to the given serial. Iterating is done like so:
// for (const T& value : queue.IterateAll()) { stuff(T); }
ConstBeginEnd IterateAll() const;
ConstBeginEnd IterateUpTo(Serial serial) const;
BeginEnd IterateAll();
BeginEnd IterateUpTo(Serial serial);
void Clear();
void ClearUpTo(Serial serial);
Serial FirstSerial() const;
private:
// Returns the first StorageIterator that a serial bigger than serial.
ConstStorageIterator FindUpTo(Serial serial) const;
StorageIterator FindUpTo(Serial serial);
Storage storage;
};
// SerialQueue
template<typename T>
void SerialQueue<T>::Enqueue(const T& value, Serial serial) {
ASSERT(Empty() || storage.back().first <= serial);
if (Empty() || storage.back().first < serial) {
storage.emplace_back(SerialPair(serial, {}));
}
storage.back().second.emplace_back(value);
}
template<typename T>
void SerialQueue<T>::Enqueue(T&& value, Serial serial) {
ASSERT(Empty() || storage.back().first <= serial);
if (Empty() || storage.back().first < serial) {
storage.emplace_back(SerialPair(serial, {}));
}
storage.back().second.emplace_back(value);
}
template<typename T>
void SerialQueue<T>::Enqueue(const std::vector<T>& values, Serial serial) {
ASSERT(values.size() > 0);
ASSERT(Empty() || storage.back().first <= serial);
storage.emplace_back(SerialPair(serial, {values}));
}
template<typename T>
void SerialQueue<T>::Enqueue(std::vector<T>&& values, Serial serial) {
ASSERT(values.size() > 0);
ASSERT(Empty() || storage.back().first <= serial);
storage.emplace_back(SerialPair(serial, {values}));
}
template<typename T>
bool SerialQueue<T>::Empty() const {
return storage.empty();
}
template<typename T>
typename SerialQueue<T>::ConstBeginEnd SerialQueue<T>::IterateAll() const {
return {storage.begin(), storage.end()};
}
template<typename T>
typename SerialQueue<T>::ConstBeginEnd SerialQueue<T>::IterateUpTo(Serial serial) const {
return {storage.begin(), FindUpTo(serial)};
}
template<typename T>
typename SerialQueue<T>::BeginEnd SerialQueue<T>::IterateAll() {
return {storage.begin(), storage.end()};
}
template<typename T>
typename SerialQueue<T>::BeginEnd SerialQueue<T>::IterateUpTo(Serial serial) {
return {storage.begin(), FindUpTo(serial)};
}
template<typename T>
void SerialQueue<T>::Clear() {
storage.clear();
}
template<typename T>
void SerialQueue<T>::ClearUpTo(Serial serial) {
storage.erase(storage.begin(), FindUpTo(serial));
}
template<typename T>
Serial SerialQueue<T>::FirstSerial() const {
ASSERT(!Empty());
return storage.front().first;
}
template<typename T>
typename SerialQueue<T>::ConstStorageIterator SerialQueue<T>::FindUpTo(Serial serial) const {
auto it = storage.begin();
while (it != storage.end() && it->first <= serial) {
it ++;
}
return it;
}
template<typename T>
typename SerialQueue<T>::StorageIterator SerialQueue<T>::FindUpTo(Serial serial) {
auto it = storage.begin();
while (it != storage.end() && it->first <= serial) {
it ++;
}
return it;
}
// SerialQueue::BeginEnd
template<typename T>
SerialQueue<T>::BeginEnd::BeginEnd(typename SerialQueue<T>::StorageIterator start, typename SerialQueue<T>::StorageIterator end)
: startIt(start), endIt(end) {
}
template<typename T>
typename SerialQueue<T>::Iterator SerialQueue<T>::BeginEnd::begin() const {
return {startIt};
}
template<typename T>
typename SerialQueue<T>::Iterator SerialQueue<T>::BeginEnd::end() const {
return {endIt};
}
// SerialQueue::Iterator
template<typename T>
SerialQueue<T>::Iterator::Iterator(typename SerialQueue<T>::StorageIterator start)
: storageIterator(start), serialIterator(nullptr) {
}
template<typename T>
typename SerialQueue<T>::Iterator& SerialQueue<T>::Iterator::operator++() {
T* vectorData = storageIterator->second.data();
if (serialIterator == nullptr) {
serialIterator = vectorData + 1;
} else {
serialIterator ++;
}
if (serialIterator >= vectorData + storageIterator->second.size()) {
serialIterator = nullptr;
storageIterator ++;
}
return *this;
}
template<typename T>
bool SerialQueue<T>::Iterator::operator==(const typename SerialQueue<T>::Iterator& other) const {
return other.storageIterator == storageIterator && other.serialIterator == serialIterator;
}
template<typename T>
bool SerialQueue<T>::Iterator::operator!=(const typename SerialQueue<T>::Iterator& other) const {
return !(*this == other);
}
template<typename T>
T& SerialQueue<T>::Iterator::operator*() const {
if (serialIterator == nullptr) {
return *storageIterator->second.begin();
}
return *serialIterator;
}
// SerialQueue::ConstBeginEnd
template<typename T>
SerialQueue<T>::ConstBeginEnd::ConstBeginEnd(typename SerialQueue<T>::ConstStorageIterator start, typename SerialQueue<T>::ConstStorageIterator end)
: startIt(start), endIt(end) {
}
template<typename T>
typename SerialQueue<T>::ConstIterator SerialQueue<T>::ConstBeginEnd::begin() const {
return {startIt};
}
template<typename T>
typename SerialQueue<T>::ConstIterator SerialQueue<T>::ConstBeginEnd::end() const {
return {endIt};
}
// SerialQueue::ConstIterator
template<typename T>
SerialQueue<T>::ConstIterator::ConstIterator(typename SerialQueue<T>::ConstStorageIterator start)
: storageIterator(start), serialIterator(nullptr) {
}
template<typename T>
typename SerialQueue<T>::ConstIterator& SerialQueue<T>::ConstIterator::operator++() {
const T* vectorData = storageIterator->second.data();
if (serialIterator == nullptr) {
serialIterator = vectorData + 1;
} else {
serialIterator ++;
}
if (serialIterator >= vectorData + storageIterator->second.size()) {
serialIterator = nullptr;
storageIterator ++;
}
return *this;
}
template<typename T>
bool SerialQueue<T>::ConstIterator::operator==(const typename SerialQueue<T>::ConstIterator& other) const {
return other.storageIterator == storageIterator && other.serialIterator == serialIterator;
}
template<typename T>
bool SerialQueue<T>::ConstIterator::operator!=(const typename SerialQueue<T>::ConstIterator& other) const {
return !(*this == other);
}
template<typename T>
const T& SerialQueue<T>::ConstIterator::operator*() const {
if (serialIterator == nullptr) {
return *storageIterator->second.begin();
}
return *serialIterator;
}
}
#endif // BACKEND_COMMON_SERIALQUEUE_H_

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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"

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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 {

Some files were not shown because too many files have changed in this diff Show More