move subprojects into dedicated folder

This commit is contained in:
PancakeTAS 2025-07-16 17:32:45 +02:00 committed by Pancake
parent ffd72ee598
commit 3f64d20d8e
81 changed files with 62 additions and 241 deletions

View file

@ -16,9 +16,7 @@ add_compile_options(-fPIC
add_subdirectory(thirdparty/dxbc EXCLUDE_FROM_ALL)
add_subdirectory(thirdparty/pe-parse/pe-parser-library EXCLUDE_FROM_ALL)
add_subdirectory(lsfg-vk-common)
add_subdirectory(lsfg-vk-v3.1)
add_subdirectory(lsfg-vk-v3.1p)
add_subdirectory(framegen)
# main project
project(lsfg-vk
@ -43,8 +41,7 @@ set_target_properties(lsfg-vk PROPERTIES
target_include_directories(lsfg-vk
PRIVATE include)
target_link_libraries(lsfg-vk PRIVATE
lsfg-vk-common lsfg-vk-v3.1 lsfg-vk-v3.1p
pe-parse dxbc vulkan)
lsfg-vk-framegen pe-parse dxbc vulkan)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_target_properties(lsfg-vk PROPERTIES

View file

@ -1,40 +1,57 @@
cmake_minimum_required(VERSION 3.28)
# project
project(lsfg-vk-common
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
project(lsfg-vk-framegen
DESCRIPTION "Lossless Scaling Frame Generation Backend"
LANGUAGES CXX)
file(GLOB SOURCES
"src/common/*.cpp"
"src/config/*.cpp"
"src/core/*.cpp"
"src/pool/*.cpp"
"src/common/*.cpp"
"src/*.cpp"
"v3.1_src/core/*.cpp"
"v3.1_src/pool/*.cpp"
"v3.1_src/shaders/*.cpp"
"v3.1_src/utils/*.cpp"
"v3.1_src/*.cpp"
"v3.1p_src/core/*.cpp"
"v3.1p_src/pool/*.cpp"
"v3.1p_src/shaders/*.cpp"
"v3.1p_src/utils/*.cpp"
"v3.1p_src/*.cpp"
)
add_library(lsfg-vk-common STATIC ${SOURCES})
add_library(lsfg-vk-framegen STATIC ${SOURCES})
# target
set_target_properties(lsfg-vk-common PROPERTIES
set_target_properties(lsfg-vk-framegen PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON)
target_include_directories(lsfg-vk-common
PUBLIC include)
target_link_libraries(lsfg-vk-common
PRIVATE vulkan)
target_include_directories(lsfg-vk-framegen
PUBLIC include
PUBLIC public
PRIVATE v3.1_include
PRIVATE v3.1p_include)
target_link_libraries(lsfg-vk-framegen
PUBLIC vulkan)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_target_properties(lsfg-vk-common PROPERTIES
set_target_properties(lsfg-vk-framegen PROPERTIES
INTERPROCEDURAL_OPTIMIZATION ON)
endif()
# diagnostics
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_target_properties(lsfg-vk-common PROPERTIES
set_target_properties(lsfg-vk-framegen PROPERTIES
EXPORT_COMPILE_COMMANDS ON)
endif()
if(LSFGVK_EXCESS_DEBUG)
target_compile_options(lsfg-vk-common PRIVATE
target_compile_options(lsfg-vk-framegen PRIVATE
-Weverything
# disable compat c++ flags
-Wno-pre-c++20-compat-pedantic
@ -52,6 +69,6 @@ if(LSFGVK_EXCESS_DEBUG)
-Wno-cast-function-type-strict # for vulkan
)
set_target_properties(lsfg-vk-common PROPERTIES
set_target_properties(lsfg-vk-framegen PROPERTIES
CXX_CLANG_TIDY clang-tidy)
endif()

14
framegen/README.md Normal file
View file

@ -0,0 +1,14 @@
## lsfg-vk-framegen
Lossless Scaling Frame Generation
This is a subproject of lsfg-vk and contains the dedicated Vulkan logic for generating frames.
The project is intentionally structured as a fully external project, such that it can be integrated into other applications.
### Interface
Interfacing with lsfg-vk-framegen is done via `lsfg_x_x.hpp` header. The internal Vulkan instance is created using `LSFG_X_X::initialize()` and requires a specific deviceUUID, as well as parts of the lsfg-vk configuration, including a function loading SPIR-V shaders by name. Cleanup is done via `LSFG_X_X::finalize()` after which `LSFG_X_X::initialize()` may be called again. Please note that the initialization process is expensive and may take a while. It is recommended to call this function once during the applications lifetime.
Once the format and extent of the requested images is determined, `LSFG_X_X::createContext()` should be called to initialize a frame generation context. The Vulkan images are created from backing memory, which is passed through the file descriptor arguments. A context can be destroyed using `LSFG_X_X::deleteContext()`.
Presenting the context can be done via `LSFG_X_X::presentContext()`. Before calling the function a second time, make sure the outgoing semaphores have been signaled.

View file

@ -1,4 +1,4 @@
#include "context.hpp"
#include "v3_1/context.hpp"
#include "common/utils.hpp"
#include "common/exception.hpp"

View file

@ -1,5 +1,5 @@
#include "lsfg_3_1.hpp"
#include "context.hpp"
#include "v3_1/context.hpp"
#include "core/commandpool.hpp"
#include "core/descriptorpool.hpp"
#include "core/instance.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/alpha.hpp"
#include "v3_1/shaders/alpha.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/beta.hpp"
#include "v3_1/shaders/beta.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/delta.hpp"
#include "v3_1/shaders/delta.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/gamma.hpp"
#include "v3_1/shaders/gamma.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/generate.hpp"
#include "v3_1/shaders/generate.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/mipmaps.hpp"
#include "v3_1/shaders/mipmaps.hpp"
#include "common/utils.hpp"
#include "core/image.hpp"
#include "core/commandbuffer.hpp"

View file

@ -1,4 +1,4 @@
#include "context.hpp"
#include "v3_1p/context.hpp"
#include "common/utils.hpp"
#include "common/exception.hpp"

View file

@ -1,5 +1,5 @@
#include "lsfg_3_1p.hpp"
#include "context.hpp"
#include "v3_1p/context.hpp"
#include "core/commandpool.hpp"
#include "core/descriptorpool.hpp"
#include "core/instance.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/alpha.hpp"
#include "v3_1p/shaders/alpha.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/beta.hpp"
#include "v3_1p/shaders/beta.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/delta.hpp"
#include "v3_1p/shaders/delta.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/gamma.hpp"
#include "v3_1p/shaders/gamma.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/generate.hpp"
#include "v3_1p/shaders/generate.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"

View file

@ -1,4 +1,4 @@
#include "shaders/mipmaps.hpp"
#include "v3_1p/shaders/mipmaps.hpp"
#include "common/utils.hpp"
#include "core/image.hpp"
#include "core/commandbuffer.hpp"

View file

@ -1,60 +0,0 @@
cmake_minimum_required(VERSION 3.28)
# project
project(lsfg-vk-v3.1
DESCRIPTION "Lossless Scaling Frame Generation v3.1"
LANGUAGES CXX)
file(GLOB SOURCES
"src/core/*.cpp"
"src/pool/*.cpp"
"src/shaders/*.cpp"
"src/utils/*.cpp"
"src/*.cpp"
)
add_library(lsfg-vk-v3.1 STATIC ${SOURCES})
# target
set_target_properties(lsfg-vk-v3.1 PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON)
target_include_directories(lsfg-vk-v3.1
PRIVATE include
PUBLIC public)
target_link_libraries(lsfg-vk-v3.1
PUBLIC lsfg-vk-common vulkan)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_target_properties(lsfg-vk-v3.1 PROPERTIES
INTERPROCEDURAL_OPTIMIZATION ON)
endif()
# diagnostics
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_target_properties(lsfg-vk-v3.1 PROPERTIES
EXPORT_COMPILE_COMMANDS ON)
endif()
if(LSFGVK_EXCESS_DEBUG)
target_compile_options(lsfg-vk-v3.1 PRIVATE
-Weverything
# disable compat c++ flags
-Wno-pre-c++20-compat-pedantic
-Wno-pre-c++17-compat
-Wno-c++98-compat-pedantic
-Wno-c++98-compat
# disable other flags
-Wno-missing-designated-field-initializers
-Wno-shadow # allow shadowing
-Wno-switch-enum # ignore missing cases
-Wno-switch-default # ignore missing default
-Wno-padded # ignore automatic padding
-Wno-exit-time-destructors # allow globals
-Wno-global-constructors # allow globals
-Wno-cast-function-type-strict # for vulkan
)
set_target_properties(lsfg-vk-v3.1 PROPERTIES
CXX_CLANG_TIDY clang-tidy)
endif()

View file

@ -1,14 +0,0 @@
## lsfg-vk-v3.1
Version 3.1 of Lossless Scaling Frame Generation
This is a subproject of lsfg-vk and contains the external Vulkan logic for generating frames.
The project is intentionally structured as a fully external project, such that it can be integrated into other applications.
### Interface
Interfacing with lsfg-vk-v3.1 is done via `lsfg.hpp` header. The internal Vulkan instance is created using `LSFG_3_1::initialize()` and requires a specific deviceUUID, as well as parts of the lsfg-vk configuration, including a function loading SPIR-V shaders by name. Cleanup is done via `LSFG_3_1::finalize()` after which `LSFG_3_1::initialize()` may be called again. Please note that the initialization process is expensive and may take a while. It is recommended to call this function once during the applications lifetime.
Once the format and extent of the requested images is determined, `LSFG_3_1::createContext()` should be called to initialize a frame generation context. The Vulkan images are created from backing memory, which is passed through the file descriptor arguments. A context can be destroyed using `LSFG_3_1::deleteContext()`.
Presenting the context can be done via `LSFG_3_1::presentContext()`. Before calling the function a second time, make sure the outgoing semaphores have been signaled.

View file

@ -1,26 +0,0 @@
Checks:
# enable basic checks
- "clang-analyzer-*"
# configure performance checks
- "performance-*"
- "-performance-enum-size"
# configure readability and bugprone checks
- "readability-*"
- "bugprone-*"
- "misc-*"
- "-readability-braces-around-statements"
- "-readability-function-cognitive-complexity"
- "-readability-identifier-length"
- "-readability-implicit-bool-conversion"
- "-readability-magic-numbers"
- "-readability-math-missing-parentheses"
- "-bugprone-easily-swappable-parameters"
# configure modernization
- "modernize-*"
- "-modernize-use-trailing-return-type"
# configure cppcoreguidelines
- "cppcoreguidelines-*"
- "-cppcoreguidelines-avoid-magic-numbers"
- "-cppcoreguidelines-pro-type-reinterpret-cast" # allows reinterpret_cast
- "-cppcoreguidelines-avoid-non-const-global-variables"
- "-cppcoreguidelines-pro-type-union-access"

View file

@ -1,3 +0,0 @@
*.cpp diff=cpp eol=lf
*.hpp diff=cpp eol=lf
*.md diff=markdown eol=lf

View file

@ -1,9 +0,0 @@
# cmake files
/build
# ide/lsp files
/.zed
/.vscode
/.clangd
/.cache
/.ccls

View file

@ -1,60 +0,0 @@
cmake_minimum_required(VERSION 3.28)
# project
project(lsfg-vk-v3.1p
DESCRIPTION "Lossless Scaling Frame Generation v3.1 (Performance Mode)"
LANGUAGES CXX)
file(GLOB SOURCES
"src/core/*.cpp"
"src/pool/*.cpp"
"src/shaders/*.cpp"
"src/utils/*.cpp"
"src/*.cpp"
)
add_library(lsfg-vk-v3.1p STATIC ${SOURCES})
# target
set_target_properties(lsfg-vk-v3.1p PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON)
target_include_directories(lsfg-vk-v3.1p
PRIVATE include
PUBLIC public)
target_link_libraries(lsfg-vk-v3.1p
PUBLIC lsfg-vk-common vulkan)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_target_properties(lsfg-vk-v3.1p PROPERTIES
INTERPROCEDURAL_OPTIMIZATION ON)
endif()
# diagnostics
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_target_properties(lsfg-vk-v3.1p PROPERTIES
EXPORT_COMPILE_COMMANDS ON)
endif()
if(LSFGVK_EXCESS_DEBUG)
target_compile_options(lsfg-vk-v3.1p PRIVATE
-Weverything
# disable compat c++ flags
-Wno-pre-c++20-compat-pedantic
-Wno-pre-c++17-compat
-Wno-c++98-compat-pedantic
-Wno-c++98-compat
# disable other flags
-Wno-missing-designated-field-initializers
-Wno-shadow # allow shadowing
-Wno-switch-enum # ignore missing cases
-Wno-switch-default # ignore missing default
-Wno-padded # ignore automatic padding
-Wno-exit-time-destructors # allow globals
-Wno-global-constructors # allow globals
-Wno-cast-function-type-strict # for vulkan
)
set_target_properties(lsfg-vk-v3.1p PROPERTIES
CXX_CLANG_TIDY clang-tidy)
endif()

View file

@ -1,21 +0,0 @@
## MIT License
Copyright (c) 2025 lsfg-vk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,14 +0,0 @@
## lsfg-vk-v3.1p
Version 3.1 (Performance Mode) of Lossless Scaling Frame Generation
This is a subproject of lsfg-vk and contains the external Vulkan logic for generating frames.
The project is intentionally structured as a fully external project, such that it can be integrated into other applications.
### Interface
Interfacing with lsfg-vk-v3.1p is done via `lsfg.hpp` header. The internal Vulkan instance is created using `LSFG_3_1P::initialize()` and requires a specific deviceUUID, as well as parts of the lsfg-vk configuration, including a function loading SPIR-V shaders by name. Cleanup is done via `LSFG_3_1P::finalize()` after which `LSFG_3_1P::initialize()` may be called again. Please note that the initialization process is expensive and may take a while. It is recommended to call this function once during the applications lifetime.
Once the format and extent of the requested images is determined, `LSFG_3_1P::createContext()` should be called to initialize a frame generation context. The Vulkan images are created from backing memory, which is passed through the file descriptor arguments. A context can be destroyed using `LSFG_3_1P::deleteContext()`.
Presenting the context can be done via `LSFG_3_1P::presentContext()`. Before calling the function a second time, make sure the outgoing semaphores have been signaled.