Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced most shared_ptr with unique_ptr. #566

Merged
merged 35 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8920740
COM: Implemented support for overlays.
DragonJoker Apr 1, 2023
2cc4f4c
COM: Added IGuiCallbacks to handle clipboard and mouse cursor events.
DragonJoker Apr 1, 2023
816c8cf
Bumped version numbers and vcpkg related.
DragonJoker Apr 2, 2023
dc5aede
Castor3D: Fixed some issues discovered while running tests.
DragonJoker Apr 2, 2023
0e85f16
Castor3D: Fixed reloading of a simple scene
DragonJoker Apr 3, 2023
7dc1e01
Castor3D: Fixed controls and overlays cleanup.
DragonJoker Apr 4, 2023
bf65408
Castor3D: Got rid of shared_ptrs for overlays.
DragonJoker Apr 4, 2023
8a34ea6
Castor3D: Replaced shared_ptrs with unique_ptrs for material shader b…
DragonJoker Apr 4, 2023
93b8ddc
Castor3D: Fixed normals after passes merging.
DragonJoker Apr 4, 2023
1d91f32
Castor3D: Fixed handling of 64 bits png with FreeImage.
DragonJoker Apr 4, 2023
dae09af
Castor3D: Fixed merging of images during texture units constitution.
DragonJoker Apr 4, 2023
f19f2a7
Castor3D: Fixed consistency between STB and FreeImage.
DragonJoker Apr 5, 2023
7647761
Castor3D: Fixed images merging.
DragonJoker Apr 5, 2023
7ae9eca
Castor3D: Replaced shared_ptr with unique_ptr for pixel buffers.
DragonJoker Apr 5, 2023
54a4638
Castor3D: Replaced shared_ptr with unique_ptr for file parser context.
DragonJoker Apr 5, 2023
36006d9
Castor3D: Replaced shared_ptr with unique_ptr for caches and views.
DragonJoker Apr 5, 2023
4a7208b
Castor3D: Replaced shared_ptr with unique_ptr for shader programs.
DragonJoker Apr 5, 2023
ae07f62
Castor3D: Replaced shared_ptr with unique_ptr for render targets.
DragonJoker Apr 6, 2023
54df3ee
Castor3D: Replaced shared_ptr with unique_ptr for texture layouts.
DragonJoker Apr 6, 2023
2bb8475
Castor3D: Replaced shared_ptr with unique_ptr for mesh generators.
DragonJoker Apr 6, 2023
7e010b9
Castor3D: Reworked event handlers as unique ptrs.
DragonJoker Apr 6, 2023
6f2084b
Castor3D: Removed all direct uses of weak_ptr
DragonJoker Apr 6, 2023
381ca92
Castor3D: Object caches now use unique_ptr instead of shared_ptr.
DragonJoker Apr 6, 2023
81633a3
Castor3D: Replaced shared_ptr with unique_ptr for caches.
DragonJoker Apr 7, 2023
4ee0e14
Castor3D: Replaced use of shared_ptr with unique_ptr for Pass.
DragonJoker Apr 9, 2023
9f016c9
Castor3D: Replaced use of shared_ptr with unique_ptr for TextureUnit.
DragonJoker Apr 9, 2023
961be7b
Castor3D: Replaced use of shared_ptr with unique_ptr for Submesh.
DragonJoker Apr 9, 2023
5b678e5
Castor3D: Replaced use of shared_ptr with unique_ptr for SubmeshCompo…
DragonJoker Apr 9, 2023
433338e
Castor3D: Replaced use of shared_ptr with unique_ptr for PostEffect.
DragonJoker Apr 9, 2023
2ae4424
Castor3D: Replaced use of shared_ptr with unique_ptr for ToneMapping.
DragonJoker Apr 9, 2023
ea7b252
Castor3D: Replaced use of shared_ptr with unique_ptr for remaining ca…
DragonJoker Apr 9, 2023
021f841
Castor3D: Replaced use of shared_ptr with unique_ptr for animation re…
DragonJoker Apr 9, 2023
d7d320e
Castor3D: Replaced remaining XxxSPtrs with their UPtr counterpart.
DragonJoker Apr 9, 2023
470de5f
COM: Updated binding.
DragonJoker Apr 10, 2023
f06f777
Trying to fix vcpkg build on GH Actions.
DragonJoker Apr 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CMake
Submodule CMake updated 1 files
+32 −12 Project.cmake
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ endif ()
set( MAIN_PROJECT_NAME "Castor3D" )

