From 4a66b5d18d9320fe057e25f25a707aee65297c14 Mon Sep 17 00:00:00 2001 From: Dynamitos Date: Sun, 22 Feb 2026 20:26:25 +0100 Subject: [PATCH] Compatibility changes with macos --- CMakeLists.txt | 2 +- src/Engine/Containers/List.h | 2 +- src/Engine/Containers/MemoryResource.h | 1 + src/Engine/Graphics/CMakeLists.txt | 12 +++++------- src/Engine/Graphics/Vulkan/Graphics.cpp | 6 +++--- src/Engine/Graphics/Vulkan/Graphics.h | 2 +- src/Engine/Graphics/slang-compile.cpp | 16 ++++------------ 7 files changed, 16 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 082a38f..feed85d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,7 @@ endif() if(APPLE) target_link_libraries(Engine PUBLIC metal) - SET(CMAKE_OSX_DEPLOYMENT_TARGET 15.0) + SET(CMAKE_OSX_DEPLOYMENT_TARGET 26.0) endif() if(UNIX) target_link_libraries(Engine PUBLIC Threads::Threads) diff --git a/src/Engine/Containers/List.h b/src/Engine/Containers/List.h index 0d1dfc6..10169c8 100644 --- a/src/Engine/Containers/List.h +++ b/src/Engine/Containers/List.h @@ -1,7 +1,7 @@ #pragma once #include #include - +#include namespace Seele { template > class List { diff --git a/src/Engine/Containers/MemoryResource.h b/src/Engine/Containers/MemoryResource.h index 5e58fae..ccb21f2 100644 --- a/src/Engine/Containers/MemoryResource.h +++ b/src/Engine/Containers/MemoryResource.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include "MinimalEngine.h" namespace Seele { diff --git a/src/Engine/Graphics/CMakeLists.txt b/src/Engine/Graphics/CMakeLists.txt index 2290016..71f8065 100644 --- a/src/Engine/Graphics/CMakeLists.txt +++ b/src/Engine/Graphics/CMakeLists.txt @@ -1,4 +1,9 @@ #add_subdirectory(CBT/) +add_subdirectory(RenderPass/) +if(APPLE) + # add_subdirectory(Metal/) +endif() +add_subdirectory(Vulkan/) target_sources(Engine PRIVATE @@ -65,10 +70,3 @@ target_sources(Engine Texture.h VertexData.h Window.h) - -add_subdirectory(RenderPass/) -if(APPLE) - add_subdirectory(Metal/) -else() - add_subdirectory(Vulkan/) -endif() \ No newline at end of file diff --git a/src/Engine/Graphics/Vulkan/Graphics.cpp b/src/Engine/Graphics/Vulkan/Graphics.cpp index a4b7b11..08baaa9 100644 --- a/src/Engine/Graphics/Vulkan/Graphics.cpp +++ b/src/Engine/Graphics/Vulkan/Graphics.cpp @@ -754,11 +754,11 @@ void Graphics::pickPhysicalDevice() { vkGetPhysicalDeviceProperties2(physicalDevice, &props.get()); features.get().features = { - .geometryShader = true, + .geometryShader = false, .sampleRateShading = true, .fillModeNonSolid = true, - .wideLines = true, - .pipelineStatisticsQuery = true, + .wideLines = false, + .pipelineStatisticsQuery = false, .fragmentStoresAndAtomics = true, .shaderInt64 = true, .shaderInt16 = true, diff --git a/src/Engine/Graphics/Vulkan/Graphics.h b/src/Engine/Graphics/Vulkan/Graphics.h index 13f53ed..8a8f909 100644 --- a/src/Engine/Graphics/Vulkan/Graphics.h +++ b/src/Engine/Graphics/Vulkan/Graphics.h @@ -53,7 +53,7 @@ struct StructChain, Right...> : StructChain StructChain() { std::memset(&t, 0, sizeof(This)); t.sType = struct_type; - t.pNext = &StructChain::template get(); + t.pNext = &StructChain::get(); } This t; template constexpr Query& get() { diff --git a/src/Engine/Graphics/slang-compile.cpp b/src/Engine/Graphics/slang-compile.cpp index dfd755b..6873716 100644 --- a/src/Engine/Graphics/slang-compile.cpp +++ b/src/Engine/Graphics/slang-compile.cpp @@ -42,14 +42,6 @@ void Seele::beginCompilation(const ShaderCompilationInfo& info, SlangCompileTarg .intValue0 = SLANG_LINE_DIRECTIVE_MODE_NONE, }, }, - { - .name = slang::CompilerOptionName::EmitSpirvViaGLSL, - .value = - { - .kind = slang::CompilerOptionValueKind::Int, - .intValue0 = 1, - }, - }, { .name = slang::CompilerOptionName::DebugInformation, .value = @@ -76,8 +68,8 @@ void Seele::beginCompilation(const ShaderCompilationInfo& info, SlangCompileTarg }, }; - sessionDesc.compilerOptionEntries = option.data(); - sessionDesc.compilerOptionEntryCount = (uint32)option.size(); + sessionDesc.compilerOptionEntries = 0;//option.data(); + sessionDesc.compilerOptionEntryCount = 0;//(uint32)option.size(); sessionDesc.defaultMatrixLayoutMode = SLANG_MATRIX_LAYOUT_COLUMN_MAJOR; Array macros; for (const auto& [key, val] : info.defines) { @@ -88,9 +80,9 @@ void Seele::beginCompilation(const ShaderCompilationInfo& info, SlangCompileTarg } sessionDesc.preprocessorMacroCount = macros.size(); sessionDesc.preprocessorMacros = macros.data(); - slang::TargetDesc targetDesc; - targetDesc.profile = globalSession->findProfile("spv_1_4"); + slang::TargetDesc targetDesc = {}; targetDesc.format = target; + targetDesc.flags = SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY; sessionDesc.targetCount = 1; sessionDesc.targets = &targetDesc; StaticArray searchPaths = {"shaders/", "shaders/lib/", "shaders/raytracing/", "shaders/terrain", "shaders/game", "shaders/generated/"};