diff --git a/Panzerfaust/CMakeLists.txt b/Panzerfaust/CMakeLists.txt index 37d73d15..c7784b36 100644 --- a/Panzerfaust/CMakeLists.txt +++ b/Panzerfaust/CMakeLists.txt @@ -28,6 +28,8 @@ if (APPLE) set (RUNTIME_IDENTIFIER -r $,osx-arm64,osx-x64>) elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") set (RUNTIME_IDENTIFIER -r win-x64) +elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + set (RUNTIME_IDENTIFIER -r linux-x64) endif () set (CUSTOM_TARGET_NAME ${CSPROJ}) diff --git a/Panzerfaust/Panzerfaust.csproj b/Panzerfaust/Panzerfaust.csproj index a3e9c1ce..c03d5370 100644 --- a/Panzerfaust/Panzerfaust.csproj +++ b/Panzerfaust/Panzerfaust.csproj @@ -9,6 +9,7 @@ ./Assets/avalonia-logo.ico ..\Result.Windows.x64.MultiConfig ..\Result.Darwin.x64.$(Configuration) + ..\Result.Linux.x64.$(Configuration) x64;arm64 @@ -56,6 +57,23 @@ $(BaseOutputPath)\Panzerfaust\$(Configuration) TRACE;__MACOS__ + + x64 + true + full + false + $(BaseOutputPath)\Panzerfaust\$(Configuration) + TRACE;DEBUG;__LINUX__ + + + + x64 + pdbonly + true + $(BaseOutputPath)\Panzerfaust\$(Configuration) + TRACE;__LINUX__ + + app.manifest diff --git a/Panzerfaust/Service/EngineService.cs b/Panzerfaust/Service/EngineService.cs index b7c02b1e..98b0dbb5 100644 --- a/Panzerfaust/Service/EngineService.cs +++ b/Panzerfaust/Service/EngineService.cs @@ -38,7 +38,17 @@ public async Task StartAsync(string path) }; var engineProcess = Process.Start(processStartInfo); - bool processIdle = engineProcess.WaitForInputIdle(); + bool processIdle = false; + if (OperatingSystem.IsWindows()) + { + processIdle = engineProcess.WaitForInputIdle(3000); + } + else + { + await Task.Delay(500); + processIdle = true; + } + if (processIdle) { return; } else diff --git a/Scripts/PostBuild.ps1 b/Scripts/PostBuild.ps1 index 0b23bb2d..4dcf9004 100644 --- a/Scripts/PostBuild.ps1 +++ b/Scripts/PostBuild.ps1 @@ -28,7 +28,7 @@ param ( [string[]] $SystemName = 'Windows', [Parameter(HelpMessage="Architecture type to build, default to x64")] - [ValidateSet('win-x64', 'arm64', 'osx-x64', 'osx-arm64')] + [ValidateSet('win-x64', 'arm64', 'osx-x64', 'osx-arm64','linux-x64')] [string[]] $Architectures = 'win-x64', [Parameter(HelpMessage="Configuration type to build, default to Debug")] @@ -103,7 +103,8 @@ $ContentsToProcess = @( } } "Linux" { - @{ From = "$OuputBuildDirectory\Tetragrama\$Configurations"; To = "$OuputBuildDirectory\Panzerfaust\$Configurations\$TargetFramework\Editor"} + @{ From = "$OuputBuildDirectory\Tetragrama"; To = "$OuputBuildDirectory\Panzerfaust\$Configurations\$TargetFramework\$Architectures\Editor"} + @{ From = "$OuputBuildDirectory\Tetragrama"; To = "$OuputBuildDirectory\Panzerfaust\$Configurations\$TargetFramework\$Architectures\publish\Editor"} } Default { throw 'This system is not supported' diff --git a/Scripts/Shared.ps1 b/Scripts/Shared.ps1 index 4364db64..d11f6a95 100644 --- a/Scripts/Shared.ps1 +++ b/Scripts/Shared.ps1 @@ -166,6 +166,9 @@ function Find-GlslangValidator () { if ($IsMacOS) { Join-Path -Path $shaderCCompilerPath -ChildPath "\bin\glslangValidator" # On macOS, the pipeline build might pick up this option... } + if ($IsLinux) { + Join-Path -Path $shaderCCompilerPath -ChildPath "\bin\glslangValidator" + } ) foreach ($GlslangValidatorProgram in $GlslangValidatorCandidates) { @@ -197,6 +200,10 @@ function Find-ClangFormat () { if ($IsWindows) { Join-Path -Path $env:ProgramFiles -ChildPath 'LLVM\bin\clang-format.exe' } + if ($IsLinux) { + '/usr/bin/clang-format' + '/usr/local/bin/clang-format' + } ) foreach ($candidate in $candidates) { @@ -225,7 +232,7 @@ function Setup-ShaderCCompilerTool () { $outputFile = Join-Path -Path $repositoryToolPath -ChildPath "ShaderCCompiler$outputFileExtension" Write-Host "Downloading Shader Compiler Tools..." - $shaderCToolUrl = IF($IsWindows) {$repoConfiguration.Requirements.ShaderC.Windows.Url} Elseif($IsMacOS) {$repoConfiguration.Requirements.ShaderC.macOS.Url} + $shaderCToolUrl = IF($IsWindows) {$repoConfiguration.Requirements.ShaderC.Windows.Url} Elseif($IsMacOS) {$repoConfiguration.Requirements.ShaderC.macOS.Url} Elseif($IsLinux) {$repoConfiguration.Requirements.ShaderC.Linux.Url} Invoke-WebRequest -Uri $shaderCToolUrl -OutFile $outputFile # Extract contents diff --git a/Tetragrama/EntryPoint.cpp b/Tetragrama/EntryPoint.cpp index 2f557fea..855ece67 100644 --- a/Tetragrama/EntryPoint.cpp +++ b/Tetragrama/EntryPoint.cpp @@ -24,7 +24,7 @@ int applicationEntryPoint(int argc, char* argv[]) MemoryManager manager = {}; MemoryConfiguration config = {.DefaultSize = ZGiga(2u)}; manager.Initialize(config); - auto arena = &(manager.ArenaAllocator); + auto arena = &(manager.Allocator); LoggerConfiguration logger_cfg = {}; Logger::Initialize(arena, logger_cfg); diff --git a/ZEngine/ZEngine/Core/Memory/MemoryManager.h b/ZEngine/ZEngine/Core/Memory/MemoryManager.h index b49a2bda..5e431f99 100644 --- a/ZEngine/ZEngine/Core/Memory/MemoryManager.h +++ b/ZEngine/ZEngine/Core/Memory/MemoryManager.h @@ -12,14 +12,14 @@ namespace ZEngine::Core::Memory { void Initialize(const MemoryConfiguration& config) { - this->ArenaAllocator.Initialize(config.DefaultSize); + this->Allocator.Initialize(config.DefaultSize); } void Shutdowm() { - ArenaAllocator.Shutdown(); + Allocator.Shutdown(); } - ArenaAllocator ArenaAllocator = {}; + ArenaAllocator Allocator = {}; }; } // namespace ZEngine::Core::Memory \ No newline at end of file diff --git a/ZEngine/ZEngine/Hardwares/VulkanDevice.cpp b/ZEngine/ZEngine/Hardwares/VulkanDevice.cpp index 3421fcc5..cb08e2fd 100644 --- a/ZEngine/ZEngine/Hardwares/VulkanDevice.cpp +++ b/ZEngine/ZEngine/Hardwares/VulkanDevice.cpp @@ -371,7 +371,7 @@ namespace ZEngine::Hardwares * Creating VMA Allocators */ VmaAllocatorCreateInfo vma_allocator_create_info = {.physicalDevice = PhysicalDevice, .device = LogicalDevice, .instance = Instance, .vulkanApiVersion = VK_API_VERSION_1_3}; - ZENGINE_VALIDATE_ASSERT(vmaCreateAllocator(&vma_allocator_create_info, &VmaAllocator) == VK_SUCCESS, "Failed to create VMA Allocator") + ZENGINE_VALIDATE_ASSERT(vmaCreateAllocator(&vma_allocator_create_info, &Allocator) == VK_SUCCESS, "Failed to create VMA Allocator") m_buffer_manager.Initialize(this); EnqueuedCommandbuffers.init(Arena, m_buffer_manager.TotalCommandBufferCount, m_buffer_manager.TotalCommandBufferCount); @@ -451,7 +451,7 @@ namespace ZEngine::Hardwares void VulkanDevice::Dispose() { - vmaDestroyAllocator(VmaAllocator); + vmaDestroyAllocator(Allocator); if (__destroyDebugMessengerPtr) { @@ -667,7 +667,7 @@ namespace ZEngine::Hardwares } BufferView& buffer = DirtyBuffers[handle]; - vmaDestroyBuffer(VmaAllocator, buffer.Handle, buffer.Allocation); + vmaDestroyBuffer(Allocator, buffer.Handle, buffer.Allocation); DirtyBuffers.Remove(handle); } } @@ -688,7 +688,7 @@ namespace ZEngine::Hardwares vkDestroyImageView(LogicalDevice, buffer.ViewHandle, nullptr); vkDestroySampler(LogicalDevice, buffer.Sampler, nullptr); - vmaDestroyImage(VmaAllocator, buffer.Handle, buffer.Allocation); + vmaDestroyImage(Allocator, buffer.Handle, buffer.Allocation); DirtyBufferImages.Remove(handle); } @@ -699,9 +699,9 @@ namespace ZEngine::Hardwares void* mapped_memory; if (data) { - ZENGINE_VALIDATE_ASSERT(vmaMapMemory(VmaAllocator, buffer.Allocation, &mapped_memory) == VK_SUCCESS, "Failed to map memory") + ZENGINE_VALIDATE_ASSERT(vmaMapMemory(Allocator, buffer.Allocation, &mapped_memory) == VK_SUCCESS, "Failed to map memory") ZENGINE_VALIDATE_ASSERT(Helpers::secure_memcpy(mapped_memory, data_size, data, data_size) == Helpers::MEMORY_OP_SUCCESS, "Failed to perform memory copy operation") - vmaUnmapMemory(VmaAllocator, buffer.Allocation); + vmaUnmapMemory(Allocator, buffer.Allocation); } } @@ -718,13 +718,13 @@ namespace ZEngine::Hardwares allocation_create_info.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; allocation_create_info.flags = vma_create_flags; - ZENGINE_VALIDATE_ASSERT(vmaCreateBuffer(VmaAllocator, &buffer_create_info, &allocation_create_info, &(buffer_view.Handle), &(buffer_view.Allocation), nullptr) == VK_SUCCESS, "Failed to create buffer"); + ZENGINE_VALIDATE_ASSERT(vmaCreateBuffer(Allocator, &buffer_create_info, &allocation_create_info, &(buffer_view.Handle), &(buffer_view.Allocation), nullptr) == VK_SUCCESS, "Failed to create buffer"); /* * Zeroing the buffer */ VmaAllocationInfo allocation_info = {}; - vmaGetAllocationInfo(VmaAllocator, buffer_view.Allocation, &allocation_info); + vmaGetAllocationInfo(Allocator, buffer_view.Allocation, &allocation_info); Helpers::secure_memset(allocation_info.pMappedData, 0, byte_size, byte_size); // Metadata info @@ -844,7 +844,7 @@ namespace ZEngine::Hardwares allocation_create_info.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; allocation_create_info.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; - ZENGINE_VALIDATE_ASSERT(vmaCreateImage(VmaAllocator, &image_create_info, &allocation_create_info, &(buffer_image.Handle), &(buffer_image.Allocation), nullptr) == VK_SUCCESS, "Failed to create buffer"); + ZENGINE_VALIDATE_ASSERT(vmaCreateImage(Allocator, &image_create_info, &allocation_create_info, &(buffer_image.Handle), &(buffer_image.Allocation), nullptr) == VK_SUCCESS, "Failed to create buffer"); buffer_image.ViewHandle = CreateImageView(buffer_image.Handle, image_format, image_view_type, image_aspect_flag, layer_count); buffer_image.Sampler = CreateImageSampler(); @@ -1404,7 +1404,7 @@ namespace ZEngine::Hardwares BufferView& buffer = DirtyBuffers[handle]; if (buffer && buffer.FrameIndex == CurrentFrameIndex) { - vmaDestroyBuffer(VmaAllocator, buffer.Handle, buffer.Allocation); + vmaDestroyBuffer(Allocator, buffer.Handle, buffer.Allocation); buffer.Handle = VK_NULL_HANDLE; buffer.Allocation = VK_NULL_HANDLE; DirtyBuffers.Remove(handle); @@ -1430,7 +1430,7 @@ namespace ZEngine::Hardwares { vkDestroyImageView(LogicalDevice, buffer.ViewHandle, nullptr); vkDestroySampler(LogicalDevice, buffer.Sampler, nullptr); - vmaDestroyImage(VmaAllocator, buffer.Handle, buffer.Allocation); + vmaDestroyImage(Allocator, buffer.Handle, buffer.Allocation); buffer.Handle = VK_NULL_HANDLE; buffer.Allocation = VK_NULL_HANDLE; DirtyBufferImages.Remove(handle); @@ -2092,7 +2092,7 @@ namespace ZEngine::Hardwares m_current_offset = 0; m_total_size = size; Buffer = CreateBuffer(); - vmaSetAllocationName(m_device->VmaAllocator, Buffer.Allocation, debug_name); + vmaSetAllocationName(m_device->Allocator, Buffer.Allocation, debug_name); } } @@ -2117,12 +2117,12 @@ namespace ZEngine::Hardwares } VkMemoryPropertyFlags mem_prop_flags; - vmaGetAllocationMemoryProperties(m_device->VmaAllocator, Buffer.Allocation, &mem_prop_flags); + vmaGetAllocationMemoryProperties(m_device->Allocator, Buffer.Allocation, &mem_prop_flags); if (mem_prop_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { VmaAllocationInfo allocation_info = {}; - vmaGetAllocationInfo(m_device->VmaAllocator, Buffer.Allocation, &allocation_info); + vmaGetAllocationInfo(m_device->Allocator, Buffer.Allocation, &allocation_info); if (allocation_info.pMappedData) { auto mapped_buf = reinterpret_cast(allocation_info.pMappedData); @@ -2134,12 +2134,12 @@ namespace ZEngine::Hardwares BufferView staging_buffer = m_device->CreateBuffer(static_cast(byte_size), VK_BUFFER_USAGE_TRANSFER_SRC_BIT, VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT); VmaAllocationInfo allocation_info = {}; - vmaGetAllocationInfo(m_device->VmaAllocator, staging_buffer.Allocation, &allocation_info); + vmaGetAllocationInfo(m_device->Allocator, staging_buffer.Allocation, &allocation_info); if (allocation_info.pMappedData) { ZENGINE_VALIDATE_ASSERT(Helpers::secure_memset(allocation_info.pMappedData, value, allocation_info.size, byte_size) == Helpers::MEMORY_OP_SUCCESS, "Failed to perform memory copy operation") - ZENGINE_VALIDATE_ASSERT(vmaFlushAllocation(m_device->VmaAllocator, staging_buffer.Allocation, 0, byte_size) == VK_SUCCESS, "Failed to flush allocation") + ZENGINE_VALIDATE_ASSERT(vmaFlushAllocation(m_device->Allocator, staging_buffer.Allocation, 0, byte_size) == VK_SUCCESS, "Failed to flush allocation") m_device->CopyBuffer(staging_buffer, Buffer, byte_size, 0u, offset); } @@ -2163,11 +2163,11 @@ namespace ZEngine::Hardwares } VkMemoryPropertyFlags mem_prop_flags; - vmaGetAllocationMemoryProperties(m_device->VmaAllocator, Buffer.Allocation, &mem_prop_flags); + vmaGetAllocationMemoryProperties(m_device->Allocator, Buffer.Allocation, &mem_prop_flags); if (mem_prop_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { - ZENGINE_VALIDATE_ASSERT(vmaCopyMemoryToAllocation(m_device->VmaAllocator, data, Buffer.Allocation, offset, byte_size) == VK_SUCCESS, "Failed to perform memory copy operation") + ZENGINE_VALIDATE_ASSERT(vmaCopyMemoryToAllocation(m_device->Allocator, data, Buffer.Allocation, offset, byte_size) == VK_SUCCESS, "Failed to perform memory copy operation") VkAccessFlags dst_access_mask = VK_ACCESS_NONE; VkPipelineStageFlags dst_pipeline_stage = VK_PIPELINE_STAGE_TRANSFER_BIT; @@ -2218,7 +2218,7 @@ namespace ZEngine::Hardwares { BufferView staging_buffer = m_device->CreateBuffer(static_cast(byte_size), VK_BUFFER_USAGE_TRANSFER_SRC_BIT, VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT); - ZENGINE_VALIDATE_ASSERT(vmaCopyMemoryToAllocation(m_device->VmaAllocator, data, staging_buffer.Allocation, offset, byte_size) == VK_SUCCESS, "Failed to perform memory copy operation") + ZENGINE_VALIDATE_ASSERT(vmaCopyMemoryToAllocation(m_device->Allocator, data, staging_buffer.Allocation, offset, byte_size) == VK_SUCCESS, "Failed to perform memory copy operation") m_device->CopyBuffer(staging_buffer, Buffer, byte_size, 0u, offset); diff --git a/ZEngine/ZEngine/Hardwares/VulkanDevice.h b/ZEngine/ZEngine/Hardwares/VulkanDevice.h index 6ef5e527..467b4c37 100644 --- a/ZEngine/ZEngine/Hardwares/VulkanDevice.h +++ b/ZEngine/ZEngine/Hardwares/VulkanDevice.h @@ -554,7 +554,7 @@ namespace ZEngine::Hardwares VkPhysicalDeviceFeatures PhysicalDeviceFeature = {}; VkPhysicalDeviceMemoryProperties PhysicalDeviceMemoryProperties = {}; VkSwapchainKHR SwapchainHandle = VK_NULL_HANDLE; - VmaAllocator VmaAllocator = nullptr; + VmaAllocator Allocator = nullptr; Core::Containers::Array DefaultDepthFormats = {}; Rendering::Renderers::RenderPasses::Attachment* SwapchainAttachment = {}; Core::Containers::Array SwapchainImageViews = {}; diff --git a/ZEngine/ZEngine/Helpers/IntrusivePtr.h b/ZEngine/ZEngine/Helpers/IntrusivePtr.h index ce7fd2a4..b6dc483b 100644 --- a/ZEngine/ZEngine/Helpers/IntrusivePtr.h +++ b/ZEngine/ZEngine/Helpers/IntrusivePtr.h @@ -119,7 +119,7 @@ namespace ZEngine::Helpers IntrusivePtr(IntrusivePtr&& other) noexcept : m_ptr(other.detach()) {} template >> - IntrusivePtr(const IntrusivePtr& other) noexcept(noexcept(T::IncrementRefCount(m_ptr))) : m_ptr(other.get()) + IntrusivePtr(const IntrusivePtr& other) noexcept(noexcept(T::IncrementRefCount(other.get()))) : m_ptr(other.get()) { T::IncrementRefCount(m_ptr); } diff --git a/ZEngine/ZEngine/Rendering/Renderers/Pipelines/RendererPipeline.cpp b/ZEngine/ZEngine/Rendering/Renderers/Pipelines/RendererPipeline.cpp index 5314322c..75dfced8 100644 --- a/ZEngine/ZEngine/Rendering/Renderers/Pipelines/RendererPipeline.cpp +++ b/ZEngine/ZEngine/Rendering/Renderers/Pipelines/RendererPipeline.cpp @@ -11,7 +11,7 @@ namespace ZEngine::Rendering::Renderers::Pipelines { Device = device; Specification = std::move(spec); - auto shader_handle = Device->CompileShader(Specification.ShaderSpecification); + auto shader_handle = Device->CompileShader(Specification.ShaderSpec); if (!shader_handle) { ZENGINE_CORE_ERROR("") diff --git a/ZEngine/ZEngine/Rendering/Renderers/RenderGraph.cpp b/ZEngine/ZEngine/Rendering/Renderers/RenderGraph.cpp index 84e37e36..7cd54442 100644 --- a/ZEngine/ZEngine/Rendering/Renderers/RenderGraph.cpp +++ b/ZEngine/ZEngine/Rendering/Renderers/RenderGraph.cpp @@ -485,7 +485,7 @@ namespace ZEngine::Rendering::Renderers } if (m_resource_map[name].Type != RenderGraphResourceType::ATTACHMENT) { - ZENGINE_CORE_WARN("{} isn't a valid Attachement Resource", name) + // ZENGINE_CORE_WARN("{} isn't a valid Attachement Resource", name) } auto handle = m_resource_map[name].ResourceInfo.TextureHandle; @@ -506,7 +506,7 @@ namespace ZEngine::Rendering::Renderers } if (m_resource_map[name].Type != RenderGraphResourceType::TEXTURE) { - ZENGINE_CORE_WARN("{} isn't a valid Texture Resource", name) + // ZENGINE_CORE_WARN("{} isn't a valid Texture Resource", name) } auto handle = m_resource_map[name].ResourceInfo.TextureHandle; diff --git a/ZEngine/ZEngine/Rendering/Renderers/RenderPasses/RenderPass.cpp b/ZEngine/ZEngine/Rendering/Renderers/RenderPasses/RenderPass.cpp index 0c6fac33..33a5e032 100644 --- a/ZEngine/ZEngine/Rendering/Renderers/RenderPasses/RenderPass.cpp +++ b/ZEngine/ZEngine/Rendering/Renderers/RenderPasses/RenderPass.cpp @@ -390,13 +390,13 @@ namespace ZEngine::Rendering::Renderers::RenderPasses RenderPassBuilder& RenderPassBuilder::SetShaderOverloadMaxSet(uint32_t count) { - m_spec.PipelineSpecification.ShaderSpecification.OverloadMaxSet = count; + m_spec.PipelineSpecification.ShaderSpec.OverloadMaxSet = count; return *this; } RenderPassBuilder& RenderPassBuilder::SetOverloadPoolSize(uint32_t count) { - m_spec.PipelineSpecification.ShaderSpecification.OverloadPoolSize = count; + m_spec.PipelineSpecification.ShaderSpec.OverloadPoolSize = count; return *this; } @@ -450,7 +450,7 @@ namespace ZEngine::Rendering::Renderers::RenderPasses RenderPassBuilder& RenderPassBuilder::UseShader(std::string_view name) { - m_spec.PipelineSpecification.ShaderSpecification.Name = name.data(); + m_spec.PipelineSpecification.ShaderSpec.Name = name.data(); return *this; } diff --git a/ZEngine/ZEngine/Rendering/Scenes/GraphicScene.cpp b/ZEngine/ZEngine/Rendering/Scenes/GraphicScene.cpp index 1a151b48..55e85196 100644 --- a/ZEngine/ZEngine/Rendering/Scenes/GraphicScene.cpp +++ b/ZEngine/ZEngine/Rendering/Scenes/GraphicScene.cpp @@ -157,7 +157,7 @@ namespace ZEngine::Rendering::Scenes SceneData->Indices = {0}; SceneData->Materials = {Meshes::MeshMaterial{}}; SceneData->MaterialFiles = {Meshes::MaterialFile{}}; - SceneData->DrawData = { + SceneData->DrawDataList = { DrawData{.TransformIndex = 0, .VertexOffset = 0, .IndexOffset = 0, .VertexCount = 1, .IndexCount = 1} }; } @@ -169,13 +169,13 @@ namespace ZEngine::Rendering::Scenes if (draw_count) { - SceneData->DrawData.resize(draw_count); + SceneData->DrawDataList.resize(draw_count); indirect_commmands.resize(draw_count); int i = 0; for (auto& [node, mesh] : SceneData->NodeMeshes) { - DrawData& draw_data = SceneData->DrawData[i]; + DrawData& draw_data = SceneData->DrawDataList[i]; draw_data.TransformIndex = node; draw_data.MaterialIndex = SceneData->NodeMaterials[node]; draw_data.VertexOffset = SceneData->Meshes[mesh].VertexOffset; @@ -189,13 +189,13 @@ namespace ZEngine::Rendering::Scenes else { // We use the default data - indirect_commmands.resize(SceneData->DrawData.size()); + indirect_commmands.resize(SceneData->DrawDataList.size()); } - for (uint32_t i = 0; i < SceneData->DrawData.size(); ++i) + for (uint32_t i = 0; i < SceneData->DrawDataList.size(); ++i) { indirect_commmands[i] = { - .vertexCount = SceneData->DrawData[i].IndexCount, + .vertexCount = SceneData->DrawDataList[i].IndexCount, .instanceCount = 1, .firstVertex = 0, .firstInstance = i, @@ -273,7 +273,7 @@ namespace ZEngine::Rendering::Scenes // vert_buf->SetData(i, SceneData->Vertices); // ind_buf->SetData(i, SceneData->Indices); // material_buf->SetData(i, SceneData->Materials); - // indirect_datadraw_buf->SetData(i, SceneData->DrawData); + // indirect_datadraw_buf->SetData(i, SceneData->DrawDataList); // indirect_buf->SetData(i, indirect_commmands); } diff --git a/ZEngine/ZEngine/Rendering/Scenes/GraphicScene.h b/ZEngine/ZEngine/Rendering/Scenes/GraphicScene.h index 68cc723e..2d0e2d63 100644 --- a/ZEngine/ZEngine/Rendering/Scenes/GraphicScene.h +++ b/ZEngine/ZEngine/Rendering/Scenes/GraphicScene.h @@ -79,7 +79,7 @@ namespace ZEngine::Rendering::Scenes */ std::vector Vertices = {}; std::vector Indices = {}; - std::vector DrawData = {}; + std::vector DrawDataList = {}; std::vector Names = {}; std::vector MaterialNames = {}; std::unordered_map NodeMeshes = {}; diff --git a/ZEngine/ZEngine/Rendering/Shaders/Shader.cpp b/ZEngine/ZEngine/Rendering/Shaders/Shader.cpp index a6e1991e..f68d6200 100644 --- a/ZEngine/ZEngine/Rendering/Shaders/Shader.cpp +++ b/ZEngine/ZEngine/Rendering/Shaders/Shader.cpp @@ -99,7 +99,7 @@ namespace ZEngine::Rendering::Shaders LayoutBindingSpecificationMap[set].init(m_device->Arena, 10); } - LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = UB_resource.name, .DescriptorType = DescriptorType::UNIFORM_BUFFER, .Flags = ShaderStageFlags::VERTEX}); + LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = UB_resource.name, .Type = DescriptorType::UNIFORM_BUFFER, .Flags = ShaderStageFlags::VERTEX}); } for (const auto& SB_resource : vertex_resources.storage_buffers) @@ -112,7 +112,7 @@ namespace ZEngine::Rendering::Shaders LayoutBindingSpecificationMap[set].init(m_device->Arena, 10); } - LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = SB_resource.name, .DescriptorType = DescriptorType::STORAGE_BUFFER, .Flags = ShaderStageFlags::VERTEX}); + LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = SB_resource.name, .Type = DescriptorType::STORAGE_BUFFER, .Flags = ShaderStageFlags::VERTEX}); } for (const auto& pushConstant_resource : vertex_resources.push_constant_buffers) @@ -168,7 +168,7 @@ namespace ZEngine::Rendering::Shaders LayoutBindingSpecificationMap[set].init(m_device->Arena, 10); } - LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = UB_resource.name, .DescriptorType = DescriptorType::UNIFORM_BUFFER, .Flags = ShaderStageFlags::FRAGMENT}); + LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = UB_resource.name, .Type = DescriptorType::UNIFORM_BUFFER, .Flags = ShaderStageFlags::FRAGMENT}); } for (const auto& SB_resource : fragment_resources.storage_buffers) @@ -181,7 +181,7 @@ namespace ZEngine::Rendering::Shaders LayoutBindingSpecificationMap[set].init(m_device->Arena, 10); } - LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = SB_resource.name, .DescriptorType = DescriptorType::STORAGE_BUFFER, .Flags = ShaderStageFlags::FRAGMENT}); + LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Name = SB_resource.name, .Type = DescriptorType::STORAGE_BUFFER, .Flags = ShaderStageFlags::FRAGMENT}); } for (const auto& pushConstant_resource : fragment_resources.push_constant_buffers) @@ -226,7 +226,7 @@ namespace ZEngine::Rendering::Shaders LayoutBindingSpecificationMap[set].init(m_device->Arena, 10); } - LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Count = count, .Name = SI_resource.name, .DescriptorType = DescriptorType::COMBINED_IMAGE_SAMPLER, .Flags = ShaderStageFlags::FRAGMENT}); + LayoutBindingSpecificationMap[set].push(LayoutBindingSpecification{.Set = set, .Binding = binding, .Count = count, .Name = SI_resource.name, .Type = DescriptorType::COMBINED_IMAGE_SAMPLER, .Flags = ShaderStageFlags::FRAGMENT}); } } } @@ -281,7 +281,7 @@ namespace ZEngine::Rendering::Shaders layout_binding_collection.init(&LocalArena, 10); for (uint32_t i = 0; i < layout_binding_set.second.size(); ++i) { - layout_binding_collection.push(VkDescriptorSetLayoutBinding{.binding = layout_binding_set.second[i].Binding, .descriptorType = DescriptorTypeMap[static_cast(layout_binding_set.second[i].DescriptorType)], .descriptorCount = layout_binding_set.second[i].Count, .stageFlags = ShaderStageFlagsMap[static_cast(layout_binding_set.second[i].Flags)], .pImmutableSamplers = nullptr}); + layout_binding_collection.push(VkDescriptorSetLayoutBinding{.binding = layout_binding_set.second[i].Binding, .descriptorType = DescriptorTypeMap[static_cast(layout_binding_set.second[i].Type)], .descriptorCount = layout_binding_set.second[i].Count, .stageFlags = ShaderStageFlagsMap[static_cast(layout_binding_set.second[i].Flags)], .pImmutableSamplers = nullptr}); } /* * Binding flag extension diff --git a/ZEngine/ZEngine/Rendering/Shaders/ShaderReader.cpp b/ZEngine/ZEngine/Rendering/Shaders/ShaderReader.cpp index e8dfb01e..b23871a3 100644 --- a/ZEngine/ZEngine/Rendering/Shaders/ShaderReader.cpp +++ b/ZEngine/ZEngine/Rendering/Shaders/ShaderReader.cpp @@ -18,8 +18,8 @@ namespace ZEngine::Rendering::Shaders std::vector ShaderReader::ReadAsBinary(std::string_view filename) { - std::ifstream file_stream = {}; - file_stream.open(filename, std::ifstream::binary | std::ifstream::ate); + std::ifstream file_stream; + file_stream.open(std::string(filename), std::ifstream::binary | std::ifstream::ate); if (!file_stream.is_open()) { ZENGINE_CORE_ERROR("====== Shader file : {} cannot be opened ======", filename.data()) diff --git a/ZEngine/ZEngine/Rendering/Specifications/GraphicRendererPipelineSpecification.h b/ZEngine/ZEngine/Rendering/Specifications/GraphicRendererPipelineSpecification.h index f273378b..2b194399 100644 --- a/ZEngine/ZEngine/Rendering/Specifications/GraphicRendererPipelineSpecification.h +++ b/ZEngine/ZEngine/Rendering/Specifications/GraphicRendererPipelineSpecification.h @@ -29,7 +29,7 @@ namespace ZEngine::Rendering::Specifications uint32_t DepthCompareOp = VK_COMPARE_OP_LESS_OR_EQUAL; bool EnableStencilTest = false; const char* DebugName = {}; - ShaderSpecification ShaderSpecification = {}; + ShaderSpecification ShaderSpec = {}; Rendering::Buffers::FramebufferVNext* TargetFrameBuffer = {}; Renderers::RenderPasses::Attachment* Attachment = {}; Core::Containers::Array VertexInputBindingSpecifications = {}; diff --git a/ZEngine/ZEngine/Rendering/Specifications/ShaderSpecification.h b/ZEngine/ZEngine/Rendering/Specifications/ShaderSpecification.h index 2717d9b6..a98d57fe 100644 --- a/ZEngine/ZEngine/Rendering/Specifications/ShaderSpecification.h +++ b/ZEngine/ZEngine/Rendering/Specifications/ShaderSpecification.h @@ -1,5 +1,6 @@ #pragma once #include +#include namespace ZEngine::Rendering::Specifications { @@ -39,7 +40,7 @@ namespace ZEngine::Rendering::Specifications uint32_t Binding{0xFFFFFFFF}; uint32_t Count{1}; std::string Name; - DescriptorType DescriptorType; + DescriptorType Type; ShaderStageFlags Flags; }; diff --git a/ZEngine/ZEngine/Rendering/Specifications/TextureSpecification.h b/ZEngine/ZEngine/Rendering/Specifications/TextureSpecification.h index 35d64a1f..80323a59 100644 --- a/ZEngine/ZEngine/Rendering/Specifications/TextureSpecification.h +++ b/ZEngine/ZEngine/Rendering/Specifications/TextureSpecification.h @@ -34,13 +34,13 @@ namespace ZEngine::Rendering::Specifications { uint32_t Width; uint32_t Height; - ImageViewType ImageViewType = ImageViewType::TYPE_2D; + ImageViewType ViewType = ImageViewType::TYPE_2D; ImageBufferUsageType BufferUsageType; VkFormat ImageFormat; VkImageUsageFlags ImageUsage; VkImageAspectFlagBits ImageAspectFlag; - uint32_t LayerCount = 1U; - ImageCreateFlag ImageCreateFlag = ImageCreateFlag::NONE; + uint32_t LayerCount = 1U; + ImageCreateFlag CreateFlag = ImageCreateFlag::NONE; }; } // namespace ZEngine::Rendering::Specifications \ No newline at end of file diff --git a/ZEngine/ZEngine/ZEngineDef.h b/ZEngine/ZEngine/ZEngineDef.h index 7da8597e..858d0aa3 100644 --- a/ZEngine/ZEngine/ZEngineDef.h +++ b/ZEngine/ZEngine/ZEngineDef.h @@ -8,7 +8,7 @@ #ifdef _MSC_VER #define ZENGINE_DEBUG_BREAK() __debugbreak(); -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__linux__) #include #define ZENGINE_DEBUG_BREAK() __builtin_trap(); #else diff --git a/ZEngine/tests/Memory/allocator_test.cpp b/ZEngine/tests/Memory/allocator_test.cpp index 424a0c73..c81f8ad3 100644 --- a/ZEngine/tests/Memory/allocator_test.cpp +++ b/ZEngine/tests/Memory/allocator_test.cpp @@ -82,14 +82,14 @@ TEST(AllocatorTest, ArenaMemoryManager) void Func() {} }; - int* intPtr = ZPushArray(&(manager.ArenaAllocator), int, 1); - auto structPtr = ZPushStruct(&(manager.ArenaAllocator), Foo); + int* intPtr = ZPushArray(&(manager.Allocator), int, 1); + auto structPtr = ZPushStruct(&(manager.Allocator), Foo); *intPtr = 12; structPtr->x = 12; structPtr->y = 798.0f; - char* str = ZPushString(&(manager.ArenaAllocator), 12); + char* str = ZPushString(&(manager.Allocator), 12); Helpers::secure_memmove(str, 12, "hello", 5); EXPECT_EQ(*intPtr, 12); @@ -121,7 +121,7 @@ TEST(AllocatorTest, ArenaMemoryTemp) { MemoryManager manager{}; manager.Initialize({.DefaultSize = ZKilo(10)}); - auto arena = &(manager.ArenaAllocator); + auto arena = &(manager.Allocator); { auto fooPtr = ZPushStruct(arena, Foo); fooPtr->x = 10; @@ -142,7 +142,7 @@ TEST(AllocatorTest, ArenaMemoryPool) { MemoryManager manager{}; manager.Initialize({.DefaultSize = ZKilo(10)}); - auto arena = &(manager.ArenaAllocator); + auto arena = &(manager.Allocator); { PoolAllocator pool; pool.Initialize(arena, sizeof(Foo) * 100, sizeof(Foo)); diff --git a/ZEngine/tests/Memory/handleManager_test.cpp b/ZEngine/tests/Memory/handleManager_test.cpp index 7957ff4d..b9ee00a2 100644 --- a/ZEngine/tests/Memory/handleManager_test.cpp +++ b/ZEngine/tests/Memory/handleManager_test.cpp @@ -10,7 +10,7 @@ class HandleManagerTest : public ::testing::Test void SetUp() override { manager.Initialize({.DefaultSize = ZKilo(10)}); - auto arena = &(manager.ArenaAllocator); + auto arena = &(manager.Allocator); handle_manager.Initialize(arena, 10); } @@ -114,7 +114,7 @@ TEST_F(HandleManagerTest, ReuseSlot) TEST_F(HandleManagerTest, ConcurrentAccess) { ZEngine::Helpers::HandleManager h_manager; - h_manager.Initialize(&(manager.ArenaAllocator), 40); + h_manager.Initialize(&(manager.Allocator), 40); const int numThreads = 4; const int numOperationsPerThread = 10; std::vector threads; diff --git a/repoConfiguration.json b/repoConfiguration.json index f0af7173..32fb80d6 100644 --- a/repoConfiguration.json +++ b/repoConfiguration.json @@ -10,6 +10,9 @@ }, "macOS": { "Url": "https://storage.googleapis.com/shaderc/artifacts/prod/graphics_shader_compiler/shaderc/macos/continuous_clang_release/472/20240708-061139/install.tgz" + }, + "Linux": { + "Url": "https://storage.googleapis.com/shaderc/artifacts/prod/graphics_shader_compiler/shaderc/linux/continuous_clang_release/461/20240621-131133/install.tgz" } }, "GlslangValidator": {