diff --git a/cmake/3rdparty/vulkan.cmake b/cmake/3rdparty/vulkan.cmake index 113bbfe2..a59b81a5 100644 --- a/cmake/3rdparty/vulkan.cmake +++ b/cmake/3rdparty/vulkan.cmake @@ -51,8 +51,6 @@ elseif(APPLE) INTERFACE_COMPILE_DEFINITIONS VK_USE_PLATFORM_METAL_EXT ) - set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) - set(CMAKE_INSTALL_RPATH "/usr/local/lib") elseif(NOT ANDROID) set_property(TARGET vulkan APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS diff --git a/cmake/cmake_settings.cmake b/cmake/cmake_settings.cmake index 99280c77..87125ecf 100644 --- a/cmake/cmake_settings.cmake +++ b/cmake/cmake_settings.cmake @@ -4,8 +4,17 @@ endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets") option(BUILD_SHARED_LIBS "Build using shared libraries" OFF) + +if (APPLE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) + if (VULKAN_SUPPORT) + set(CMAKE_INSTALL_RPATH "@executable_path;/usr/local/lib") + else() + set(CMAKE_INSTALL_RPATH "@executable_path") + endif() +endif() diff --git a/src/Apps/CoreDxrTriangle/CMakeLists.txt b/src/Apps/CoreDxrTriangle/CMakeLists.txt index fb5d1372..959e3f49 100644 --- a/src/Apps/CoreDxrTriangle/CMakeLists.txt +++ b/src/Apps/CoreDxrTriangle/CMakeLists.txt @@ -24,7 +24,7 @@ target_include_directories(${target} target_link_libraries(${target} AppBox Utilities - Instance + FlyCube FlyCubeAssets ) diff --git a/src/Apps/CoreTriangle/CMakeLists.txt b/src/Apps/CoreTriangle/CMakeLists.txt index 0a759040..65b6f923 100644 --- a/src/Apps/CoreTriangle/CMakeLists.txt +++ b/src/Apps/CoreTriangle/CMakeLists.txt @@ -8,7 +8,7 @@ endif() target_link_libraries(CoreTriangle AppBox - Instance + FlyCube FlyCubeAssets ) diff --git a/src/Apps/CoreTriangleUIKit/CMakeLists.txt b/src/Apps/CoreTriangleUIKit/CMakeLists.txt index c41f2925..b80ecfee 100644 --- a/src/Apps/CoreTriangleUIKit/CMakeLists.txt +++ b/src/Apps/CoreTriangleUIKit/CMakeLists.txt @@ -18,7 +18,7 @@ add_executable(CoreTriangleUIKit MACOSX_BUNDLE target_link_libraries(CoreTriangleUIKit AppBoxApple - Instance + FlyCube ) if (CMAKE_SYSTEM_NAME STREQUAL "iOS") diff --git a/src/FlyCube/Adapter/CMakeLists.txt b/src/FlyCube/Adapter/CMakeLists.txt deleted file mode 100644 index f2e5435d..00000000 --- a/src/FlyCube/Adapter/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -list(APPEND headers - Adapter.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKAdapter.h - ) - list(APPEND sources - VKAdapter.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXAdapter.h - ) - list(APPEND sources - DXAdapter.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTAdapter.h - ) - list(APPEND sources - MTAdapter.mm - ) -endif() - -add_library(Adapter ${headers} ${sources}) - -target_include_directories(Adapter - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Adapter - ApiType - Device - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(Adapter - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Adapter - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(Adapter PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/ApiType/ApiType.h b/src/FlyCube/ApiType/ApiType.h index d0ec867d..7772e814 100644 --- a/src/FlyCube/ApiType/ApiType.h +++ b/src/FlyCube/ApiType/ApiType.h @@ -1,5 +1,5 @@ #pragma once -#include +#include enum class ApiType { kVulkan, diff --git a/src/FlyCube/ApiType/CMakeLists.txt b/src/FlyCube/ApiType/CMakeLists.txt deleted file mode 100644 index 23405521..00000000 --- a/src/FlyCube/ApiType/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_library(ApiType INTERFACE) - -target_include_directories(ApiType - INTERFACE - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) diff --git a/src/FlyCube/BindingSet/CMakeLists.txt b/src/FlyCube/BindingSet/CMakeLists.txt deleted file mode 100644 index f10877ef..00000000 --- a/src/FlyCube/BindingSet/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -list(APPEND headers - BindingSet.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKBindingSet.h - ) - list(APPEND sources - VKBindingSet.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXBindingSet.h - ) - list(APPEND sources - DXBindingSet.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTBindingSet.h - ) - list(APPEND sources - MTBindingSet.mm - ) -endif() - -add_library(BindingSet ${headers} ${sources}) - -target_include_directories(BindingSet - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(BindingSet - ApiType - Device - Instance - Utilities - BindingSetLayout -) - -if (VULKAN_SUPPORT) - target_link_libraries(BindingSet - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(BindingSet - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(BindingSet PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/BindingSetLayout/CMakeLists.txt b/src/FlyCube/BindingSetLayout/CMakeLists.txt deleted file mode 100644 index 744a355c..00000000 --- a/src/FlyCube/BindingSetLayout/CMakeLists.txt +++ /dev/null @@ -1,60 +0,0 @@ -list(APPEND headers - BindingSetLayout.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKBindingSetLayout.h - ) - list(APPEND sources - VKBindingSetLayout.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXBindingSetLayout.h - ) - list(APPEND sources - DXBindingSetLayout.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTBindingSetLayout.h - ) - list(APPEND sources - MTBindingSetLayout.mm - ) -endif() - -add_library(BindingSetLayout ${headers} ${sources}) - -target_include_directories(BindingSetLayout - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(BindingSetLayout - ApiType - Device - Instance - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(BindingSetLayout - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(BindingSetLayout - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(BindingSetLayout PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/CMakeLists.txt b/src/FlyCube/CMakeLists.txt index 0297a7db..2ca28495 100644 --- a/src/FlyCube/CMakeLists.txt +++ b/src/FlyCube/CMakeLists.txt @@ -1,23 +1,305 @@ -add_subdirectory(Adapter) -add_subdirectory(ApiType) -add_subdirectory(BindingSet) -add_subdirectory(BindingSetLayout) -add_subdirectory(CommandList) -add_subdirectory(CommandQueue) -add_subdirectory(CPUDescriptorPool) -add_subdirectory(Device) -add_subdirectory(Fence) -add_subdirectory(Framebuffer) -add_subdirectory(GPUDescriptorPool) -add_subdirectory(HLSLCompiler) -add_subdirectory(Instance) -add_subdirectory(Memory) -add_subdirectory(Pipeline) -add_subdirectory(Program) -add_subdirectory(QueryHeap) -add_subdirectory(RenderPass) -add_subdirectory(Resource) -add_subdirectory(Shader) -add_subdirectory(ShaderReflection) -add_subdirectory(Swapchain) -add_subdirectory(View) +list(APPEND Adapter + $<$:Adapter/DXAdapter.cpp> + $<$:Adapter/DXAdapter.h> + $<$:Adapter/MTAdapter.h> + $<$:Adapter/MTAdapter.mm> + $<$:Adapter/VKAdapter.cpp> + $<$:Adapter/VKAdapter.h> + Adapter/Adapter.h +) + +list(APPEND ApiType + ApiType/ApiType.h +) + +list(APPEND BindingSet + $<$:BindingSet/DXBindingSet.cpp> + $<$:BindingSet/DXBindingSet.h> + $<$:BindingSet/MTBindingSet.h> + $<$:BindingSet/MTBindingSet.mm> + $<$:BindingSet/VKBindingSet.cpp> + $<$:BindingSet/VKBindingSet.h> + BindingSet/BindingSet.h +) + +list(APPEND BindingSetLayout + $<$:BindingSetLayout/DXBindingSetLayout.cpp> + $<$:BindingSetLayout/DXBindingSetLayout.h> + $<$:BindingSetLayout/MTBindingSetLayout.h> + $<$:BindingSetLayout/MTBindingSetLayout.mm> + $<$:BindingSetLayout/VKBindingSetLayout.cpp> + $<$:BindingSetLayout/VKBindingSetLayout.h> + BindingSetLayout/BindingSetLayout.h +) + +list(APPEND CPUDescriptorPool + $<$:CPUDescriptorPool/DXCPUDescriptorHandle.cpp> + $<$:CPUDescriptorPool/DXCPUDescriptorHandle.h> + $<$:CPUDescriptorPool/DXCPUDescriptorPool.cpp> + $<$:CPUDescriptorPool/DXCPUDescriptorPool.h> + $<$:CPUDescriptorPool/DXCPUDescriptorPoolTyped.cpp> + $<$:CPUDescriptorPool/DXCPUDescriptorPoolTyped.h> +) + +list(APPEND CommandList + $<$:CommandList/DXCommandList.cpp> + $<$:CommandList/DXCommandList.h> + $<$:CommandList/MTCommandList.h> + $<$:CommandList/MTCommandList.mm> + $<$:CommandList/VKCommandList.cpp> + $<$:CommandList/VKCommandList.h> + CommandList/CommandList.h +) + +list(APPEND CommandQueue + $<$:CommandQueue/DXCommandQueue.cpp> + $<$:CommandQueue/DXCommandQueue.h> + $<$:CommandQueue/MTCommandQueue.h> + $<$:CommandQueue/MTCommandQueue.mm> + $<$:CommandQueue/VKCommandQueue.cpp> + $<$:CommandQueue/VKCommandQueue.h> + CommandQueue/CommandQueue.h +) + +list(APPEND Device + $<$:Device/DXDevice.cpp> + $<$:Device/DXDevice.h> + $<$:Device/MTDevice.h> + $<$:Device/MTDevice.mm> + $<$:Device/VKDevice.cpp> + $<$:Device/VKDevice.h> + Device/Device.h +) + +list(APPEND Fence + $<$:Fence/DXFence.cpp> + $<$:Fence/DXFence.h> + $<$:Fence/MTFence.h> + $<$:Fence/MTFence.mm> + $<$:Fence/VKTimelineSemaphore.cpp> + $<$:Fence/VKTimelineSemaphore.h> + Fence/Fence.h +) + +list(APPEND Framebuffer + $<$:Framebuffer/DXFramebuffer.h> + $<$:Framebuffer/MTFramebuffer.h> + $<$:Framebuffer/VKFramebuffer.cpp> + $<$:Framebuffer/VKFramebuffer.h> + Framebuffer/Framebuffer.h + Framebuffer/FramebufferBase.cpp + Framebuffer/FramebufferBase.h +) + +list(APPEND GPUDescriptorPool + $<$:GPUDescriptorPool/DXGPUDescriptorPool.cpp> + $<$:GPUDescriptorPool/DXGPUDescriptorPool.h> + $<$:GPUDescriptorPool/DXGPUDescriptorPoolRange.cpp> + $<$:GPUDescriptorPool/DXGPUDescriptorPoolRange.h> + $<$:GPUDescriptorPool/DXGPUDescriptorPoolTyped.cpp> + $<$:GPUDescriptorPool/DXGPUDescriptorPoolTyped.h> + $<$:GPUDescriptorPool/MTGPUArgumentBufferRange.h> + $<$:GPUDescriptorPool/MTGPUArgumentBufferRange.mm> + $<$:GPUDescriptorPool/MTGPUBindlessArgumentBuffer.h> + $<$:GPUDescriptorPool/MTGPUBindlessArgumentBuffer.mm> + $<$:GPUDescriptorPool/VKGPUBindlessDescriptorPoolTyped.cpp> + $<$:GPUDescriptorPool/VKGPUBindlessDescriptorPoolTyped.h> + $<$:GPUDescriptorPool/VKGPUDescriptorPool.cpp> + $<$:GPUDescriptorPool/VKGPUDescriptorPool.h> + $<$:GPUDescriptorPool/VKGPUDescriptorPoolRange.cpp> + $<$:GPUDescriptorPool/VKGPUDescriptorPoolRange.h> +) + +list(APPEND HLSLCompiler + HLSLCompiler/Compiler.h + HLSLCompiler/Compiler.cpp + HLSLCompiler/DXCLoader.cpp + HLSLCompiler/DXCLoader.h + HLSLCompiler/MSLConverter.cpp + HLSLCompiler/MSLConverter.h +) + +list(APPEND Instance + $<$:Instance/DXInstance.cpp> + $<$:Instance/DXInstance.h> + $<$:Instance/MTInstance.h> + $<$:Instance/MTInstance.mm> + $<$:Instance/VKInstance.cpp> + $<$:Instance/VKInstance.h> + Instance/BaseTypes.h + Instance/EnumUtils.h + Instance/Instance.cpp + Instance/Instance.h + Instance/QueryInterface.h +) + +list(APPEND Memory + $<$:Memory/DXMemory.cpp> + $<$:Memory/DXMemory.h> + $<$:Memory/MTMemory.h> + $<$:Memory/MTMemory.mm> + $<$:Memory/VKMemory.cpp> + $<$:Memory/VKMemory.h> + Memory/Memory.h +) + +list(APPEND Pipeline + $<$:Pipeline/DXComputePipeline.cpp> + $<$:Pipeline/DXComputePipeline.h> + $<$:Pipeline/DXGraphicsPipeline.cpp> + $<$:Pipeline/DXGraphicsPipeline.h> + $<$:Pipeline/DXPipeline.cpp> + $<$:Pipeline/DXPipeline.h> + $<$:Pipeline/DXRayTracingPipeline.cpp> + $<$:Pipeline/DXRayTracingPipeline.h> + $<$:Pipeline/DXStateBuilder.h> + $<$:Pipeline/MTComputePipeline.h> + $<$:Pipeline/MTComputePipeline.mm> + $<$:Pipeline/MTGraphicsPipeline.h> + $<$:Pipeline/MTGraphicsPipeline.mm> + $<$:Pipeline/MTPipeline.h> + $<$:Pipeline/VKComputePipeline.cpp> + $<$:Pipeline/VKComputePipeline.h> + $<$:Pipeline/VKGraphicsPipeline.cpp> + $<$:Pipeline/VKGraphicsPipeline.h> + $<$:Pipeline/VKPipeline.cpp> + $<$:Pipeline/VKPipeline.h> + $<$:Pipeline/VKRayTracingPipeline.cpp> + $<$:Pipeline/VKRayTracingPipeline.h> + Pipeline/Pipeline.h +) + +list(APPEND Program + Program/Program.h + Program/ProgramBase.cpp + Program/ProgramBase.h +) + +list(APPEND QueryHeap + $<$:QueryHeap/DXRayTracingQueryHeap.cpp> + $<$:QueryHeap/DXRayTracingQueryHeap.h> + $<$:QueryHeap/VKQueryHeap.cpp> + $<$:QueryHeap/VKQueryHeap.h> + QueryHeap/QueryHeap.h +) + +list(APPEND RenderPass + $<$:RenderPass/DXRenderPass.cpp> + $<$:RenderPass/DXRenderPass.h> + $<$:RenderPass/MTRenderPass.h> + $<$:RenderPass/MTRenderPass.mm> + $<$:RenderPass/VKRenderPass.cpp> + $<$:RenderPass/VKRenderPass.h> + RenderPass/RenderPass.h +) + +list(APPEND Resource + $<$:Resource/DXResource.cpp> + $<$:Resource/DXResource.h> + $<$:Resource/MTResource.h> + $<$:Resource/MTResource.mm> + $<$:Resource/VKResource.cpp> + $<$:Resource/VKResource.h> + Resource/Resource.h + Resource/ResourceBase.cpp + Resource/ResourceBase.h + Resource/ResourceStateTracker.cpp + Resource/ResourceStateTracker.h +) + +list(APPEND Shader + $<$:Shader/MTShader.h> + $<$:Shader/MTShader.mm> + Shader/Shader.h + Shader/ShaderBase.cpp + Shader/ShaderBase.h +) + +list(APPEND ShaderReflection + $<$:ShaderReflection/DXILReflection.cpp> + $<$:ShaderReflection/DXILReflection.h> + ShaderReflection/ShaderReflection.cpp + ShaderReflection/ShaderReflection.h + ShaderReflection/SPIRVReflection.cpp + ShaderReflection/SPIRVReflection.h +) + +list(APPEND Swapchain + $<$:Swapchain/DXSwapchain.cpp> + $<$:Swapchain/DXSwapchain.h> + $<$:Swapchain/MTSwapchain.h> + $<$:Swapchain/MTSwapchain.mm> + $<$:Swapchain/VKSwapchain.cpp> + $<$:Swapchain/VKSwapchain.h> + Swapchain/Swapchain.h +) + +if (APPLE AND VULKAN_SUPPORT) + set_property(SOURCE Swapchain/VKSwapchain.cpp PROPERTY COMPILE_FLAGS "-xobjective-c++") +endif() + +list(APPEND View + $<$:View/DXView.cpp> + $<$:View/DXView.h> + $<$:View/MTView.h> + $<$:View/MTView.mm> + $<$:View/VKView.cpp> + $<$:View/VKView.h> + View/View.h +) + +add_library(FlyCube + ${Adapter} + ${ApiType} + ${BindingSet} + ${BindingSetLayout} + ${CommandList} + ${CommandQueue} + ${CPUDescriptorPool} + ${Device} + ${Fence} + ${Framebuffer} + ${GPUDescriptorPool} + ${HLSLCompiler} + ${Instance} + ${Memory} + ${Pipeline} + ${Program} + ${QueryHeap} + ${RenderPass} + ${Resource} + ${Shader} + ${ShaderReflection} + ${Swapchain} + ${View} +) + +target_link_libraries(FlyCube + $<$:d3d12> + $<$:dia> + $<$:DirectX-Headers> + $<$:dxgi> + $<$:dxguid> + $<$:-framework\ Metal> + $<$:-framework\ QuartzCore> + $<$:MVKPixelFormats> + $<$:dl> + $<$:X11-xcb> + $<$:vulkan> + dxc + nowide + spirv-cross-core + spirv-cross-hlsl + spirv-cross-msl + Utilities +) + +target_include_directories(FlyCube + PUBLIC + "${CMAKE_CURRENT_SOURCE_DIR}" +) + +if (BUILD_TESTING) + add_subdirectory(HLSLCompiler/test) + add_subdirectory(ShaderReflection/test) +endif() diff --git a/src/FlyCube/CPUDescriptorPool/CMakeLists.txt b/src/FlyCube/CPUDescriptorPool/CMakeLists.txt deleted file mode 100644 index 67a0737c..00000000 --- a/src/FlyCube/CPUDescriptorPool/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -if (DIRECTX_SUPPORT) - list(APPEND headers - DXCPUDescriptorHandle.h - DXCPUDescriptorPool.h - DXCPUDescriptorPoolTyped.h - ) - list(APPEND sources - DXCPUDescriptorHandle.cpp - DXCPUDescriptorPool.cpp - DXCPUDescriptorPoolTyped.cpp - ) -else() - return() -endif() - -add_library(CPUDescriptorPool ${headers} ${sources}) - -target_include_directories(CPUDescriptorPool - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(CPUDescriptorPool - ApiType - Swapchain - CommandList - Fence - Utilities -) - -target_link_libraries(CPUDescriptorPool - d3d12 - dxgi - dxguid -) - -set_target_properties(CPUDescriptorPool PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/CommandList/CMakeLists.txt b/src/FlyCube/CommandList/CMakeLists.txt deleted file mode 100644 index cad8cb42..00000000 --- a/src/FlyCube/CommandList/CMakeLists.txt +++ /dev/null @@ -1,60 +0,0 @@ -list(APPEND headers - CommandList.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKCommandList.h - ) - list(APPEND sources - VKCommandList.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXCommandList.h - ) - list(APPEND sources - DXCommandList.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTCommandList.h - ) - list(APPEND sources - MTCommandList.mm - ) -endif() - -add_library(CommandList ${headers} ${sources}) - -target_include_directories(CommandList - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(CommandList - ApiType - Device - Utilities - nowide -) - -if (VULKAN_SUPPORT) - target_link_libraries(CommandList - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(CommandList - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(CommandList PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/CommandList/SWCommandList.cpp b/src/FlyCube/CommandList/SWCommandList.cpp deleted file mode 100644 index 3dea812b..00000000 --- a/src/FlyCube/CommandList/SWCommandList.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#include "CommandList/SWCommandList.h" - -#include "Device/VKDevice.h" - -SWCommandList::SWCommandList(SWDevice& device, CommandListType type) - : m_device(device) -{ -} - -void SWCommandList::Reset() {} - -void SWCommandList::Close() {} - -void SWCommandList::BindPipeline(const std::shared_ptr& state) {} - -void SWCommandList::BindBindingSet(const std::shared_ptr& binding_set) {} - -void SWCommandList::BeginRenderPass(const std::shared_ptr& render_pass, - const std::shared_ptr& framebuffer, - const ClearDesc& clear_desc) -{ -} - -void SWCommandList::EndRenderPass() {} - -void SWCommandList::BeginEvent(const std::string& name) {} - -void SWCommandList::EndEvent() {} - -void SWCommandList::Draw(uint32_t vertex_count, uint32_t instance_count, uint32_t first_vertex, uint32_t first_instance) -{ -} - -void SWCommandList::DrawIndexed(uint32_t index_count, - uint32_t instance_count, - uint32_t first_index, - int32_t vertex_offset, - uint32_t first_instance) -{ -} - -void SWCommandList::DrawIndirect(const std::shared_ptr& argument_buffer, uint64_t argument_buffer_offset) {} - -void SWCommandList::DrawIndexedIndirect(const std::shared_ptr& argument_buffer, - uint64_t argument_buffer_offset) -{ -} - -void SWCommandList::DrawIndirectCount(const std::shared_ptr& argument_buffer, - uint64_t argument_buffer_offset, - const std::shared_ptr& count_buffer, - uint64_t count_buffer_offset, - uint32_t max_draw_count, - uint32_t stride) -{ -} - -void SWCommandList::DrawIndexedIndirectCount(const std::shared_ptr& argument_buffer, - uint64_t argument_buffer_offset, - const std::shared_ptr& count_buffer, - uint64_t count_buffer_offset, - uint32_t max_draw_count, - uint32_t stride) -{ -} - -void SWCommandList::Dispatch(uint32_t thread_group_count_x, - uint32_t thread_group_count_y, - uint32_t thread_group_count_z) -{ -} - -void SWCommandList::DispatchIndirect(const std::shared_ptr& argument_buffer, uint64_t argument_buffer_offset) -{ -} - -void SWCommandList::DispatchMesh(uint32_t thread_group_count_x) {} - -void SWCommandList::DispatchRays(const RayTracingShaderTables& shader_tables, - uint32_t width, - uint32_t height, - uint32_t depth) -{ -} - -void SWCommandList::ResourceBarrier(const std::vector& barriers) {} - -void SWCommandList::UAVResourceBarrier(const std::shared_ptr& /*resource*/) {} - -void SWCommandList::SetViewport(float x, float y, float width, float height) {} - -void SWCommandList::SetScissorRect(int32_t left, int32_t top, uint32_t right, uint32_t bottom) {} - -void SWCommandList::IASetIndexBuffer(const std::shared_ptr& resource, gli::format format) {} - -void SWCommandList::IASetVertexBuffer(uint32_t slot, const std::shared_ptr& resource) {} - -void SWCommandList::RSSetShadingRate(ShadingRate shading_rate, const std::array& combiners) {} - -void SWCommandList::BuildBottomLevelAS(const std::shared_ptr& src, - const std::shared_ptr& dst, - const std::shared_ptr& scratch, - uint64_t scratch_offset, - const std::vector& descs, - BuildAccelerationStructureFlags flags) -{ -} - -void SWCommandList::BuildTopLevelAS(const std::shared_ptr& src, - const std::shared_ptr& dst, - const std::shared_ptr& scratch, - uint64_t scratch_offset, - const std::shared_ptr& instance_data, - uint64_t instance_offset, - uint32_t instance_count, - BuildAccelerationStructureFlags flags) -{ -} - -void SWCommandList::CopyAccelerationStructure(const std::shared_ptr& src, - const std::shared_ptr& dst, - CopyAccelerationStructureMode mode) -{ -} - -void SWCommandList::CopyBuffer(const std::shared_ptr& src_buffer, - const std::shared_ptr& dst_buffer, - const std::vector& regions) -{ -} - -void SWCommandList::CopyBufferToTexture(const std::shared_ptr& src_buffer, - const std::shared_ptr& dst_texture, - const std::vector& regions) -{ -} - -void SWCommandList::CopyTexture(const std::shared_ptr& src_texture, - const std::shared_ptr& dst_texture, - const std::vector& regions) -{ -} - -void SWCommandList::WriteAccelerationStructuresProperties( - const std::vector>& acceleration_structures, - const std::shared_ptr& query_heap, - uint32_t first_query) -{ -} - -void SWCommandList::ResolveQueryData(const std::shared_ptr& query_heap, - uint32_t first_query, - uint32_t query_count, - const std::shared_ptr& dst_buffer, - uint64_t dst_offset) -{ -} diff --git a/src/FlyCube/CommandList/SWCommandList.h b/src/FlyCube/CommandList/SWCommandList.h deleted file mode 100644 index 4685dd76..00000000 --- a/src/FlyCube/CommandList/SWCommandList.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once -#include "CommandList/CommandList.h" - -class SWDevice; -class SWPipeline; - -class SWCommandList : public CommandList { -public: - SWCommandList(SWDevice& device, CommandListType type); - void Reset() override; - void Close() override; - void BindPipeline(const std::shared_ptr& state) override; - void BindBindingSet(const std::shared_ptr& binding_set) override; - void BeginRenderPass(const std::shared_ptr& render_pass, - const std::shared_ptr& framebuffer, - const ClearDesc& clear_desc) override; - void EndRenderPass() override; - void BeginEvent(const std::string& name) override; - void EndEvent() override; - void Draw(uint32_t vertex_count, uint32_t instance_count, uint32_t first_vertex, uint32_t first_instance) override; - void DrawIndexed(uint32_t index_count, - uint32_t instance_count, - uint32_t first_index, - int32_t vertex_offset, - uint32_t first_instance) override; - void DrawIndirect(const std::shared_ptr& argument_buffer, uint64_t argument_buffer_offset) override; - void DrawIndexedIndirect(const std::shared_ptr& argument_buffer, - uint64_t argument_buffer_offset) override; - void DrawIndirectCount(const std::shared_ptr& argument_buffer, - uint64_t argument_buffer_offset, - const std::shared_ptr& count_buffer, - uint64_t count_buffer_offset, - uint32_t max_draw_count, - uint32_t stride) override; - void DrawIndexedIndirectCount(const std::shared_ptr& argument_buffer, - uint64_t argument_buffer_offset, - const std::shared_ptr& count_buffer, - uint64_t count_buffer_offset, - uint32_t max_draw_count, - uint32_t stride) override; - void Dispatch(uint32_t thread_group_count_x, uint32_t thread_group_count_y, uint32_t thread_group_count_z) override; - void DispatchIndirect(const std::shared_ptr& argument_buffer, uint64_t argument_buffer_offset) override; - void DispatchMesh(uint32_t thread_group_count_x) override; - void DispatchRays(const RayTracingShaderTables& shader_tables, - uint32_t width, - uint32_t height, - uint32_t depth) override; - void ResourceBarrier(const std::vector& barriers) override; - void UAVResourceBarrier(const std::shared_ptr& resource) override; - void SetViewport(float x, float y, float width, float height) override; - void SetScissorRect(int32_t left, int32_t top, uint32_t right, uint32_t bottom) override; - void IASetIndexBuffer(const std::shared_ptr& resource, gli::format format) override; - void IASetVertexBuffer(uint32_t slot, const std::shared_ptr& resource) override; - void RSSetShadingRate(ShadingRate shading_rate, const std::array& combiners) override; - void BuildBottomLevelAS(const std::shared_ptr& src, - const std::shared_ptr& dst, - const std::shared_ptr& scratch, - uint64_t scratch_offset, - const std::vector& descs, - BuildAccelerationStructureFlags flags) override; - void BuildTopLevelAS(const std::shared_ptr& src, - const std::shared_ptr& dst, - const std::shared_ptr& scratch, - uint64_t scratch_offset, - const std::shared_ptr& instance_data, - uint64_t instance_offset, - uint32_t instance_count, - BuildAccelerationStructureFlags flags) override; - void CopyAccelerationStructure(const std::shared_ptr& src, - const std::shared_ptr& dst, - CopyAccelerationStructureMode mode) override; - void CopyBuffer(const std::shared_ptr& src_buffer, - const std::shared_ptr& dst_buffer, - const std::vector& regions) override; - void CopyBufferToTexture(const std::shared_ptr& src_buffer, - const std::shared_ptr& dst_texture, - const std::vector& regions) override; - void CopyTexture(const std::shared_ptr& src_texture, - const std::shared_ptr& dst_texture, - const std::vector& regions) override; - void WriteAccelerationStructuresProperties(const std::vector>& acceleration_structures, - const std::shared_ptr& query_heap, - uint32_t first_query) override; - void ResolveQueryData(const std::shared_ptr& query_heap, - uint32_t first_query, - uint32_t query_count, - const std::shared_ptr& dst_buffer, - uint64_t dst_offset) override; - -private: - SWDevice& m_device; -}; diff --git a/src/FlyCube/CommandQueue/CMakeLists.txt b/src/FlyCube/CommandQueue/CMakeLists.txt deleted file mode 100644 index 342e17e4..00000000 --- a/src/FlyCube/CommandQueue/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -list(APPEND headers - CommandQueue.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKCommandQueue.h - ) - list(APPEND sources - VKCommandQueue.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXCommandQueue.h - ) - list(APPEND sources - DXCommandQueue.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTCommandQueue.h - ) - list(APPEND sources - MTCommandQueue.mm - ) -endif() - -add_library(CommandQueue ${headers} ${sources}) - -target_include_directories(CommandQueue - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(CommandQueue - ApiType - Swapchain - Shader - CommandList - Program - Framebuffer - Pipeline - Fence - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(CommandQueue - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(CommandQueue - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(CommandQueue PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/Device/CMakeLists.txt b/src/FlyCube/Device/CMakeLists.txt deleted file mode 100644 index 3808c706..00000000 --- a/src/FlyCube/Device/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -list(APPEND headers - Device.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKDevice.h - ) - list(APPEND sources - VKDevice.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXDevice.h - ) - list(APPEND sources - DXDevice.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTDevice.h - ) - list(APPEND sources - MTDevice.mm - ) -endif() - -add_library(Device ${headers} ${sources}) - -target_include_directories(Device - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Device - ApiType - Swapchain - Shader - CommandList - CommandQueue - Program - Framebuffer - Pipeline - Fence - Memory - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(Device - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Device - CPUDescriptorPool - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(Device PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/Fence/CMakeLists.txt b/src/FlyCube/Fence/CMakeLists.txt deleted file mode 100644 index 68a98b3b..00000000 --- a/src/FlyCube/Fence/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -list(APPEND headers - Fence.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKTimelineSemaphore.h - ) - list(APPEND sources - VKTimelineSemaphore.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXFence.h - ) - list(APPEND sources - DXFence.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTFence.h - ) - list(APPEND sources - MTFence.mm - ) -endif() - -add_library(Fence ${headers} ${sources}) - -target_include_directories(Fence - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Fence - ApiType - Device - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(Fence - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Fence - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(Fence PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/Framebuffer/CMakeLists.txt b/src/FlyCube/Framebuffer/CMakeLists.txt deleted file mode 100644 index d9d76f38..00000000 --- a/src/FlyCube/Framebuffer/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -list(APPEND headers - Framebuffer.h - FramebufferBase.h -) - -list(APPEND sources - FramebufferBase.cpp -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKFramebuffer.h - ) - list(APPEND sources - VKFramebuffer.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXFramebuffer.h - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTFramebuffer.h - ) -endif() - -add_library(Framebuffer ${headers} ${sources}) - -target_include_directories(Framebuffer - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Framebuffer - ApiType - Device - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(Framebuffer - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Framebuffer - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(Framebuffer PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/GPUDescriptorPool/CMakeLists.txt b/src/FlyCube/GPUDescriptorPool/CMakeLists.txt deleted file mode 100644 index 9edc3e5f..00000000 --- a/src/FlyCube/GPUDescriptorPool/CMakeLists.txt +++ /dev/null @@ -1,71 +0,0 @@ -if (DIRECTX_SUPPORT) - list(APPEND headers - DXGPUDescriptorPool.h - DXGPUDescriptorPoolRange.h - DXGPUDescriptorPoolTyped.h - ) - list(APPEND sources - DXGPUDescriptorPool.cpp - DXGPUDescriptorPoolRange.cpp - DXGPUDescriptorPoolTyped.cpp - ) -endif() - -if (VULKAN_SUPPORT) - list(APPEND headers - VKGPUDescriptorPool.h - VKGPUBindlessDescriptorPoolTyped.cpp - VKGPUDescriptorPoolRange.h - ) - list(APPEND sources - VKGPUDescriptorPool.cpp - VKGPUBindlessDescriptorPoolTyped.cpp - VKGPUDescriptorPoolRange.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTGPUArgumentBufferRange.h - MTGPUBindlessArgumentBuffer.h - ) - list(APPEND sources - MTGPUArgumentBufferRange.mm - MTGPUBindlessArgumentBuffer.mm - ) -endif() - -if (NOT sources) - return() -endif() - -add_library(GPUDescriptorPool ${headers} ${sources}) - -target_include_directories(GPUDescriptorPool - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(GPUDescriptorPool - ApiType - Swapchain - CommandList - Fence - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(GPUDescriptorPool - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(GPUDescriptorPool - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(GPUDescriptorPool PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/HLSLCompiler/CMakeLists.txt b/src/FlyCube/HLSLCompiler/CMakeLists.txt deleted file mode 100644 index fe843b02..00000000 --- a/src/FlyCube/HLSLCompiler/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -list(APPEND headers - Compiler.h - DXCLoader.h - MSLConverter.h -) -list(APPEND sources - Compiler.cpp - DXCLoader.cpp - MSLConverter.cpp -) - -add_library(HLSLCompiler ${headers} ${sources}) - -target_include_directories(HLSLCompiler - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(HLSLCompiler - dxc - nowide - spirv-cross-core - spirv-cross-hlsl - spirv-cross-msl - Utilities -) - -if (UNIX) - target_link_libraries(HLSLCompiler - dl - ) -endif() - -set_target_properties(HLSLCompiler PROPERTIES FOLDER "FlyCube") - -if (BUILD_TESTING) - add_subdirectory(test) -endif() diff --git a/src/FlyCube/HLSLCompiler/test/CMakeLists.txt b/src/FlyCube/HLSLCompiler/test/CMakeLists.txt index c556d957..161e4bf3 100644 --- a/src/FlyCube/HLSLCompiler/test/CMakeLists.txt +++ b/src/FlyCube/HLSLCompiler/test/CMakeLists.txt @@ -4,7 +4,7 @@ if (WIN32) LINK_FLAGS "/ENTRY:wmainCRTStartup" ) endif() -target_link_libraries(HLSLCompilerTest PRIVATE HLSLCompiler Catch2WithMain FlyCubeAssets) +target_link_libraries(HLSLCompilerTest PRIVATE FlyCube Catch2WithMain FlyCubeAssets) set_target_properties(HLSLCompilerTest PROPERTIES FOLDER "Tests") add_test(NAME HLSLCompilerTest COMMAND HLSLCompilerTest) diff --git a/src/FlyCube/Instance/CMakeLists.txt b/src/FlyCube/Instance/CMakeLists.txt deleted file mode 100644 index 57f45724..00000000 --- a/src/FlyCube/Instance/CMakeLists.txt +++ /dev/null @@ -1,79 +0,0 @@ -list(APPEND headers - Instance.h - BaseTypes.h -) - -list(APPEND sources - Instance.cpp -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKInstance.h - ) - list(APPEND sources - VKInstance.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXInstance.h - ) - list(APPEND sources - DXInstance.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTInstance.h - ) - list(APPEND sources - MTInstance.mm - ) -endif() - -add_library(Instance ${headers} ${sources}) - -target_include_directories(Instance - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Instance - Adapter - ApiType - Utilities - Device - gli - glm - $<$:GPUDescriptorPool> - $<$:QueryHeap> -) - -if (VULKAN_SUPPORT) - target_link_libraries(Instance - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Instance - d3d12 - dxgi - dxguid - DirectX-Headers - DirectX-Guids - ) -endif() - -if (METAL_SUPPORT) - target_link_libraries(Instance - "-framework Metal" - "-framework QuartzCore" - ) - target_compile_options(Instance PUBLIC "-fobjc-arc") -endif() - -set_target_properties(Instance PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/Memory/CMakeLists.txt b/src/FlyCube/Memory/CMakeLists.txt deleted file mode 100644 index de32c840..00000000 --- a/src/FlyCube/Memory/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -list(APPEND headers - Memory.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKMemory.h - ) - list(APPEND sources - VKMemory.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXMemory.h - ) - list(APPEND sources - DXMemory.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTMemory.h - ) - list(APPEND sources - MTMemory.mm - ) -endif() - -add_library(Memory ${headers} ${sources}) - -target_include_directories(Memory - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Memory - ApiType - Swapchain - Shader - CommandList - CommandQueue - Program - Framebuffer - Pipeline - Fence - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(Memory - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Memory - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(Memory PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/Pipeline/CMakeLists.txt b/src/FlyCube/Pipeline/CMakeLists.txt deleted file mode 100644 index 04af8061..00000000 --- a/src/FlyCube/Pipeline/CMakeLists.txt +++ /dev/null @@ -1,84 +0,0 @@ -list(APPEND headers - Pipeline.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKPipeline.h - VKComputePipeline.h - VKGraphicsPipeline.h - VKRayTracingPipeline.h - ) - list(APPEND sources - VKPipeline.cpp - VKComputePipeline.cpp - VKGraphicsPipeline.cpp - VKRayTracingPipeline.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXPipeline.h - DXComputePipeline.h - DXGraphicsPipeline.h - DXRayTracingPipeline.h - DXStateBuilder.h - ) - list(APPEND sources - DXPipeline.cpp - DXComputePipeline.cpp - DXGraphicsPipeline.cpp - DXRayTracingPipeline.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTPipeline.h - MTComputePipeline.h - MTGraphicsPipeline.h - ) - list(APPEND sources - MTComputePipeline.mm - MTGraphicsPipeline.mm - ) -endif() - -add_library(Pipeline ${headers} ${sources}) - -target_include_directories(Pipeline - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Pipeline - ApiType - Device - Utilities - Program - RenderPass - Shader -) - -if (VULKAN_SUPPORT) - target_link_libraries(Pipeline - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Pipeline - d3d12 - dxgi - dxguid - ) -endif() - -if (METAL_SUPPORT) - target_link_libraries(Pipeline - MVKPixelFormats - ) -endif() - -set_target_properties(Pipeline PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/Program/CMakeLists.txt b/src/FlyCube/Program/CMakeLists.txt deleted file mode 100644 index 79800891..00000000 --- a/src/FlyCube/Program/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -list(APPEND headers - Program.h - ProgramBase.h -) - -list(APPEND sources - ProgramBase.cpp -) - -add_library(Program ${headers} ${sources}) - -target_include_directories(Program - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Program - ApiType - Device - Utilities - Shader - BindingSet -) - -if (VULKAN_SUPPORT) - target_link_libraries(Program - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Program - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(Program PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/QueryHeap/CMakeLists.txt b/src/FlyCube/QueryHeap/CMakeLists.txt deleted file mode 100644 index fe5a5cee..00000000 --- a/src/FlyCube/QueryHeap/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -list(APPEND headers - QueryHeap.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKQueryHeap.h - ) - list(APPEND sources - VKQueryHeap.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXRayTracingQueryHeap.h - ) - list(APPEND sources - DXRayTracingQueryHeap.cpp - ) -endif() - -if (NOT sources) - return() -endif() - -add_library(QueryHeap ${headers} ${sources}) - -target_include_directories(QueryHeap - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(QueryHeap - ApiType - Device - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(QueryHeap - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(QueryHeap - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(QueryHeap PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/RenderPass/CMakeLists.txt b/src/FlyCube/RenderPass/CMakeLists.txt deleted file mode 100644 index 8da040c4..00000000 --- a/src/FlyCube/RenderPass/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -list(APPEND headers - RenderPass.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKRenderPass.h - ) - list(APPEND sources - VKRenderPass.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXRenderPass.h - ) - list(APPEND sources - DXRenderPass.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTRenderPass.h - ) - list(APPEND sources - MTRenderPass.mm - ) -endif() - -add_library(RenderPass ${headers} ${sources}) - -target_include_directories(RenderPass - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(RenderPass - ApiType - Device - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(RenderPass - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(RenderPass - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(RenderPass PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/Resource/CMakeLists.txt b/src/FlyCube/Resource/CMakeLists.txt deleted file mode 100644 index f4541842..00000000 --- a/src/FlyCube/Resource/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -list(APPEND headers - Resource.h - ResourceBase.h - ResourceStateTracker.h -) - -list(APPEND sources - ResourceBase.cpp - ResourceStateTracker.cpp -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKResource.h - ) - list(APPEND sources - VKResource.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXResource.h - ) - list(APPEND sources - DXResource.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTResource.h - ) - list(APPEND sources - MTResource.mm - ) -endif() - -add_library(Resource ${headers} ${sources}) - -target_include_directories(Resource - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Resource - Device - View - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(Resource - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Resource - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(Resource PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/Shader/CMakeLists.txt b/src/FlyCube/Shader/CMakeLists.txt deleted file mode 100644 index 1ae0e73c..00000000 --- a/src/FlyCube/Shader/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -list(APPEND headers - Shader.h - ShaderBase.h -) - -list(APPEND sources - ShaderBase.cpp -) - -if (METAL_SUPPORT) - list(APPEND headers - MTShader.h - ) - list(APPEND sources - MTShader.mm - ) -endif() - -add_library(Shader ${headers} ${sources}) - -target_include_directories(Shader - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Shader - Device - HLSLCompiler - ShaderReflection - Utilities -) - -set_target_properties(Shader PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/ShaderReflection/CMakeLists.txt b/src/FlyCube/ShaderReflection/CMakeLists.txt deleted file mode 100644 index 3c716954..00000000 --- a/src/FlyCube/ShaderReflection/CMakeLists.txt +++ /dev/null @@ -1,60 +0,0 @@ -list(APPEND headers - ShaderReflection.h -) -list(APPEND sources - ShaderReflection.cpp -) - -if (VULKAN_SUPPORT OR METAL_SUPPORT) - list(APPEND headers - SPIRVReflection.h - ) - list(APPEND sources - SPIRVReflection.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXILReflection.h - ) - list(APPEND sources - DXILReflection.cpp - ) -endif() - -add_library(ShaderReflection ${headers} ${sources}) - -target_include_directories(ShaderReflection - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(ShaderReflection - Utilities - HLSLCompiler - nowide -) - -if (VULKAN_SUPPORT OR METAL_SUPPORT) - target_link_libraries(ShaderReflection - spirv-cross-core - spirv-cross-hlsl - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(ShaderReflection - DirectX-Headers - d3d12 - dxgi - dxguid - dia - ) -endif() - -set_target_properties(ShaderReflection PROPERTIES FOLDER "FlyCube") - -if (BUILD_TESTING) - add_subdirectory(test) -endif() diff --git a/src/FlyCube/ShaderReflection/test/CMakeLists.txt b/src/FlyCube/ShaderReflection/test/CMakeLists.txt index 287988b5..d36b4f5b 100644 --- a/src/FlyCube/ShaderReflection/test/CMakeLists.txt +++ b/src/FlyCube/ShaderReflection/test/CMakeLists.txt @@ -4,7 +4,7 @@ if (WIN32) LINK_FLAGS "/ENTRY:wmainCRTStartup" ) endif() -target_link_libraries(ShaderReflectionTest PRIVATE ShaderReflection Catch2WithMain FlyCubeAssets) +target_link_libraries(ShaderReflectionTest PRIVATE FlyCube Catch2WithMain FlyCubeAssets) set_target_properties(ShaderReflectionTest PROPERTIES FOLDER "Tests") add_test(NAME ShaderReflectionTest COMMAND ShaderReflectionTest) diff --git a/src/FlyCube/Swapchain/CMakeLists.txt b/src/FlyCube/Swapchain/CMakeLists.txt deleted file mode 100644 index a4abf370..00000000 --- a/src/FlyCube/Swapchain/CMakeLists.txt +++ /dev/null @@ -1,70 +0,0 @@ -list(APPEND headers - Swapchain.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKSwapchain.h - ) - list(APPEND sources - VKSwapchain.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXSwapchain.h - ) - list(APPEND sources - DXSwapchain.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTSwapchain.h - ) - list(APPEND sources - MTSwapchain.mm - ) -endif() - -add_library(Swapchain ${headers} ${sources}) - -target_include_directories(Swapchain - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(Swapchain - ApiType - Device - Resource - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(Swapchain - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(Swapchain - d3d12 - dxgi - dxguid - ) -endif() - -if (APPLE) - if (VULKAN_SUPPORT) - set_property(SOURCE VKSwapchain.cpp PROPERTY COMPILE_FLAGS "-xobjective-c++") - endif() -elseif (UNIX) - target_link_libraries(Swapchain - X11-xcb - ) -endif() - -set_target_properties(Swapchain PROPERTIES FOLDER "FlyCube") diff --git a/src/FlyCube/View/CMakeLists.txt b/src/FlyCube/View/CMakeLists.txt deleted file mode 100644 index 8e377861..00000000 --- a/src/FlyCube/View/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -list(APPEND headers - View.h -) - -if (VULKAN_SUPPORT) - list(APPEND headers - VKView.h - ) - list(APPEND sources - VKView.cpp - ) -endif() - -if (DIRECTX_SUPPORT) - list(APPEND headers - DXView.h - ) - list(APPEND sources - DXView.cpp - ) -endif() - -if (METAL_SUPPORT) - list(APPEND headers - MTView.h - ) - list(APPEND sources - MTView.mm - ) -endif() - -add_library(View ${headers} ${sources}) - -target_include_directories(View - PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/.." -) - -target_link_libraries(View - Resource - Instance - Utilities -) - -if (VULKAN_SUPPORT) - target_link_libraries(View - vulkan - ) -endif() - -if (DIRECTX_SUPPORT) - target_link_libraries(View - d3d12 - dxgi - dxguid - ) -endif() - -set_target_properties(View PROPERTIES FOLDER "FlyCube") diff --git a/src/Modules/AppBox/AppBox.cpp b/src/Modules/AppBox/AppBox.cpp index 4d0a3c6e..b550b5dc 100644 --- a/src/Modules/AppBox/AppBox.cpp +++ b/src/Modules/AppBox/AppBox.cpp @@ -61,7 +61,7 @@ AppBox::AppBox(const std::string& title, Settings setting) NSWindow* nswindow = glfwGetCocoaWindow(m_window); nswindow.contentView.layer = [CAMetalLayer layer]; nswindow.contentView.wantsLayer = YES; - m_layer = nswindow.contentView.layer; + m_layer = (__bridge void*)nswindow.contentView.layer; #endif } diff --git a/src/Modules/AppBox/CMakeLists.txt b/src/Modules/AppBox/CMakeLists.txt index 8ef9a679..7b7e1dde 100644 --- a/src/Modules/AppBox/CMakeLists.txt +++ b/src/Modules/AppBox/CMakeLists.txt @@ -19,7 +19,7 @@ add_library(AppBox ${headers} ${sources}) target_link_libraries(AppBox glfw - ApiType + FlyCube ) if (APPLE)