set( VERSION_MAJOR 0 )
set( VERSION_MINOR 14 )
set( VERSION_MINOR 15 )
set( VERSION_BUILD 0 )
set( VERSION_YEAR 2022 )
set( VERSION_YEAR 2023 )

# Setup lookup for external modules
if ( VCPKG_TOOLCHAIN )
Expand Down
31 changes: 13 additions & 18 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"configurePresets": [
{
"name": "default-base",
"name": "user-base",
"hidden": true,
"installDir": "${sourceDir}/package/Castor3D",
"cacheVariables": {
Expand All @@ -26,25 +26,20 @@
"PROJECTS_OUTPUT_DIR": "${sourceDir}",
"PROJECTS_UNITY_BUILD": true,
"PROJECTS_USE_PRECOMPILED_HEADERS": false
},
"environment": {
"BUILD_SDW_SPIRV": "1",
"BUILD_SDW_GLSL": "1",
"BUILD_SDW_HLSL": "1"
}
},
{
"name": "default-msvc",
"displayName": "Default Visual Studio Config",
"description": "Default build configuration using Visual Studio",
"inherits": "default-base",
"name": "user-msvc",
"displayName": "Castor3D User Visual Studio Config",
"description": "Build configuration using Visual Studio, for Castor3D users",
"inherits": "user-base",
"generator": "Visual Studio 17 2022"
},
{
"name": "default-ninja",
"displayName": "Default Ninja Config",
"description": "Default build configuration using Ninja",
"inherits": "default-base",
"name": "user-ninja",
"displayName": "Castor3D User Ninja Config",
"description": "Build configuration using Ninja, for Castor3D users",
"inherits": "user-base",
"generator": "Ninja"
},
{
Expand Down Expand Up @@ -72,8 +67,8 @@
},
{
"name": "dev-msvc",
"displayName": "Developer Visual Studio Config",
"description": "Developer build configuration using Visual Studio",
"displayName": "Castor3D Developer Visual Studio Config",
"description": "Build configuration using Visual Studio, for Castor3D developers",
"inherits": "dev-base",
"generator": "Visual Studio 17 2022",
"cacheVariables": {
Expand All @@ -82,8 +77,8 @@
},
{
"name": "dev-ninja",
"displayName": "Developer Ninja Config",
"description": "Developer build configuration using Ninja",
"displayName": "Castor3D Developer Ninja Config",
"description": "Build configuration using Ninja, for Castor3D developers",
"inherits": "dev-base",
"generator": "Ninja"
},
Expand Down
8 changes: 8 additions & 0 deletions data/vcpkg/ports/ashes/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ vcpkg_from_github(
file(REMOVE_RECURSE "${SOURCE_PATH}/CMake")
file(COPY "${CMAKE_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/CMake")

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
direct3d11 ASHES_BUILD_RENDERER_D3D11
opengl ASHES_BUILD_RENDERER_OGL
vulkan ASHES_BUILD_RENDERER_VKN
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
Expand All @@ -27,6 +34,7 @@ vcpkg_cmake_configure(
-DASHES_BUILD_TESTS=OFF
-DASHES_BUILD_INFO=OFF
-DASHES_BUILD_SAMPLES=OFF
${FEATURE_OPTIONS}
)

vcpkg_cmake_install()
Expand Down
21 changes: 18 additions & 3 deletions data/vcpkg/ports/ashes/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "ashes",
"version-date": "2022-06-08",
"version-date": "2023-03-12",
"description": "Drop-in replacement to Vulkan's shared library, allowing the use of OpenGL or Direct3D11 in addition to Vulkan.",
"homepage": "https://github.com/DragonJoker/Ashes",
"license": "MIT",
"supports": "!ios & !android & !uwp & !x86 & !arm",
"supports": "!ios & !android & !x86 & !uwp & !arm32",
"dependencies": [
"opengl",
"spirv-cross",
Expand All @@ -17,5 +17,20 @@
"host": true
},
"vulkan-headers"
]
],
"default-features": [
"opengl",
"vulkan"
],
"features": {
"direct3d11": {
"description": "Compiles Direct3D11 renderer."
},
"opengl": {
"description": "Compiles OpenGL renderer."
},
"vulkan": {
"description": "Compiles Vulkan renderer."
}
}
}
47 changes: 14 additions & 33 deletions data/vcpkg/ports/castor3d/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,28 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO DragonJoker/Castor3D
REF b5cb00ae0f85206ac29fabce9162c206f67fe370
REF 31c7acf35e4c5e5605df591fee61b989dc4d4d9d
HEAD_REF master
SHA512 a67192a6f465ab2b18b3748d36371a708268f66d051c973c18886dec25294afc21cb47dae249299950d6c5e36b43a2c82337da260ec6007641452d00f0b079e2
SHA512 203dbd28c32e02e714726460cab5a6477bec03f5a63e08001074cd1fc8342b6d64b91369cdf3a6d55d6758991c59bce691c377f3c82aa866cd09ecea8f6a518a
)

