From ad064112e6208f4c532f2f358f7c394e2c4126cc Mon Sep 17 00:00:00 2001 From: Asuro Date: Wed, 19 Feb 2025 00:38:02 +0100 Subject: [PATCH] vulkan i guess --- .gitmodules | 6 ++++++ src/CMakeLists.txt | 19 ++++++++++++++++--- src/dependency/Vulkan-Headers | 1 + src/game/rendering/Rendering.cpp | 2 +- tools/remedy-session.rdbg | Bin 706 -> 504 bytes 5 files changed, 24 insertions(+), 4 deletions(-) create mode 160000 src/dependency/Vulkan-Headers diff --git a/.gitmodules b/.gitmodules index cb9052f..da1a1fe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -11,3 +11,9 @@ path = src/dependency/imgui url = https://github.com/ocornut/imgui branch = docking +[submodule "src/dependency/--force"] + path = src/dependency/--force + url = https://github.com/KhronosGroup/Vulkan-Headers +[submodule "src/dependency/Vulkan-Headers"] + path = src/dependency/Vulkan-Headers + url = https://github.com/KhronosGroup/Vulkan-Headers diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a12d979..0d1ea85 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,10 +13,22 @@ endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$") +# Vulkan i guess +find_package(Vulkan REQUIRED) + +# Imgui +file(GLOB imgui_sources dependency/imgui/*.h dependency/imgui/*.cpp) +file(GLOB imgui_backend + dependency/imgui/backends/imgui_impl_vulkan.h + dependency/imgui/backends/imgui_impl_vulkan.cpp + dependency/imgui/backends/imgui_impl_sdl3.h + dependency/imgui/backends/imgui_impl_sdl3.cpp) + # Engine file(GLOB_RECURSE sources_engine engine/*.cpp engine/*.h) -add_executable(PuzGameEngine ${sources_engine}) +add_executable(PuzGameEngine ${sources_engine} ${imgui_sources} ${imgui_backend}) set_property(TARGET PuzGameEngine PROPERTY CXX_STANDARD 17) +target_include_directories(PuzGameEngine PUBLIC dependency/imgui dependency/Vulkan-Headers/include) #file(COPY ${data} DESTINATION resources) #target_compile_options(PuzGameEngine PUBLIC xyz) @@ -25,8 +37,9 @@ set_property(TARGET PuzGameEngine PROPERTY CXX_STANDARD 17) # Game file(GLOB_RECURSE sources_game game/*.cpp game/*.h) file(GLOB source_singleheader dependency/tinygltf/stb_image.h dependency/tinygltf/stb_image_write.h dependency/tinygltf/json.hpp dependency/tinygltf/tiny_gltf.h) -add_library(PuzGame SHARED ${sources_game} ${source_singleheader}) +add_library(PuzGame SHARED ${sources_game} ${source_singleheader} ${imgui_sources}) set_property(TARGET PuzGame PROPERTY CXX_STANDARD 17) +target_include_directories(PuzGame PUBLIC dependency/imgui) # SDL add_subdirectory("${CMAKE_SOURCE_DIR}/dependency/SDL" EXCLUDE_FROM_ALL) @@ -38,5 +51,5 @@ add_subdirectory("${CMAKE_SOURCE_DIR}/dependency/bgfx.cmake") # Link target_link_libraries(PuzGame bx bimg bgfx) -target_link_libraries(PuzGameEngine bx SDL3::SDL3) +target_link_libraries(PuzGameEngine bx SDL3::SDL3 Vulkan::Vulkan) set_target_properties(PuzGame PROPERTIES OUTPUT_NAME "PuzGame2") diff --git a/src/dependency/Vulkan-Headers b/src/dependency/Vulkan-Headers new file mode 160000 index 0000000..234c4b7 --- /dev/null +++ b/src/dependency/Vulkan-Headers @@ -0,0 +1 @@ +Subproject commit 234c4b7370a8ea3239a214c9e871e4b17c89f4ab diff --git a/src/game/rendering/Rendering.cpp b/src/game/rendering/Rendering.cpp index d4b906e..0951305 100644 --- a/src/game/rendering/Rendering.cpp +++ b/src/game/rendering/Rendering.cpp @@ -193,7 +193,7 @@ namespace Game SharedData& shared = GetShared(); bgfx::Init init; - init.type = bgfx::RendererType::Direct3D12; + init.type = bgfx::RendererType::Vulkan; init.debug = true; init.platformData.nwh = shared.Window.Handle; init.platformData.ndt = nullptr; diff --git a/tools/remedy-session.rdbg b/tools/remedy-session.rdbg index f3d051b4daadf72e4e533a31010f1cdb207d2bb0..d79a9e6b8569ded864edcc6d854f98918919f08d 100644 GIT binary patch delta 116 zcmX@a`h$6b7YjQB1HxsVv38BV@fiLQWH}^3MMaPlAUbBq%k>wNn~;W6Av3B N0|NsC$7Dw)eE^8=BOm|( delta 175 zcmeyte28^|7Yi2y1H)t$MlFH#w2GMGqU4yQ^t1}S52a0 zlVus%C;CZD{KLs;FnkKt?GzwWPEF zWF!Lv0|O%i0|PGu14Bw;NusVDh}1DQntY#8baFML#^g7QJd=AECAdJU7&t)6CpR*x GfP?{yD>A_V