From 076b0013e0820f76ef35f5e385f97a81bb0e338a Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Wed, 31 May 2023 21:58:48 +0300 Subject: [PATCH 01/12] Upgrade to MethaneKit v0.7.2 release --- App/AsteroidsApp.cpp | 10 +++++----- App/AsteroidsApp.h | 4 ++-- CMakeLists.txt | 4 ++-- Externals/CPM.cmake | 2 +- Modules/Simulation/Asteroid.cpp | 2 +- Modules/Simulation/AsteroidsArray.cpp | 6 +++--- Modules/Simulation/Planet.cpp | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/App/AsteroidsApp.cpp b/App/AsteroidsApp.cpp index 45c3065..8625b78 100644 --- a/App/AsteroidsApp.cpp +++ b/App/AsteroidsApp.cpp @@ -306,10 +306,10 @@ void AsteroidsApp::Init() // Create constants buffer for frame rendering m_const_buffer = context.CreateBuffer(rhi::BufferSettings::ForConstantBuffer(constants_data_size)); m_const_buffer.SetName("Constants Buffer"); - m_const_buffer.SetData( - { { reinterpret_cast(&m_scene_constants), sizeof(m_scene_constants) } }, // NOSONAR - render_cmd_queue - ); + m_const_buffer.SetData(render_cmd_queue, { + reinterpret_cast(&m_scene_constants), + sizeof(m_scene_constants) + }); // ========= Per-Frame Data ========= for(AsteroidsFrame& frame : GetFrames()) @@ -436,7 +436,7 @@ bool AsteroidsApp::Render() // Upload uniform buffers to GPU const AsteroidsFrame& frame = GetCurrentFrame(); rhi::CommandQueue render_cmd_queue = GetRenderContext().GetRenderCommandKit().GetQueue(); - frame.scene_uniforms_buffer.SetData(m_scene_uniforms_subresources, render_cmd_queue); + frame.scene_uniforms_buffer.SetData(render_cmd_queue, m_scene_uniforms_subresource); // Asteroids rendering in parallel or in main thread if (m_is_parallel_rendering_enabled) diff --git a/App/AsteroidsApp.h b/App/AsteroidsApp.h index 1b24e57..9d49e20 100644 --- a/App/AsteroidsApp.h +++ b/App/AsteroidsApp.h @@ -108,8 +108,8 @@ class AsteroidsApp final uint32_t m_asteroids_complexity = 0U; bool m_is_parallel_rendering_enabled = true; hlslpp::SceneUniforms m_scene_uniforms{ }; - rhi::SubResources m_scene_uniforms_subresources{ - { reinterpret_cast(&m_scene_uniforms), sizeof(hlslpp::SceneUniforms) } // NOSONAR + rhi::SubResource m_scene_uniforms_subresource{ + reinterpret_cast(&m_scene_uniforms), sizeof(hlslpp::SceneUniforms) }; rhi::RenderPattern m_asteroids_render_pattern; diff --git a/CMakeLists.txt b/CMakeLists.txt index ed0d2a6..e7817f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ -cmake_minimum_required(VERSION 3.18.0) +cmake_minimum_required(VERSION 3.21.0) # Methane version, build & product info set(ASTEROIDS_VERSION_MAJOR 0 CACHE STRING "Asteroids major version") set(ASTEROIDS_VERSION_MINOR 7 CACHE STRING "Asteroids minor version") -set(ASTEROIDS_VERSION_PATCH 1 CACHE STRING "Asteroids patch version") +set(ASTEROIDS_VERSION_PATCH 2 CACHE STRING "Asteroids patch version") set(ASTEROIDS_VERSION_BUILD 0 CACHE STRING "Asteroids build version") project(METHANE_ASTEROIDS diff --git a/Externals/CPM.cmake b/Externals/CPM.cmake index bf701b8..241322b 100644 --- a/Externals/CPM.cmake +++ b/Externals/CPM.cmake @@ -1,4 +1,4 @@ -set(CPM_DOWNLOAD_VERSION 0.37.0) +set(CPM_DOWNLOAD_VERSION 0.38.1) if(CPM_SOURCE_CACHE) set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") diff --git a/Modules/Simulation/Asteroid.cpp b/Modules/Simulation/Asteroid.cpp index 0fbe1d6..bd3051f 100644 --- a/Modules/Simulation/Asteroid.cpp +++ b/Modules/Simulation/Asteroid.cpp @@ -123,7 +123,7 @@ rhi::Texture Asteroid::GenerateTextureArray(const rhi::RenderContext& render_con const rhi::SubResources sub_resources = GenerateTextureArraySubResources(dimensions, array_size, noise_parameters); rhi::Texture texture_array = render_context.CreateTexture( rhi::TextureSettings::ForImage(dimensions, array_size, gfx::PixelFormat::RGBA8Unorm, mipmapped)); - texture_array.SetData(sub_resources, render_cmd_queue); + texture_array.SetData(render_cmd_queue, sub_resources); return texture_array; } diff --git a/Modules/Simulation/AsteroidsArray.cpp b/Modules/Simulation/AsteroidsArray.cpp index a5fc17f..7ad6348 100644 --- a/Modules/Simulation/AsteroidsArray.cpp +++ b/Modules/Simulation/AsteroidsArray.cpp @@ -278,7 +278,7 @@ AsteroidsArray::AsteroidsArray(const rhi::CommandQueue& render_cmd_queue, rhi::TextureSettings::ForImage(m_settings.texture_dimensions, static_cast(texture_subresources.size()), gfx::PixelFormat::RGBA8Unorm, true))); - m_unique_textures.back().SetData(texture_subresources, m_render_cmd_queue); + m_unique_textures.back().SetData(m_render_cmd_queue, texture_subresources); m_unique_textures.back().SetName(fmt::format("Asteroid Texture {:d}", texture_index)); texture_index++; } @@ -381,7 +381,7 @@ void AsteroidsArray::Draw(const rhi::RenderCommandList& cmd_list, // Upload uniforms buffer data to GPU asynchronously while encoding drawing commands on CPU auto uniforms_update_future = std::async([this, &buffer_bindings]() { - buffer_bindings.uniforms_buffer.SetData(GetFinalPassUniformsSubresources(), m_render_cmd_queue); + buffer_bindings.uniforms_buffer.SetData(m_render_cmd_queue, GetFinalPassUniformsSubresource()); }); META_DEBUG_GROUP_VAR(s_debug_group, "Asteroids rendering"); @@ -412,7 +412,7 @@ void AsteroidsArray::DrawParallel(const rhi::ParallelRenderCommandList& parallel // Upload uniforms buffer data to GPU asynchronously while encoding drawing commands on CPU auto uniforms_update_future = std::async([this, &buffer_bindings]() { - buffer_bindings.uniforms_buffer.SetData(GetFinalPassUniformsSubresources(), m_render_cmd_queue); + buffer_bindings.uniforms_buffer.SetData(m_render_cmd_queue, GetFinalPassUniformsSubresource()); }); META_DEBUG_GROUP_VAR(s_debug_group, "Parallel Asteroids rendering"); diff --git a/Modules/Simulation/Planet.cpp b/Modules/Simulation/Planet.cpp index d3d580a..3abe262 100644 --- a/Modules/Simulation/Planet.cpp +++ b/Modules/Simulation/Planet.cpp @@ -133,7 +133,7 @@ void Planet::Draw(const rhi::RenderCommandList& cmd_list, { META_FUNCTION_TASK(); META_CHECK_ARG_GREATER_OR_EQUAL(buffer_bindings.uniforms_buffer.GetDataSize(), sizeof(hlslpp::PlanetUniforms)); - buffer_bindings.uniforms_buffer.SetData(m_mesh_buffers.GetFinalPassUniformsSubresources(), m_render_cmd_queue); + buffer_bindings.uniforms_buffer.SetData(m_render_cmd_queue, m_mesh_buffers.GetFinalPassUniformsSubresource()); META_DEBUG_GROUP_VAR(s_debug_group, "Planet Rendering"); cmd_list.ResetWithState(m_render_state, &s_debug_group); From 13f62e4618ad070b454b84581403d37172ecca2b Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Wed, 31 May 2023 23:07:19 +0300 Subject: [PATCH 02/12] Use FastNoise2 library (SSE-accelerated) instead of PerlinNoise library (scalar math) --- Externals/CMakeLists.txt | 2 +- Externals/FastNoise2.cmake | 8 +++++++ Externals/PerlinNoise.cmake | 5 ---- Modules/PerlinNoise/CMakeLists.txt | 2 +- Modules/PerlinNoise/PerlinNoise.cpp | 36 ++++++++++++++++++----------- Modules/PerlinNoise/PerlinNoise.h | 13 ++++++++--- 6 files changed, 42 insertions(+), 24 deletions(-) create mode 100644 Externals/FastNoise2.cmake delete mode 100644 Externals/PerlinNoise.cmake diff --git a/Externals/CMakeLists.txt b/Externals/CMakeLists.txt index 676cec7..6e36d26 100644 --- a/Externals/CMakeLists.txt +++ b/Externals/CMakeLists.txt @@ -7,6 +7,6 @@ include(CMRC) # C++ libraries # Keep MethaneKit first to include MethaneBuildOptions.cmake as early as possible include(MethaneKit) # keep 1-st -include(PerlinNoise) +include(FastNoise2) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE) \ No newline at end of file diff --git a/Externals/FastNoise2.cmake b/Externals/FastNoise2.cmake new file mode 100644 index 0000000..3a8e44e --- /dev/null +++ b/Externals/FastNoise2.cmake @@ -0,0 +1,8 @@ +CPMAddPackage( + NAME FastNoise2 + GITHUB_REPOSITORY MethanePowered/FastNoise2 + VERSION 0.10.0-alpha + OPTIONS + "FASTNOISE2_NOISETOOL OFF" + "FASTNOISE2_TESTS OFF" +) \ No newline at end of file diff --git a/Externals/PerlinNoise.cmake b/Externals/PerlinNoise.cmake deleted file mode 100644 index 5252a0d..0000000 --- a/Externals/PerlinNoise.cmake +++ /dev/null @@ -1,5 +0,0 @@ -CPMAddPackage( - NAME PerlinNoise - GITHUB_REPOSITORY MethanePowered/PerlinNoise - VERSION 1.0 -) diff --git a/Modules/PerlinNoise/CMakeLists.txt b/Modules/PerlinNoise/CMakeLists.txt index 8ccff97..59d82c2 100644 --- a/Modules/PerlinNoise/CMakeLists.txt +++ b/Modules/PerlinNoise/CMakeLists.txt @@ -16,7 +16,7 @@ target_link_libraries(${TARGET} MethaneInstrumentation PRIVATE MethaneBuildOptions - PerlinNoise + FastNoise2 ) set_target_properties(${TARGET} diff --git a/Modules/PerlinNoise/PerlinNoise.cpp b/Modules/PerlinNoise/PerlinNoise.cpp index fce2c4c..6ed0072 100644 --- a/Modules/PerlinNoise/PerlinNoise.cpp +++ b/Modules/PerlinNoise/PerlinNoise.cpp @@ -1,6 +1,6 @@ /****************************************************************************** -Copyright 2019-2020 Evgeny Gorodetskiy +Copyright 2019-2023 Evgeny Gorodetskiy Licensed under the Apache License, Version 2.0 (the "License"), you may not use this file except in compliance with the License. @@ -16,35 +16,35 @@ limitations under the License. ******************************************************************************* -FILE: Methane/Graphics/Noise.cpp +FILE: PerlinNoise.cpp Multi-octave simplex noise generator in range [0, 1] ******************************************************************************/ #include "PerlinNoise.h" - #include -#include -#include +#include +#include namespace Methane::Graphics { template -float GetPerlinNoise(const VectorType& pos) noexcept; +float GetPerlinNoise(const FastNoise::Simplex& simplex_noise, const VectorType& pos, int seed) noexcept; -template<> float GetPerlinNoise(const hlslpp::float2& pos) noexcept { return SimplexNoise1234::noise(pos.x, pos.y); } -template<> float GetPerlinNoise(const hlslpp::float3& pos) noexcept { return SimplexNoise1234::noise(pos.x, pos.y, pos.z); } -template<> float GetPerlinNoise(const hlslpp::float4& pos) noexcept { return SimplexNoise1234::noise(pos.x, pos.y, pos.z, pos.w); } +template<> float GetPerlinNoise(const FastNoise::Simplex& simplex_noise, const hlslpp::float2& pos, int seed) noexcept { return simplex_noise.GenSingle2D(pos.x, pos.y, seed); } +template<> float GetPerlinNoise(const FastNoise::Simplex& simplex_noise, const hlslpp::float3& pos, int seed) noexcept { return simplex_noise.GenSingle3D(pos.x, pos.y, pos.z, seed); } +template<> float GetPerlinNoise(const FastNoise::Simplex& simplex_noise, const hlslpp::float4& pos, int seed) noexcept { return simplex_noise.GenSingle4D(pos.x, pos.y, pos.z, pos.w, seed); } -template<> float GetPerlinNoise(const Data::RawVector2F& pos) noexcept { return SimplexNoise1234::noise(pos[0], pos[1]); } -template<> float GetPerlinNoise(const Data::RawVector3F& pos) noexcept { return SimplexNoise1234::noise(pos[0], pos[1], pos[2]); } -template<> float GetPerlinNoise(const Data::RawVector4F& pos) noexcept { return SimplexNoise1234::noise(pos[0], pos[1], pos[2], pos[3]); } +template<> float GetPerlinNoise(const FastNoise::Simplex& simplex_noise, const Data::RawVector2F& pos, int seed) noexcept { return simplex_noise.GenSingle2D(pos[0], pos[1], seed); } +template<> float GetPerlinNoise(const FastNoise::Simplex& simplex_noise, const Data::RawVector3F& pos, int seed) noexcept { return simplex_noise.GenSingle3D(pos[0], pos[1], pos[2], seed); } +template<> float GetPerlinNoise(const FastNoise::Simplex& simplex_noise, const Data::RawVector4F& pos, int seed) noexcept { return simplex_noise.GenSingle4D(pos[0], pos[1], pos[2], pos[3], seed); } -PerlinNoise::PerlinNoise(float persistence, size_t octaves_count) +PerlinNoise::PerlinNoise(float persistence, size_t octaves_count, int seed) : m_weights(GetWeights(persistence, octaves_count)) , m_norm_multiplier(0.5F / GetWeightsSum(m_weights)) + , m_seed(seed) { META_FUNCTION_TASK(); } @@ -61,10 +61,11 @@ template float PerlinNoise::GetValue(VectorType pos) const noexcept { META_FUNCTION_TASK(); + const FastNoise::Simplex& simplex_noise = GetSimplexNoise(); float noise = 0.F; for (const float weight : m_weights) { - noise += weight * GetPerlinNoise(pos); + noise += weight * GetPerlinNoise(simplex_noise, pos, m_seed); pos *= 2.F; } return noise * m_norm_multiplier + 0.5F; @@ -94,4 +95,11 @@ float PerlinNoise::GetWeightsSum(const PerlinNoise::Weights& weights) noexcept return weights_sum; } +const FastNoise::Simplex& PerlinNoise::GetSimplexNoise() const +{ + META_FUNCTION_TASK(); + static const auto s_simplex_noise_ptr = FastNoise::New(); + return *s_simplex_noise_ptr; +} + } // namespace Methane::Graphics diff --git a/Modules/PerlinNoise/PerlinNoise.h b/Modules/PerlinNoise/PerlinNoise.h index 719bea0..8b3275c 100644 --- a/Modules/PerlinNoise/PerlinNoise.h +++ b/Modules/PerlinNoise/PerlinNoise.h @@ -1,6 +1,6 @@ /****************************************************************************** -Copyright 2019-2020 Evgeny Gorodetskiy +Copyright 2019-2023 Evgeny Gorodetskiy Licensed under the Apache License, Version 2.0 (the "License"), you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ limitations under the License. ******************************************************************************* -FILE: Methane/Graphics/Noise.h +FILE: PerlinNoise.h Multi-octave simplex noise generator in range [0, 1] ******************************************************************************/ @@ -28,13 +28,18 @@ Multi-octave simplex noise generator in range [0, 1] #include +namespace FastNoise +{ + class Simplex; +} + namespace Methane::Graphics { class PerlinNoise { public: - explicit PerlinNoise(float persistence = 0.5F, size_t octaves_count = 4); + explicit PerlinNoise(float persistence = 0.5F, size_t octaves_count = 4, int seed = 1234); [[nodiscard]] float operator()(const hlslpp::float2& pos) const noexcept; [[nodiscard]] float operator()(const hlslpp::float3& pos) const noexcept; @@ -51,9 +56,11 @@ class PerlinNoise [[nodiscard]] float GetValue(VectorType v) const noexcept; [[nodiscard]] static Weights GetWeights(float persistence, size_t octaves_count) noexcept; [[nodiscard]] static float GetWeightsSum(const PerlinNoise::Weights& weights) noexcept; + [[nodiscard]] const FastNoise::Simplex& GetSimplexNoise() const; const Weights m_weights; const float m_norm_multiplier; + const int m_seed; }; } // namespace Methane::Graphics From 3ea16fa5fc94179ea5e2b6ade7e25ea6992b7615 Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Wed, 31 May 2023 23:23:45 +0300 Subject: [PATCH 03/12] Bump workflow build version to v0.7.2 --- .github/workflows/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 774975c..b2111b4 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -29,9 +29,9 @@ on: env: product_ver_major: 0 product_ver_minor: 7 - product_ver_patch: 1 + product_ver_patch: 2 product_ver_build: ${{ github.run_number }} - tracy_release_version: "0.9" + tracy_release_version: "0.9.1" jobs: build-asteroids: From 48e80c4dbc48e5a0403e8e0e93cd92b1481ac083 Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Wed, 31 May 2023 23:49:20 +0300 Subject: [PATCH 04/12] Update iOS deployment target, Build scripts and ReadMe --- Build/README.md | 6 +++--- Build/Unix/Build.sh | 6 ++++-- Build/Windows/Build.bat | 4 +++- CMakePresets.json | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Build/README.md b/Build/README.md index 149c2ac..26221ce 100644 --- a/Build/README.md +++ b/Build/README.md @@ -31,8 +31,8 @@ sudo apt-get update && sudo apt-get install build-essential git cmake lcov xcb libx11-dev libx11-xcb-dev libxcb-sync-dev libxcb-randr0-dev ``` - **MacOS** - - MacOS 10.15 "Catalina" or later - - XCode 11 or later with command-line tools + - MacOS 13 "Ventura" or later + - XCode 14 or later with command-line tools - **iOS / tvOS** - All MacOS prerequisites from above - iOS or tvOS simulator for running app in virtual environment @@ -152,7 +152,7 @@ Start Terminal, go to `MethaneAsteroids` root directory, generate XCode workspac ```console OUTPUT_DIR=Build/Output/XCode/iOS -cmake -S . -B $OUTPUT_DIR/Build -G Xcode -DCMAKE_TOOLCHAIN_FILE="Externals/iOS-Toolchain.cmake" -DPLATFORM=[SIMULATORARM64|OS64|SIMULATOR_TVOS|TVOS] -DDEPLOYMENT_TARGET=15.0 -DENABLE_ARC:BOOL=ON [-DAPPLE_DEVELOPMENT_TEAM=12345X6ABC] -DCMAKE_INSTALL_PREFIX="$(pwd)/$OUTPUT_DIR/Install" +cmake -S . -B $OUTPUT_DIR/Build -G Xcode -DCMAKE_TOOLCHAIN_FILE="Externals/iOS-Toolchain.cmake" -DPLATFORM=[SIMULATORARM64|OS64|SIMULATOR_TVOS|TVOS] -DDEPLOYMENT_TARGET=16.0 -DENABLE_ARC:BOOL=ON [-DAPPLE_DEVELOPMENT_TEAM=12345X6ABC] -DCMAKE_INSTALL_PREFIX="$(pwd)/$OUTPUT_DIR/Install" cmake --build $OUTPUT_DIR/Build --config Release --target install -- -allowProvisioningUpdates ``` diff --git a/Build/Unix/Build.sh b/Build/Unix/Build.sh index 6d5cd89..5d4cb73 100755 --- a/Build/Unix/Build.sh +++ b/Build/Unix/Build.sh @@ -9,12 +9,13 @@ BUILD_VERSION_MAJOR=0 BUILD_VERSION_MINOR=7 -BUILD_VERSION=$BUILD_VERSION_MAJOR.$BUILD_VERSION_MINOR +BUILD_VERSION_PATCH=2 +BUILD_VERSION=$BUILD_VERSION_MAJOR.$BUILD_VERSION_MINOR.$BUILD_VERSION_PATCH SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd ) SOURCE_DIR=$SCRIPT_DIR/../.. OUTPUT_DIR=$SCRIPT_DIR/../Output -APPLE_DEPLOYMENT_TARGET="15.0" +APPLE_DEPLOYMENT_TARGET="16.0" # Parse command line arguments while [ $# -ne 0 ] @@ -124,6 +125,7 @@ fi CMAKE_FLAGS="$CMAKE_FLAGS \ -DMETHANE_VERSION_MAJOR=$BUILD_VERSION_MAJOR \ -DMETHANE_VERSION_MINOR=$BUILD_VERSION_MINOR \ + -DMETHANE_VERSION_PATCH=$BUILD_VERSION_PATCH \ -DMETHANE_GFX_VULKAN_ENABLED:BOOL=$VULKAN_BUILD_FLAG \ -DMETHANE_SHADERS_CODEVIEW_ENABLED:BOOL=ON \ -DMETHANE_RHI_PIMPL_INLINE_ENABLED:BOOL=ON \ diff --git a/Build/Windows/Build.bat b/Build/Windows/Build.bat index fba5446..0e65224 100644 --- a/Build/Windows/Build.bat +++ b/Build/Windows/Build.bat @@ -9,7 +9,8 @@ SETLOCAL ENABLEDELAYEDEXPANSION SET BUILD_VERSION_MAJOR=0 SET BUILD_VERSION_MINOR=7 -SET BUILD_VERSION=%BUILD_VERSION_MAJOR%.%BUILD_VERSION_MINOR% +SET BUILD_VERSION_PATCH=2 +SET BUILD_VERSION=%BUILD_VERSION_MAJOR%.%BUILD_VERSION_MINOR%.%BUILD_VERSION_PATCH% SET OUTPUT_DIR=%~dp0..\Output SET SOURCE_DIR=%~dp0..\.. @@ -71,6 +72,7 @@ SET CMAKE_FLAGS= ^ -A %ARCH_TYPE% ^ -DASTEROIDS_VERSION_MAJOR=%BUILD_VERSION_MAJOR% ^ -DASTEROIDS_VERSION_MINOR=%BUILD_VERSION_MINOR% ^ + -DASTEROIDS_VERSION_PATCH=%BUILD_VERSION_PATCH% ^ -DMETHANE_GFX_VULKAN_ENABLED:BOOL=%VULKAN_API_ENABLED% ^ -DMETHANE_SHADERS_CODEVIEW_ENABLED:BOOL=ON ^ -DMETHANE_RHI_PIMPL_INLINE_ENABLED:BOOL=ON ^ diff --git a/CMakePresets.json b/CMakePresets.json index 16d3b20..46a8050 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -786,7 +786,7 @@ }, "DEPLOYMENT_TARGET": { "type": "STRING", - "value": "15.0" + "value": "16.0" }, "ENABLE_ARC": { "type": "BOOL", From 3043c12e316e57def97fdc47dd263f91b626e84d Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Thu, 1 Jun 2023 00:03:12 +0300 Subject: [PATCH 05/12] Try to enforce ARM/NEON build for APPLE even on Intel-x64 builders --- Externals/FastNoise2.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Externals/FastNoise2.cmake b/Externals/FastNoise2.cmake index 3a8e44e..b0fc9fb 100644 --- a/Externals/FastNoise2.cmake +++ b/Externals/FastNoise2.cmake @@ -1,3 +1,9 @@ +if (APPLE) + set(FASTSIMD_COMPILE_AARCH64 true) + set(FASTSIMD_COMPILE_ARM true) + set(FASTSIMD_COMPILE_HAVE_NEON true) +endif() + CPMAddPackage( NAME FastNoise2 GITHUB_REPOSITORY MethanePowered/FastNoise2 From 98919c76d3d56610281c274fe808ca6262460885 Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Thu, 1 Jun 2023 22:00:44 +0300 Subject: [PATCH 06/12] Try to fix FastNoise build by disabling x86_64 architecture on MacOS --- CMakePresets.json | 2 +- Externals/FastNoise2.cmake | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 46a8050..3900c04 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -253,7 +253,7 @@ "inherits": "Ninja-Default", "hidden": true, "cacheVariables": { - "CMAKE_OSX_ARCHITECTURES": "arm64;x86_64", + "CMAKE_OSX_ARCHITECTURES": "arm64", "METHANE_PRECOMPILED_HEADERS_ENABLED": { "type": "BOOL", "value": "OFF" diff --git a/Externals/FastNoise2.cmake b/Externals/FastNoise2.cmake index b0fc9fb..3a8e44e 100644 --- a/Externals/FastNoise2.cmake +++ b/Externals/FastNoise2.cmake @@ -1,9 +1,3 @@ -if (APPLE) - set(FASTSIMD_COMPILE_AARCH64 true) - set(FASTSIMD_COMPILE_ARM true) - set(FASTSIMD_COMPILE_HAVE_NEON true) -endif() - CPMAddPackage( NAME FastNoise2 GITHUB_REPOSITORY MethanePowered/FastNoise2 From 390183819a0f10da7d1b48ee6720090270150007 Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Thu, 1 Jun 2023 22:34:30 +0300 Subject: [PATCH 07/12] Fix MacOS build --- CMakePresets.json | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakePresets.json b/CMakePresets.json index 3900c04..db40470 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -254,6 +254,7 @@ "hidden": true, "cacheVariables": { "CMAKE_OSX_ARCHITECTURES": "arm64", + "CMAKE_SYSTEM_PROCESSOR": "aarch64", "METHANE_PRECOMPILED_HEADERS_ENABLED": { "type": "BOOL", "value": "OFF" From 20d9301792c55624a3f91194ec856d7922284a3a Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Thu, 1 Jun 2023 23:21:11 +0300 Subject: [PATCH 08/12] Use toolchain platform MAC_ARM64 for MacOS builds --- CMakePresets.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index db40470..4e23c5a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -253,11 +253,17 @@ "inherits": "Ninja-Default", "hidden": true, "cacheVariables": { - "CMAKE_OSX_ARCHITECTURES": "arm64", - "CMAKE_SYSTEM_PROCESSOR": "aarch64", "METHANE_PRECOMPILED_HEADERS_ENABLED": { "type": "BOOL", "value": "OFF" + }, + "CMAKE_TOOLCHAIN_FILE": { + "type": "STRING", + "value": "Externals/iOS-Toolchain.cmake" + }, + "PLATFORM": { + "type": "STRING", + "value": "MAC_ARM64" } }, "condition": { @@ -777,10 +783,6 @@ "Xcode-Mac-MTL-Default" ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": { - "type": "STRING", - "value": "Externals/iOS-Toolchain.cmake" - }, "PLATFORM": { "type": "STRING", "value": "SIMULATORARM64" From 4f16fd80bd211ecbbb2e1387156d468bdfebb6dd Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Fri, 2 Jun 2023 22:00:35 +0300 Subject: [PATCH 09/12] Split MacOS Arm64 and x86-64 builds in CMakePresets and CI, remove Scan builds from CMakePresets --- .github/workflows/ci-build.yml | 26 +- Build/README.md | 6 +- Build/Unix/Build.sh | 54 ++-- CMakePresets.json | 462 +++++++++------------------------ 4 files changed, 183 insertions(+), 365 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index b2111b4..e3d0fcf 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -113,16 +113,30 @@ jobs: - os: macos-latest os_name: MacOS - name: "MacOS_MTL_Release" - config_preset: "Xcode-Mac-MTL-Default" - build_preset: "Xcode-Mac-MTL-Release" + name: "MacOS_Arm64_MTL_Release" + config_preset: "Xcode-Mac-Arm64-MTL-Default" + build_preset: "Xcode-Mac-Arm64-MTL-Release" add_tracy_app: false - os: macos-latest os_name: MacOS - name: "MacOS_MTL_Profile" - config_preset: "Xcode-Mac-MTL-Profile" - build_preset: "Xcode-Mac-MTL-Profile" + name: "MacOS_Arm64_MTL_Profile" + config_preset: "Xcode-Mac-Arm64-MTL-Profile" + build_preset: "Xcode-Mac-Arm64-MTL-Profile" + add_tracy_app: true + + - os: macos-latest + os_name: MacOS + name: "MacOS_x86-64_MTL_Release" + config_preset: "Xcode-Mac-x86-64-MTL-Default" + build_preset: "Xcode-Mac-x86-64-MTL-Release" + add_tracy_app: false + + - os: macos-latest + os_name: MacOS + name: "MacOS_x86-64_MTL_Profile" + config_preset: "Xcode-Mac-x86-64-MTL-Profile" + build_preset: "Xcode-Mac-x86-64-MTL-Profile" add_tracy_app: true - os: macos-latest diff --git a/Build/README.md b/Build/README.md index 26221ce..ba11514 100644 --- a/Build/README.md +++ b/Build/README.md @@ -122,13 +122,13 @@ Start Terminal, go to `MethaneAsteroids` root directory, generate XCode workspac ```console OUTPUT_DIR=Build/Output/XCode/macOS -cmake -S . -B $OUTPUT_DIR/Build -G Xcode -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_INSTALL_PREFIX="$(pwd)/$OUTPUT_DIR/Install" +cmake -S . -B $OUTPUT_DIR/Build -G Xcode -DCMAKE_OSX_ARCHITECTURES="[arm64|x86_64]" -DCMAKE_INSTALL_PREFIX="$(pwd)/$OUTPUT_DIR/Install" cmake --build $OUTPUT_DIR/Build --config Release --target install ``` Note that starting with XCode 12 and Clang 12 build architectures have to be specified explicitly -using CMake generator command line option `-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"` to build the fat binary. -This option should be omitted with earlier versions of Clang on macOS. +using CMake generator command line option `-DCMAKE_OSX_ARCHITECTURES="[arm64|x86_64]"` (multiple architecture are not supported by Asteroids sample) +to build the fat binary. This option should be omitted with earlier versions of Clang on macOS. Auxiliary build script [Build/Unix/Build.sh](/Build/Unix/Build.sh) can make it more simple for you: diff --git a/Build/Unix/Build.sh b/Build/Unix/Build.sh index 5d4cb73..3b5397e 100755 --- a/Build/Unix/Build.sh +++ b/Build/Unix/Build.sh @@ -15,7 +15,7 @@ BUILD_VERSION=$BUILD_VERSION_MAJOR.$BUILD_VERSION_MINOR.$BUILD_VERSION_PATCH SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd ) SOURCE_DIR=$SCRIPT_DIR/../.. OUTPUT_DIR=$SCRIPT_DIR/../Output -APPLE_DEPLOYMENT_TARGET="16.0" +PRECOMPILED_HEADERS_ENABLED="ON" # Parse command line arguments while [ $# -ne 0 ] @@ -55,7 +55,7 @@ done # Choose CMake generator depending on operating system ARCH_NAME="$(uname -m)" OS_NAME="$(uname -s)" -case "${OS_NAME}" in +case "$OS_NAME" in Linux*) CMAKE_GENERATOR=Unix\ Makefiles PLATFORM_NAME=Linux @@ -63,28 +63,40 @@ case "${OS_NAME}" in Darwin*) CMAKE_GENERATOR=Xcode PLATFORM_NAME=MacOS - if [ "$APPLE_PLATFORM" != "" ]; then - # Disable tests cause unbundled console executables can not be built with iOS toolchain - TESTS_BUILD_ENABLED="OFF" - CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/Externals/iOS-Toolchain.cmake \ - -DPLATFORM=$APPLE_PLATFORM \ - -DDEPLOYMENT_TARGET=$APPLE_DEPLOYMENT_TARGET \ - -DENABLE_ARC:BOOL=ON \ - -DENABLE_VISIBILITY:BOOL=ON \ - -DENABLE_BITCODE:BOOL=OFF \ - -DENABLE_STRICT_TRY_COMPILE:BOOL=OFF" - if [ "$APPLE_DEVELOPMENT_TEAM" != "" ]; then - CMAKE_FLAGS="$CMAKE_FLAGS \ - -DAPPLE_DEVELOPMENT_TEAM=${APPLE_DEVELOPMENT_TEAM}" - CMAKE_BUID_OPTIONS="-- -allowProvisioningUpdates" + PRECOMPILED_HEADERS_ENABLED="OFF" + if [ "$APPLE_PLATFORM" == "" ]; then + case "$ARCH_NAME" in + arm64*) + APPLE_PLATFORM=MAC_ARM64 + ;; + *) + APPLE_PLATFORM=MAC + ;; + esac + fi + if [ "$APPLE_DEPLOYMENT_TARGET" == "" ]; then + if [[ "$APPLE_PLATFORM" =~ ^MAC.*$ ]]; then + APPLE_DEPLOYMENT_TARGET="13.0" + else + APPLE_DEPLOYMENT_TARGET="16.0" fi - else - APPLE_PLATFORM=MacOS_$ARCH_NAME + fi + CMAKE_FLAGS="-DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/Externals/iOS-Toolchain.cmake \ + -DPLATFORM=$APPLE_PLATFORM \ + -DDEPLOYMENT_TARGET=$APPLE_DEPLOYMENT_TARGET \ + -DENABLE_ARC:BOOL=ON \ + -DENABLE_VISIBILITY:BOOL=ON \ + -DENABLE_BITCODE:BOOL=OFF \ + -DENABLE_STRICT_TRY_COMPILE:BOOL=OFF" + if [ "$APPLE_DEVELOPMENT_TEAM" != "" ]; then + CMAKE_FLAGS="$CMAKE_FLAGS \ + -DAPPLE_DEVELOPMENT_TEAM=${APPLE_DEVELOPMENT_TEAM}" + CMAKE_BUID_OPTIONS="-- -allowProvisioningUpdates" fi ;; *) - echo "Unsupported operating system!" 1>&2 && exit 1 - ;; + echo "Unsupported operating system!" 1>&2 && exit 1 + ;; esac if [ "$IS_DEBUG_BUILD" == true ]; then @@ -129,7 +141,7 @@ CMAKE_FLAGS="$CMAKE_FLAGS \ -DMETHANE_GFX_VULKAN_ENABLED:BOOL=$VULKAN_BUILD_FLAG \ -DMETHANE_SHADERS_CODEVIEW_ENABLED:BOOL=ON \ -DMETHANE_RHI_PIMPL_INLINE_ENABLED:BOOL=ON \ - -DMETHANE_PRECOMPILED_HEADERS_ENABLED:BOOL=ON \ + -DMETHANE_PRECOMPILED_HEADERS_ENABLED:BOOL=$PRECOMPILED_HEADERS_ENABLED \ -DMETHANE_RUN_TESTS_DURING_BUILD:BOOL=OFF \ -DMETHANE_COMMAND_DEBUG_GROUPS_ENABLED:BOOL=ON \ -DMETHANE_LOGGING_ENABLED:BOOL=OFF \ diff --git a/CMakePresets.json b/CMakePresets.json index 4e23c5a..f6076a0 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -146,40 +146,6 @@ } } }, - { - "name": "Ninja-Scan", - "description": "Static scanning Ninja Multi configuration for builds under Sonar Cloud code analyzer", - "inherits": "Ninja-Default", - "generator": "Ninja", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "METHANE_RHI_PIMPL_INLINE_ENABLED": { - "type": "BOOL", - "value": "OFF" - }, - "METHANE_PRECOMPILED_HEADERS_ENABLED": { - "type": "BOOL", - "value": "OFF" - }, - "METHANE_CODE_COVERAGE_ENABLED": { - "type": "BOOL", - "value": "ON" - }, - "METHANE_ITT_INSTRUMENTATION_ENABLED": { - "type": "BOOL", - "value": "OFF" - }, - "METHANE_UNITY_BUILD_ENABLED": { - "type": "BOOL", - "value": "OFF" - }, - "CMAKE_EXPORT_COMPILE_COMMANDS": { - "type": "BOOL", - "value": "ON" - } - } - }, { "name": "Ninja-Default-Vulkan", @@ -203,17 +169,6 @@ } } }, - { - "name": "Ninja-Scan-Vulkan", - "inherits": "Ninja-Scan", - "hidden": true, - "cacheVariables": { - "METHANE_GFX_VULKAN_ENABLED": { - "type": "BOOL", - "value": "ON" - } - } - }, { "name": "Ninja-Win-Default", @@ -249,7 +204,7 @@ } }, { - "name": "Ninja-Mac-Default", + "name": "Ninja-Mac-Arm64-Default", "inherits": "Ninja-Default", "hidden": true, "cacheVariables": { @@ -264,6 +219,10 @@ "PLATFORM": { "type": "STRING", "value": "MAC_ARM64" + }, + "DEPLOYMENT_TARGET": { + "type": "STRING", + "value": "13.0" } }, "condition": { @@ -280,6 +239,17 @@ } } }, + { + "name": "Ninja-Mac-x86-64-Default", + "inherits": "Ninja-Mac-Arm64-Default", + "hidden": true, + "cacheVariables": { + "PLATFORM": { + "type": "STRING", + "value": "MAC" + } + } + }, { "name": "Ninja-Win-DX-Default", @@ -316,24 +286,6 @@ "Ninja-Win-Default" ] }, - { - "name": "Ninja-Win-DX-Scan", - "displayName": "Scan - Ninja Multi-Config - Windows (DirectX)", - "description": "Scanning configuration using Ninja Multi-Config generator for Windows (DirectX)", - "inherits": [ - "Ninja-Scan", - "Ninja-Win-Default" - ] - }, - { - "name": "Ninja-Win-VK-Scan", - "displayName": "Scan - Ninja Multi-Config - Windows (Vulkan)", - "description": "Scanning configuration using Ninja Multi-Config generator for Windows (Vulkan)", - "inherits": [ - "Ninja-Scan-Vulkan", - "Ninja-Win-Default" - ] - }, { "name": "VS2019-Win64-DX-Default", @@ -433,57 +385,6 @@ ] }, - { - "name": "VS2019-Win64-DX-Scan", - "displayName": "Scan - VS2019 - Windows x64 (DirectX)", - "description": "Scanning configuration using Visual Studio 2019 generator for Windows x64 (DirectX)", - "generator": "Visual Studio 16 2019", - "inherits": [ - "Ninja-Scan", - "VS2019-Win64-DX-Default" - ] - }, - { - "name": "VS2019-Win32-DX-Scan", - "displayName": "Scan - VS2019 - Windows x86 (DirectX)", - "description": "Scanning configuration using Visual Studio 2019 generator for Windows x86 (DirectX)", - "generator": "Visual Studio 16 2019", - "inherits": [ - "Ninja-Scan", - "VS2019-Win32-DX-Default" - ] - }, - { - "name": "VS2019-Win64-VK-Scan", - "displayName": "Scan - VS2019 - Windows x64 (Vulkan)", - "description": "Scanning configuration using Visual Studio 2019 generator for Windows x64 (Vulkan)", - "generator": "Visual Studio 16 2019", - "inherits": [ - "VS2019-Win64-DX-Scan" - ], - "cacheVariables": { - "METHANE_GFX_VULKAN_ENABLED": { - "type": "BOOL", - "value": "ON" - } - } - }, - { - "name": "VS2019-Win32-VK-Scan", - "displayName": "Scan - VS2019 - Windows x86 (Vulkan)", - "description": "Scanning configuration using Visual Studio 2019 generator for Windows x86 (Vulkan)", - "generator": "Visual Studio 16 2019", - "inherits": [ - "VS2019-Win32-DX-Scan" - ], - "cacheVariables": { - "METHANE_GFX_VULKAN_ENABLED": { - "type": "BOOL", - "value": "ON" - } - } - }, - { "name": "VS2022-Win64", "hidden": true, @@ -579,57 +480,6 @@ ] }, - { - "name": "VS2022-Win64-DX-Scan", - "displayName": "Scan - VS2022 - Windows x64 (DirectX)", - "description": "Scanning configuration using Visual Studio 2019 generator for Windows x64 (DirectX)", - "generator": "Visual Studio 17 2022", - "inherits": [ - "Ninja-Scan", - "VS2022-Win64-DX-Default" - ] - }, - { - "name": "VS2022-Win32-DX-Scan", - "displayName": "Scan - VS2022 - Windows x86 (DirectX)", - "description": "Scanning configuration using Visual Studio 2019 generator for Windows x86 (DirectX)", - "generator": "Visual Studio 17 2022", - "inherits": [ - "Ninja-Scan", - "VS2022-Win32-DX-Default" - ] - }, - { - "name": "VS2022-Win64-VK-Scan", - "displayName": "Scan - VS2022 - Windows x64 (Vulkan)", - "description": "Scanning configuration using Visual Studio 2019 generator for Windows x64 (Vulkan)", - "generator": "Visual Studio 17 2022", - "inherits": [ - "VS2022-Win64-DX-Scan" - ], - "cacheVariables": { - "METHANE_GFX_VULKAN_ENABLED": { - "type": "BOOL", - "value": "ON" - } - } - }, - { - "name": "VS2022-Win32-VK-Scan", - "displayName": "Scan - VS2022 - Windows x86 (Vulkan)", - "description": "Scanning configuration using Visual Studio 2019 generator for Windows x86 (Vulkan)", - "generator": "Visual Studio 17 2022", - "inherits": [ - "VS2022-Win32-DX-Scan" - ], - "cacheVariables": { - "METHANE_GFX_VULKAN_ENABLED": { - "type": "BOOL", - "value": "ON" - } - } - }, - { "name": "Ninja-Lin-VK-Default", "displayName": "Default - Ninja Multi-Config - Linux (Vulkan)", @@ -647,15 +497,6 @@ "Ninja-Lin-Default" ] }, - { - "name": "Ninja-Lin-VK-Scan", - "displayName": "Scan - Ninja Multi-Config - Linux (Vulkan)", - "description": "Scanning configuration using Ninja Multi-Config generator for Linux (Vulkan)", - "inherits": [ - "Ninja-Scan", - "Ninja-Lin-Default" - ] - }, { "name": "Make-Lin-VK-Release", @@ -693,35 +534,30 @@ "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, + { - "name": "Make-Lin-VK-Scan", - "displayName": "Scan - Unix Makefiles - Linux (Vulkan)", - "description": "Scanning configuration using Unix Makefiles generator for Linux (Vulkan)", - "generator": "Unix Makefiles", + "name": "Ninja-Mac-Arm64-MTL-Default", + "displayName": "Default - Ninja Multi-Config - MacOS Arm64 (Metal)", + "description": "Default configuration using Ninja Multi-Config generator for MacOS Arm64 (Metal)", "inherits": [ - "Ninja-Scan", - "Ninja-Lin-VK-Default" - ], - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } + "Ninja-Mac-Arm64-Default" + ] }, - { - "name": "Ninja-Mac-MTL-Default", - "displayName": "Default - Ninja Multi-Config - MacOS (Metal)", - "description": "Default configuration using Ninja Multi-Config generator for MacOS (Metal)", + "name": "Ninja-Mac-x86-64-MTL-Default", + "displayName": "Default - Ninja Multi-Config - MacOS x86_64 (Metal)", + "description": "Default configuration using Ninja Multi-Config generator for MacOS x86_64 (Metal)", "inherits": [ - "Ninja-Mac-Default" + "Ninja-Mac-x86-64-Default" ] }, { - "name": "Ninja-Mac-MTL-Profile", + "name": "Ninja-Mac-Arm64-MTL-Profile", "displayName": "Profile - Ninja Multi-Config - MacOS (Metal)", "description": "Profiling configuration using Ninja Multi-Config generator for MacOS (Metal)", "inherits": [ "Ninja-Profile", - "Ninja-Mac-Default" + "Ninja-Mac-Arm64-Default" ], "cacheVariables": { "METHANE_PRECOMPILED_HEADERS_ENABLED": { @@ -731,48 +567,56 @@ } }, { - "name": "Ninja-Mac-MTL-Scan", - "displayName": "Scan - Ninja Multi-Config - MacOS (Metal)", - "description": "Scanning configuration using Ninja Multi-Config generator for MacOS (Metal)", + "name": "Ninja-Mac-x86-64-MTL-Profile", + "displayName": "Profile - Ninja Multi-Config - MacOS x86_64 (Metal)", + "description": "Profiling configuration using Ninja Multi-Config generator for MacOS x86_64 (Metal)", "inherits": [ - "Ninja-Scan", - "Ninja-Mac-Default" - ] + "Ninja-Profile", + "Ninja-Mac-x86-64-Default" + ], + "cacheVariables": { + "METHANE_PRECOMPILED_HEADERS_ENABLED": { + "type": "BOOL", + "value": "OFF" + } + } }, { - "name": "Xcode-Mac-MTL-Default", - "displayName": "Default - Xcode - MacOS (Metal)", - "description": "Default configuration using Xcode generator for MacOS (Metal)", + "name": "Xcode-Mac-Arm64-MTL-Default", + "displayName": "Default - Xcode - MacOS Arm64 (Metal)", + "description": "Default configuration using Xcode generator for MacOS Arm64 (Metal)", "generator": "Xcode", "inherits": [ - "Ninja-Mac-MTL-Default" + "Ninja-Mac-Arm64-MTL-Default" ] }, { - "name": "Xcode-Mac-MTL-Profile", - "displayName": "Profile - Xcode - MacOS (Metal)", - "description": "Profiling configuration using Xcode generator for MacOS (Metal)", + "name": "Xcode-Mac-x86-64-MTL-Default", + "displayName": "Default - Xcode - MacOS x86_64 (Metal)", + "description": "Default configuration using Xcode generator for MacOS x86_64 (Metal)", "generator": "Xcode", "inherits": [ - "Ninja-Mac-MTL-Profile" + "Ninja-Mac-x86-64-MTL-Default" ] }, { - "name": "Xcode-Mac-MTL-Scan", - "displayName": "Scan - Xcode - MacOS (Metal)", - "description": "Scanning configuration using Xcode generator for MacOS (Metal)", + "name": "Xcode-Mac-Arm64-MTL-Profile", + "displayName": "Profile - Xcode - MacOS Arm64 (Metal)", + "description": "Profiling configuration using Xcode generator for MacOS Arm64 (Metal)", "generator": "Xcode", "inherits": [ - "Ninja-Scan", - "Ninja-Mac-Default" - ], - "cacheVariables": { - "METHANE_PRECOMPILED_HEADERS_ENABLED": { - "type": "BOOL", - "value": "OFF" - } - } + "Ninja-Mac-Arm64-MTL-Profile" + ] + }, + { + "name": "Xcode-Mac-x86-64-MTL-Profile", + "displayName": "Profile - Xcode - MacOS x86_64 (Metal)", + "description": "Profiling configuration using Xcode generator for MacOS x86_64 (Metal)", + "generator": "Xcode", + "inherits": [ + "Ninja-Mac-x86-64-MTL-Profile" + ] }, { @@ -780,7 +624,7 @@ "displayName": "Default - Xcode - iOS Simulator (Metal)", "description": "Default configuration using Xcode generator for iOS Simulator (Metal)", "inherits": [ - "Xcode-Mac-MTL-Default" + "Xcode-Mac-Arm64-MTL-Default" ], "cacheVariables": { "PLATFORM": { @@ -913,14 +757,6 @@ "configurePreset": "Ninja-Win-DX-Profile", "configuration": "RelWithDebInfo" }, - { - "name": "Ninja-Win-DX-Scan", - "displayName": "Scan - Ninja Multi-Config - Windows (DirectX)", - "description": "Scanning build with Ninja Multi-Config for Windows (DirectX)", - "inherits": [ "Windows-Build" ], - "configurePreset": "Ninja-Win-DX-Scan", - "configuration": "Debug" - }, { "name": "Ninja-Win-VK-Debug", @@ -946,14 +782,6 @@ "configurePreset": "Ninja-Win-VK-Profile", "configuration": "RelWithDebInfo" }, - { - "name": "Ninja-Win-VK-Scan", - "displayName": "Scan - Ninja Multi-Config - Windows (Vulkan)", - "description": "Scanning build with Ninja Multi-Config for Windows (Vulkan)", - "inherits": [ "Windows-Build" ], - "configurePreset": "Ninja-Win-VK-Scan", - "configuration": "Debug" - }, { "name": "VS2019-Win64-DX-Debug", @@ -1004,40 +832,6 @@ "configuration": "RelWithDebInfo" }, - { - "name": "VS2019-Win64-DX-Scan", - "displayName": "Scan - VS2019 - Windows x64 (DirectX)", - "description": "Scanning build with Visual Studio 2019 for Windows x64 (DirectX)", - "inherits": [ "Windows-Build" ], - "configurePreset": "VS2019-Win64-DX-Scan", - "configuration": "Debug" - }, - { - "name": "VS2019-Win32-DX-Scan", - "displayName": "Scan - VS2019 - Windows x86 (DirectX)", - "description": "Scanning build with Visual Studio 2019 for Windows x86 (DirectX)", - "inherits": [ "Windows-Build" ], - "configurePreset": "VS2019-Win32-DX-Scan", - "configuration": "Debug" - }, - - { - "name": "VS2022-Win64-DX-Scan", - "displayName": "Scan - VS2022 - Windows x64 (DirectX)", - "description": "Scanning build with Visual Studio 2022 for Windows x64 (DirectX)", - "inherits": [ "Windows-Build" ], - "configurePreset": "VS2022-Win64-DX-Scan", - "configuration": "Debug" - }, - { - "name": "VS2022-Win32-DX-Scan", - "displayName": "Scan - VS2022 - Windows x86 (DirectX)", - "description": "Scanning build with Visual Studio 2022 for Windows x86 (DirectX)", - "inherits": [ "Windows-Build" ], - "configurePreset": "VS2022-Win32-DX-Scan", - "configuration": "Debug" - }, - { "name": "VS2019-Win64-VK-Debug", "displayName": "Debug - VS2019 - Windows x64 (Vulkan)", @@ -1087,23 +881,6 @@ "configuration": "RelWithDebInfo" }, - { - "name": "VS2019-Win64-VK-Scan", - "displayName": "Scan - VS2019 - Windows x64 (Vulkan)", - "description": "Scanning build with Visual Studio 2019 for Windows x64 (Vulkan)", - "inherits": [ "Windows-Build" ], - "configurePreset": "VS2019-Win64-VK-Scan", - "configuration": "Debug" - }, - { - "name": "VS2019-Win32-VK-Scan", - "displayName": "Scan - VS2019 - Windows x86 (Vulkan)", - "description": "Scanning build with Visual Studio 2019 for Windows x86 (Vulkan)", - "inherits": [ "Windows-Build" ], - "configurePreset": "VS2019-Win32-VK-Scan", - "configuration": "Debug" - }, - { "name": "VS2022-Win64-DX-Debug", "displayName": "Debug - VS2022 - Windows x64 (DirectX)", @@ -1226,14 +1003,6 @@ "configurePreset": "Ninja-Lin-VK-Profile", "configuration": "RelWithDebInfo" }, - { - "name": "Ninja-Lin-VK-Scan", - "displayName": "Scan - Ninja Multi-Config - Linux (Vulkan)", - "description": "Scanning build with Ninja Multi-Config for Linux (Vulkan)", - "inherits": [ "Linux-Build" ], - "configurePreset": "Ninja-Lin-VK-Scan", - "configuration": "Debug" - }, { "name": "Make-Lin-VK-Debug", @@ -1258,78 +1027,101 @@ }, { - "name": "Make-Lin-VK-Scan", - "displayName": "Scan - Unix Makefiles - Linux (Vulkan)", - "description": "Scanning build with Unix Makefiles for Linux (Vulkan)", - "inherits": [ "Linux-Build" ], - "configurePreset": "Make-Lin-VK-Scan" + "name": "Ninja-Mac-Arm64-MTL-Debug", + "displayName": "Debug - Ninja Multi-Config - MacOS Arm64 (Metal)", + "description": "Debug build with Ninja Multi-Config for MacOS Arm64 (Metal)", + "inherits": [ "MacOS-Build" ], + "configurePreset": "Ninja-Mac-Arm64-MTL-Default", + "configuration": "Debug" }, - { - "name": "Ninja-Mac-MTL-Debug", - "displayName": "Debug - Ninja Multi-Config - MacOS (Metal)", - "description": "Debug build with Ninja Multi-Config for MacOS (Metal)", + "name": "Ninja-Mac-x86-64-MTL-Debug", + "displayName": "Debug - Ninja Multi-Config - MacOS x86_64 (Metal)", + "description": "Debug build with Ninja Multi-Config for MacOS x86_64 (Metal)", "inherits": [ "MacOS-Build" ], - "configurePreset": "Ninja-Mac-MTL-Default", + "configurePreset": "Ninja-Mac-x86-64-MTL-Default", "configuration": "Debug" }, { - "name": "Ninja-Mac-MTL-Release", - "displayName": "Release - Ninja Multi-Config - MacOS (Metal)", - "description": "Release build with Ninja Multi-Config for MacOS (Metal)", + "name": "Ninja-Mac-Arm64-MTL-Release", + "displayName": "Release - Ninja Multi-Config - MacOS Arm64 (Metal)", + "description": "Release build with Ninja Multi-Config for MacOS Arm64 (Metal)", "inherits": [ "MacOS-Build" ], - "configurePreset": "Ninja-Mac-MTL-Default", + "configurePreset": "Ninja-Mac-Arm64-MTL-Default", "configuration": "Release" }, { - "name": "Ninja-Mac-MTL-Profile", - "displayName": "Profile - Ninja Multi-Config - MacOS (Metal)", - "description": "Profiling build with Ninja Multi-Config for MacOS (Metal)", + "name": "Ninja-Mac-x86-64-MTL-Release", + "displayName": "Release - Ninja Multi-Config - MacOS x86_64 (Metal)", + "description": "Release build with Ninja Multi-Config for MacOS x86_64 (Metal)", "inherits": [ "MacOS-Build" ], - "configurePreset": "Ninja-Mac-MTL-Profile", + "configurePreset": "Ninja-Mac-x86-64-MTL-Default", + "configuration": "Release" + }, + { + "name": "Ninja-Mac-Arm64-MTL-Profile", + "displayName": "Profile - Ninja Multi-Config - MacOS Arm64 (Metal)", + "description": "Profiling build with Ninja Multi-Config for MacOS Arm64 (Metal)", + "inherits": [ "MacOS-Build" ], + "configurePreset": "Ninja-Mac-Arm64-MTL-Profile", "configuration": "RelWithDebInfo" }, { - "name": "Ninja-Mac-MTL-Scan", - "displayName": "Scan - Ninja Multi-Config - MacOS (Metal)", - "description": "Scanning build with Ninja Multi-Config for MacOS (Metal)", + "name": "Ninja-Mac-x86-64-MTL-Profile", + "displayName": "Profile - Ninja Multi-Config - MacOS x86_64 (Metal)", + "description": "Profiling build with Ninja Multi-Config for MacOS x86_64 (Metal)", "inherits": [ "MacOS-Build" ], - "configurePreset": "Ninja-Mac-MTL-Scan", - "configuration": "Debug" + "configurePreset": "Ninja-Mac-x86-64-MTL-Profile", + "configuration": "RelWithDebInfo" }, { - "name": "Xcode-Mac-MTL-Debug", - "displayName": "Debug - Xcode - MacOS (Metal)", - "description": "Debug build with Xcode for MacOS (Metal)", + "name": "Xcode-Mac-Arm64-MTL-Debug", + "displayName": "Debug - Xcode - MacOS Arm64 (Metal)", + "description": "Debug build with Xcode for MacOS Arm64 (Metal)", + "inherits": [ "MacOS-Build" ], + "configurePreset": "Xcode-Mac-Arm64-MTL-Default", + "configuration": "Debug" + }, + { + "name": "Xcode-Mac-x86-64-MTL-Debug", + "displayName": "Debug - Xcode - MacOS x86_64 (Metal)", + "description": "Debug build with Xcode for MacOS x86_64 (Metal)", "inherits": [ "MacOS-Build" ], - "configurePreset": "Xcode-Mac-MTL-Default", + "configurePreset": "Xcode-Mac-x86-64-MTL-Default", "configuration": "Debug" }, { - "name": "Xcode-Mac-MTL-Release", - "displayName": "Release - Xcode - MacOS (Metal)", - "description": "Release build with Xcode for MacOS (Metal)", + "name": "Xcode-Mac-Arm64-MTL-Release", + "displayName": "Release - Xcode - MacOS Arm64 (Metal)", + "description": "Release build with Xcode for MacOS Arm64 (Metal)", "inherits": [ "MacOS-Build" ], - "configurePreset": "Xcode-Mac-MTL-Default", + "configurePreset": "Xcode-Mac-Arm64-MTL-Default", "configuration": "Release" }, { - "name": "Xcode-Mac-MTL-Profile", - "displayName": "Profile - Xcode - MacOS (Metal)", - "description": "Profiling build with Xcode for MacOS (Metal)", + "name": "Xcode-Mac-x86-64-MTL-Release", + "displayName": "Release - Xcode - MacOS x86_64 (Metal)", + "description": "Release build with Xcode for MacOS x86_64 (Metal)", "inherits": [ "MacOS-Build" ], - "configurePreset": "Xcode-Mac-MTL-Profile", + "configurePreset": "Xcode-Mac-x86-64-MTL-Default", + "configuration": "Release" + }, + { + "name": "Xcode-Mac-Arm64-MTL-Profile", + "displayName": "Profile - Xcode - MacOS Arm64 (Metal)", + "description": "Profiling build with Xcode for MacOS Arm64 (Metal)", + "inherits": [ "MacOS-Build" ], + "configurePreset": "Xcode-Mac-Arm64-MTL-Profile", "configuration": "RelWithDebInfo" }, - { - "name": "Xcode-Mac-MTL-Scan", - "displayName": "Scan - Xcode - MacOS (Metal)", - "description": "Scanning build with Xcode for MacOS (Metal)", + "name": "Xcode-Mac-x86-64-MTL-Profile", + "displayName": "Profile - Xcode - MacOS x86_64 (Metal)", + "description": "Profiling build with Xcode for MacOS x86_64 (Metal)", "inherits": [ "MacOS-Build" ], - "configurePreset": "Xcode-Mac-MTL-Scan", - "configuration": "Debug" + "configurePreset": "Xcode-Mac-x86-64-MTL-Profile", + "configuration": "RelWithDebInfo" }, { From 5a0dad7129d9f5c38f766a0a235dbe20bafea01b Mon Sep 17 00:00:00 2001 From: Evgeny Gorodetskiy Date: Fri, 2 Jun 2023 23:05:14 +0300 Subject: [PATCH 10/12] Improve asteroid texture noise generation using fractal noise from FastNoise2 library --- Modules/Simulation/Asteroid.cpp | 30 +++++++++++++++++---------- Modules/Simulation/Asteroid.h | 16 +++++++------- Modules/Simulation/AsteroidsArray.cpp | 30 ++++++++++++++++----------- Modules/Simulation/CMakeLists.txt | 1 + 4 files changed, 47 insertions(+), 30 deletions(-) diff --git a/Modules/Simulation/Asteroid.cpp b/Modules/Simulation/Asteroid.cpp index bd3051f..f9dc73d 100644 --- a/Modules/Simulation/Asteroid.cpp +++ b/Modules/Simulation/Asteroid.cpp @@ -28,6 +28,7 @@ Random generated asteroid model with mesh and texture ready for rendering #include #include +#include #include #include @@ -83,7 +84,7 @@ void Asteroid::Mesh::Randomize(uint32_t random_seed) std::mt19937 rng(random_seed); // NOSONAR - using pseudorandom generator is safe here auto random_persistence = std::normal_distribution(0.95F, 0.04F); - const gfx::PerlinNoise perlin_noise(random_persistence(rng)); + const gfx::PerlinNoise perlin_noise(random_persistence(rng), 4, static_cast(random_seed)); auto random_noise = std::uniform_real_distribution(0.0F, 10000.0F); const float noise = random_noise(rng); @@ -140,16 +141,12 @@ rhi::SubResources Asteroid::GenerateTextureArraySubResources(const gfx::Dimensio sub_resources.reserve(array_size); std::mt19937 rng(noise_parameters.random_seed); // NOSONAR - using pseudorandom generator is safe here - std::uniform_real_distribution noise_seed_distribution(0.F, 10000.F); + std::uniform_int_distribution noise_seed_distribution(0, 10000); for (uint32_t array_index = 0; array_index < array_size; ++array_index) { Data::Bytes sub_resource_data(static_cast(pixels_count) * pixel_size, std::byte(255)); - FillPerlinNoiseToTexture(sub_resource_data, dimensions, row_stride, - noise_seed_distribution(rng), - noise_parameters.persistence, - noise_parameters.scale, - noise_parameters.strength); + FillPerlinNoiseToTexture(sub_resource_data, dimensions, row_stride, noise_parameters); sub_resources.emplace_back(std::move(sub_resource_data), rhi::SubResource::Index{ 0, array_index }); } @@ -244,10 +241,20 @@ Asteroid::Colors Asteroid::GetAsteroidLodColors(uint32_t lod_index) } void Asteroid::FillPerlinNoiseToTexture(Data::Bytes& texture_data, const gfx::Dimensions& dimensions, uint32_t row_stride, - float random_seed, float persistence, float noise_scale, float noise_strength) + const TextureNoiseParameters& noise_parameters) { META_FUNCTION_TASK(); - const gfx::PerlinNoise perlin_noise(persistence); + static const auto fractal_noise = [noise_parameters]() { + auto noise = FastNoise::New(); + noise->SetSource(FastNoise::New()); + noise->SetGain(noise_parameters.gain); + noise->SetWeightedStrength(noise_parameters.fractal_weight); + noise->SetOctaveCount(4); + noise->SetLacunarity(noise_parameters.lacunarity); + return noise; + }(); + + std::vector noise_values(dimensions.GetPixelsCount()); for (size_t row = 0; row < dimensions.GetHeight(); ++row) { @@ -255,8 +262,9 @@ void Asteroid::FillPerlinNoiseToTexture(Data::Bytes& texture_data, const gfx::Di for (size_t col = 0; col < dimensions.GetWidth(); ++col) { - const hlslpp::float3 noise_coordinates(noise_scale * static_cast(row), noise_scale * static_cast(col), random_seed); - const float noise_intensity = std::max(0.0F, std::min(1.0F, (perlin_noise(noise_coordinates) - 0.5F) * noise_strength + 0.5F)); + const float noise_intensity = fractal_noise->GenSingle2D(noise_parameters.scale * static_cast(row), + noise_parameters.scale * static_cast(col), + noise_parameters.random_seed); auto texel_data = reinterpret_cast(&row_data[col]); // NOSONAR for (size_t channel = 0; channel < 3; ++channel) diff --git a/Modules/Simulation/Asteroid.h b/Modules/Simulation/Asteroid.h index 05637fa..f60a133 100644 --- a/Modules/Simulation/Asteroid.h +++ b/Modules/Simulation/Asteroid.h @@ -98,10 +98,12 @@ class Asteroid final struct TextureNoiseParameters { - uint32_t random_seed = 0; - float persistence = 0.9F; - float scale = 0.5F; - float strength = 1.5F; + int random_seed = 0; + float gain = 0.5F; + float fractal_weight = 0.5F; + float lacunarity = 2.0F; + float scale = 0.5F; + float strength = 0.8F; }; explicit Asteroid(const rhi::RenderContext& render_context, const rhi::CommandQueue& render_cmd_queue); @@ -111,8 +113,8 @@ class Asteroid final const gfx::Dimensions& dimensions, uint32_t array_size, bool mipmapped, const TextureNoiseParameters& noise_parameters); - static rhi::SubResources GenerateTextureArraySubResources(const gfx::Dimensions& dimensions, - uint32_t array_size, + + static rhi::SubResources GenerateTextureArraySubResources(const gfx::Dimensions& dimensions, uint32_t array_size, const TextureNoiseParameters& noise_parameters); static constexpr size_t color_schema_size = 6U; @@ -122,7 +124,7 @@ class Asteroid final private: static void FillPerlinNoiseToTexture(Data::Bytes& texture_data, const gfx::Dimensions& dimensions, uint32_t row_stride, - float random_seed, float persistence, float noise_scale, float noise_strength); + const TextureNoiseParameters& noise_parameters); }; } // namespace Methane::Samples diff --git a/Modules/Simulation/AsteroidsArray.cpp b/Modules/Simulation/AsteroidsArray.cpp index 7ad6348..b66dbf1 100644 --- a/Modules/Simulation/AsteroidsArray.cpp +++ b/Modules/Simulation/AsteroidsArray.cpp @@ -23,7 +23,6 @@ Random generated asteroids array with uber mesh and textures ready for rendering #include "AsteroidsArray.h" -#include #include #include #include @@ -125,23 +124,30 @@ AsteroidsArray::ContentState::ContentState(tf::Executor& parallel_executor, cons std::mt19937 rng(settings.random_seed); // NOSONAR - using pseudorandom generator is safe here // Randomly generate perlin-noise textures - std::normal_distribution noise_persistence_distribution(0.9F, 0.2F); + std::uniform_real_distribution noise_gain_distribution(0.2F, 0.8F); + std::uniform_real_distribution noise_fractal_distribution(0.3F, 0.7F); + std::uniform_real_distribution noise_lacunarity_distribution(1.5F, 2.5F); std::uniform_real_distribution noise_scale_distribution(0.05F, 0.1F); + std::uniform_real_distribution noise_strength_distribution(0.8F, 1.0F); texture_array_subresources.resize(settings.textures_count); tf::Taskflow task_flow; task_flow.for_each(texture_array_subresources.begin(), texture_array_subresources.end(), - [&rng, &noise_persistence_distribution, &noise_scale_distribution, &settings](rhi::SubResources& sub_resources) + [&rng, &noise_gain_distribution, &noise_fractal_distribution, &noise_lacunarity_distribution, + &noise_scale_distribution, &noise_strength_distribution, &settings] + (rhi::SubResources& sub_resources) { - Asteroid::TextureNoiseParameters noise_parameters{ - static_cast(rng()), //NOSONAR - noise_persistence_distribution(rng), - noise_scale_distribution(rng), - 1.5F - }; - sub_resources = Asteroid::GenerateTextureArraySubResources(settings.texture_dimensions, 3, noise_parameters); - } - ); + sub_resources = Asteroid::GenerateTextureArraySubResources(settings.texture_dimensions, 3U, + Asteroid::TextureNoiseParameters + { + static_cast(rng()), + noise_gain_distribution(rng), + noise_fractal_distribution(rng), + noise_lacunarity_distribution(rng), + noise_scale_distribution(rng), + noise_strength_distribution(rng) + }); + }); parallel_executor.run(task_flow).get(); // Randomly distribute textures between uber-mesh subsets diff --git a/Modules/Simulation/CMakeLists.txt b/Modules/Simulation/CMakeLists.txt index dcb0eff..bb5c404 100644 --- a/Modules/Simulation/CMakeLists.txt +++ b/Modules/Simulation/CMakeLists.txt @@ -23,6 +23,7 @@ target_link_libraries(${TARGET} MethanePerlinNoise MethaneBuildOptions TaskFlow + FastNoise2 ) set_target_properties(${TARGET} From 7ed9938d4eb126493512eb4c380547017a460666 Mon Sep 17 00:00:00 2001 From: egorodet Date: Sat, 3 Jun 2023 13:57:12 +0300 Subject: [PATCH 11/12] Update Externals ReadMe --- Externals/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Externals/README.md b/Externals/README.md index 595f480..0dc8b44 100644 --- a/Externals/README.md +++ b/Externals/README.md @@ -12,10 +12,10 @@ to support parallel cmake configurations processing. | Libraries | Version | Linkage | License | Description | |------------------------------------------------------------|---------|-------------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------| -| [MethaneKit](https://github.com/MethanePowered/MethaneKit) | 0.7.1 | Static | [Apache 2.0](https://github.com/MethanePowered/MethaneKit/blob/master/LICENSE) | Modern 3D graphics made simple with C++17 cross-platform framework and rendering abstraction API on top of DirectX 12, Metal & Vulkan. | -| [Perlin Noise](https://github.com/stegu/perlin-noise/) | 1.0 | Static | [Public Domain](https://github.com/stegu/perlin-noise/blob/master/LICENSE.md) | Simplex and Perlin noise implementation by Stefan Gustavson. | -| [HLSL++](https://github.com/redorav/hlslpp) | 3.2 | Header-only | [MIT](https://github.com/MethanePowered/HLSLpp/blob/master/LICENSE) | Math library using hlsl syntax with SSE/NEON support. | -| [Tracy](https://github.com/wolfpld/tracy) | 0.8.2.1 | Static | [BSD 3.0](https://github.com/wolfpld/tracy/blob/master/LICENSE) | A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications. | +| [MethaneKit](https://github.com/MethanePowered/MethaneKit) | 0.7.2 | Static | [Apache 2.0](https://github.com/MethanePowered/MethaneKit/blob/master/LICENSE) | Modern 3D graphics made simple with C++17 cross-platform framework and rendering abstraction API on top of DirectX 12, Metal & Vulkan. | +| [FastNoise2](https://github.com/Auburn/FastNoise2) | 0.10.0 | Static | [MIT](https://github.com/Auburn/FastNoise2/blob/master/LICENSE) | Modular node graph based noise generation library using SIMD, C++17 and templates. | +| [HLSL++](https://github.com/redorav/hlslpp) | 3.3.1 | Header-only | [MIT](https://github.com/MethanePowered/HLSLpp/blob/master/LICENSE) | Math library using hlsl syntax with SSE/NEON support. | +| [Tracy](https://github.com/wolfpld/tracy) | 0.9.1 | Static | [BSD 3.0](https://github.com/wolfpld/tracy/blob/master/LICENSE) | A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications. | | [ITT API](https://github.com/intel/ittapi) | 3.23.0 | Static | [BSD 3.0](https://github.com/MethanePowered/IttApi/blob/master/LICENSES/BSD-3-Clause.txt) | IntelĀ® Instrumentation and Tracing Technology (ITT) and Just-In-Time (JIT) API. | | [Magic Enum](https://github.com/Neargye/magic_enum) | 0.8.0 | Header-only | [MIT](https://github.com/Neargye/magic_enum/blob/master/LICENSE) | Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code. | | [TaskFlow](https://github.com/taskflow/taskflow) | 3.4.0 | Header-only | [MIT](https://github.com/taskflow/taskflow/blob/master/LICENSE) | A General-purpose Parallel and Heterogeneous Task Programming System. | @@ -24,7 +24,7 @@ to support parallel cmake configurations processing. | Libraries | Version | Usage | License | Description | |-------------------------------------------------------------------------------|-----------|--------------------------|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------| -| [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) | 0.37.0 | CMake | [MIT](https://github.com/cpm-cmake/CPM.cmake/blob/master/LICENSE) | CMake's missing package manager. | +| [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) | 0.38.1 | CMake | [MIT](https://github.com/cpm-cmake/CPM.cmake/blob/master/LICENSE) | CMake's missing package manager. | | [CMRC](https://github.com/vector-of-bool/cmrc) | n/a | CMake | [MIT](https://github.com/vector-of-bool/cmrc/blob/master/LICENSE.txt) | A Resource Compiler in a Single CMake script. | | [iOS-Toolchain.cmake](https://github.com/leetal/ios-cmake) | 4.3.0 | CMake | [BSD 3.0](https://github.com/leetal/ios-cmake/blob/master/LICENSE.md) | A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development. | | [DirectX Shader Compiler](https://github.com/microsoft/DirectXShaderCompiler) | 1.6.2104 | HLSL Compiler to SPIRV | [LLVM Release](https://github.com/microsoft/DirectXShaderCompiler/blob/main/LICENSE.TXT) | Open-source HLSL Shader Compiler which is based on LLVM/Clang. | From 4371f145d902425a970793f7ea7589e841d2658b Mon Sep 17 00:00:00 2001 From: egorodet Date: Sat, 3 Jun 2023 13:57:48 +0300 Subject: [PATCH 12/12] Disable int overflow warning for FastNoise2 with GNU compiler --- Externals/FastNoise2.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Externals/FastNoise2.cmake b/Externals/FastNoise2.cmake index 3a8e44e..cf2047b 100644 --- a/Externals/FastNoise2.cmake +++ b/Externals/FastNoise2.cmake @@ -5,4 +5,8 @@ CPMAddPackage( OPTIONS "FASTNOISE2_NOISETOOL OFF" "FASTNOISE2_TESTS OFF" -) \ No newline at end of file +) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(FastNoise PRIVATE -Wno-overflow) +endif() \ No newline at end of file