vcpkg_from_github(OUT_SOURCE_PATH CMAKE_SOURCE_PATH
REPO DragonJoker/CMakeUtils
REF ad28a43953f8a65b3f95b40824ac43c7278a565c
REF 7d355194fa795c437ce970cecf00e23ae10fc686
HEAD_REF master
SHA512 224d645f0bd7d8e1d845e894f09125fb60e29b0b19c2280142751ba8aa8f6d8d29fac5758fe22f21664276e4079066f40a3c2de21f555f2da57264fc38652787
SHA512 ca25b19bdeb3e8fda7abc32f8548731f0ba1cd09889a70f6f287ad76d2fdfa0fedbb7f6f65b26d356ea51543bed8926c6bb463f8e8461b7d51d3b7b33134374c
)

file(REMOVE_RECURSE "${SOURCE_PATH}/CMake")
file(COPY "${CMAKE_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/CMake")

if ("assimp" IN_LIST FEATURES)
set(BUILD_IMPORTER_ASSIMP ON)
else()
set(BUILD_IMPORTER_ASSIMP OFF)
endif()

if ("freeimage" IN_LIST FEATURES)
set(USE_FREEIMAGE ON)
else()
set(USE_FREEIMAGE OFF)
endif()

if ("glsl" IN_LIST FEATURES)
set(USE_GLSL ON)
else()
set(USE_GLSL OFF)
endif()

if ("vkfft" IN_LIST FEATURES)
set(USE_VKFFT ON)
else()
set(USE_VKFFT OFF)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
assimp CASTOR_BUILD_IMPORTER_ASSIMP
freeimage CASTOR_USE_FREEIMAGE
glsl CASTOR_C3D_NEEDS_GLSL
vkfft CASTOR_HAS_VKFFT
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
Expand All @@ -51,17 +35,14 @@ vcpkg_cmake_configure(
-DCASTOR_BUILDGRP_TEST=OFF
-DCASTOR_BUILDGRP_TOOL=OFF
-DCASTOR_DISABLE_DELAYED_INITIALISATION=ON
-DCASTOR_FORCE_VCPKG_SUBMODULES=ON
-DCASTOR_USE_GLSLANG=ON
-DCASTOR_USE_MESH_SHADERS=OFF
-DCASTOR_USE_TASK_SHADERS=OFF
-DPROJECTS_UNITY_BUILD=ON
-DPROJECTS_USE_PRECOMPILED_HEADERS=OFF
-DVCPKG_BUILD=ON
-DCASTOR_FORCE_VCPKG_SUBMODULES=ON
-DCASTOR_BUILD_IMPORTER_ASSIMP=${BUILD_IMPORTER_ASSIMP}
-DCASTOR_C3D_NEEDS_GLSL=${USE_GLSL}
-DCASTOR_USE_FREEIMAGE=${USE_FREEIMAGE}
-DVCPKG_BUILD=ON
${FEATURE_OPTIONS}
)

vcpkg_copy_pdbs()
Expand All @@ -70,4 +51,4 @@ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Castor3D)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
34 changes: 25 additions & 9 deletions data/vcpkg/ports/castor3d/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
{
"name": "castor3d",
"version": "0.14.0",
"version": "0.15.0",
"description": "C++17 and Vulkan 3D engine.",
"homepage": "https://github.com/DragonJoker/Castor3D",
"license": "MIT",
"dependencies": [
"ashes",
"convectionkernels",
"freetype",
"gli",
"meshoptimizer",
"minizip",
"zlib",
"ashes",
"rendergraph",
"shaderwriter",
{
"name": "shaderwriter",
"features": [
"glsl",
"hlsl",
"spirv"
]
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
},
"zlib"
],
"default-features": [
"assimp",
Expand All @@ -32,19 +39,28 @@
"features": {
"assimp": {
"description": "Use Assimp library to import external scenes.",
"dependencies": [ "assimp" ]
"dependencies": [
"assimp"
]
},
"freeimage": {
"description": "Use FreeImage library over stb_image to import TIF, PNG or RAW images.",
"dependencies": [ "freeimage" ]
"dependencies": [
"freeimage"
]
},
"glsl": {
"description": "Enable GLSL shaders import support.",
"dependencies": [ "glslang", "spirv-cross" ]
"dependencies": [
"glslang",
"spirv-cross"
]
},
"vkfft": {
"description": "Use VkFFT to compute Fast Fourier Transforms (Necessary for FFTOcean plugin).",
"dependencies": [ "vkfft" ]
"dependencies": [
"vkfft"
]
}
}
}
7 changes: 4 additions & 3 deletions data/vcpkg/ports/rendergraph/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
REPO DragonJoker/RenderGraph
REF 448f1b7f8b7f50ee247e84220c6643a412b458f8
REF v${VERSION}
HEAD_REF master
SHA512 73302f9c439e367ca4fe285a353ec6dbbfd67e9ec891b10c7e6fd81cc4dd8de0e3b94db881ebc43c04a3782de4cc2e306ea0c70c95000240d169381645eafe3c
SHA512 48bb3211022499538eebca0051f931ec105af9ccd3fea21d546fcd9cb41bc9d2191c70382e00caaf79fce48303e56d83d7089f7b975f635bcef3645c80abda30
)

vcpkg_from_github(OUT_SOURCE_PATH CMAKE_SOURCE_PATH
Expand Down Expand Up @@ -31,7 +31,8 @@ vcpkg_cmake_configure(
-DVULKAN_HEADERS_INCLUDE_DIRS=${CURRENT_INSTALLED_DIR}/include
)

vcpkg_copy_pdbs()
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/RenderGraph)

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
2 changes: 1 addition & 1 deletion data/vcpkg/ports/rendergraph/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rendergraph",
"version": "1.1.0",
"version": "1.3.0",
"description": "Vulkan render graph implementation.",
"homepage": "https://github.com/DragonJoker/RenderGraph",
"license": "MIT",
Expand Down
37 changes: 9 additions & 28 deletions data/vcpkg/ports/shaderwriter/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}

vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
REPO DragonJoker/ShaderWriter
REF d040c89bb543b2e1d646714e36a190816b8e06ef
REF v${VERSION}
HEAD_REF development
SHA512 9f95604f866f2cdc3b392c135ae34b93075a004f60319b00f5fbd2251361c68d7ca68ae00709adc435e387b3cf1b6659e643b7d200c0e6c734aa29f66491e947
SHA512 7e7d5fec16998bf99225e01a990fcb29612eee8f59e32fbb4e9650a0d69ffc658588380fdfd9374cc5492bd4eac5c9c6dadeb583129c649e5d792346a2d1a743
)

vcpkg_from_github(OUT_SOURCE_PATH CMAKE_SOURCE_PATH
Expand All @@ -19,27 +17,12 @@ file(COPY "${CMAKE_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/CMake")

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)

set(BUILD_SPIRV OFF)
set(BUILD_GLSL OFF)
set(BUILD_HLSL OFF)

if ("spirv" IN_LIST FEATURES)
set(BUILD_SPIRV ON)
elseif ("$ENV{BUILD_SDW_SPIRV}" STREQUAL "1")
set(BUILD_SPIRV ON)
endif()

if ("glsl" IN_LIST FEATURES)
set(BUILD_GLSL ON)
elseif ("$ENV{BUILD_SDW_GLSL}" STREQUAL "1")
set(BUILD_GLSL ON)
endif()

if ("glsl" IN_LIST FEATURES)
set(BUILD_HLSL ON)
elseif ("$ENV{BUILD_SDW_HLSL}" STREQUAL "1")
set(BUILD_HLSL ON)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
spirv SDW_BUILD_EXPORTER_SPIRV
glsl SDW_BUILD_EXPORTER_HLSL
hlsl SDW_BUILD_EXPORTER_GLSL
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
Expand All @@ -48,12 +31,10 @@ vcpkg_cmake_configure(
-DSDW_GENERATE_SOURCE=OFF
-DSDW_BUILD_VULKAN_LAYER=OFF
-DSDW_BUILD_TESTS=OFF
-DSDW_BUILD_EXPORTER_SPIRV=${BUILD_SPIRV}
-DSDW_BUILD_EXPORTER_HLSL=${BUILD_HLSL}
-DSDW_BUILD_EXPORTER_GLSL=${BUILD_GLSL}
-DSDW_BUILD_STATIC_SDW=${BUILD_STATIC}
-DSDW_BUILD_STATIC_SDAST=${BUILD_STATIC}
-DSDW_UNITY_BUILD=ON
${FEATURE_OPTIONS}
)

vcpkg_copy_pdbs()
Expand Down
Loading