mirror of
https://github.com/slendidev/lunar.git
synced 2026-01-30 16:28:58 +02:00
10
flake.lock
generated
10
flake.lock
generated
@@ -20,12 +20,12 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1764517877,
|
||||
"narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=",
|
||||
"rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c",
|
||||
"revCount": 904649,
|
||||
"lastModified": 1767892417,
|
||||
"narHash": "sha256-dhhvQY67aboBk8b0/u0XB6vwHdgbROZT3fJAjyNh5Ww=",
|
||||
"rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba",
|
||||
"revCount": 924538,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.904649%2Brev-2d293cbfa5a793b4c50d17c05ef9e385b90edf6c/019ad7f2-e8f3-79e9-ad92-dd7a45c069d3/source.tar.gz?rev=2d293cbfa5a793b4c50d17c05ef9e385b90edf6c&revCount=904649"
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.924538%2Brev-3497aa5c9457a9d88d71fa93a4a8368816fbeeba/019ba2f6-9b41-7674-b81c-5f768968b13a/source.tar.gz?rev=3497aa5c9457a9d88d71fa93a4a8368816fbeeba&revCount=924538"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
doxygen
|
||||
gtest
|
||||
cppcheck
|
||||
tracy
|
||||
]
|
||||
++ buildInputs
|
||||
++ nativeBuildInputs
|
||||
|
||||
62
meson.build
62
meson.build
@@ -18,13 +18,13 @@ fastgltf = cmake.subproject('fastgltf', options: fastgltf_opts)
|
||||
|
||||
cc = meson.get_compiler('cpp')
|
||||
|
||||
wayland_dep = dependency('wayland-server')
|
||||
vulkan_dep = dependency('vulkan')
|
||||
openxr_dep = dependency('openxr')
|
||||
zlib_dep = dependency('zlib')
|
||||
sdl3_dep = dependency('sdl3')
|
||||
libinput_dep = dependency('libinput')
|
||||
libudev_dep = dependency('libudev')
|
||||
wayland_dep = dependency('wayland-server', include_type: 'system')
|
||||
vulkan_dep = dependency('vulkan', include_type: 'system')
|
||||
openxr_dep = dependency('openxr', include_type: 'system')
|
||||
zlib_dep = dependency('zlib', include_type: 'system')
|
||||
sdl3_dep = dependency('sdl3', include_type: 'system')
|
||||
libinput_dep = dependency('libinput', include_type: 'system')
|
||||
libudev_dep = dependency('libudev', include_type: 'system')
|
||||
imgui_src = files(
|
||||
'thirdparty/imgui/imgui.cpp',
|
||||
'thirdparty/imgui/imgui_draw.cpp',
|
||||
@@ -37,9 +37,25 @@ fastgltf_dep = fastgltf.dependency('fastgltf')
|
||||
|
||||
vkbootstrap_dev = get_option('vkbootstrap_dev')
|
||||
vkbootstrap_lib = get_option('vkbootstrap_lib')
|
||||
tracy_enable = get_option('tracy_enable')
|
||||
|
||||
if tracy_enable and get_option('buildtype') != 'debugoptimized'
|
||||
warning('Profiling builds should set --buildtype=debugoptimized')
|
||||
endif
|
||||
|
||||
tracy = disabler()
|
||||
if tracy_enable
|
||||
tracy_proj = subproject('tracy', default_options: [
|
||||
'default_library=static',
|
||||
'warning_level=0',
|
||||
'werror=false',
|
||||
])
|
||||
tracy = tracy_proj.get_variable('tracy_dep')
|
||||
endif
|
||||
|
||||
vkbootstrap_inc = include_directories(
|
||||
join_paths(vkbootstrap_dev, 'include')
|
||||
join_paths(vkbootstrap_dev, 'include'),
|
||||
is_system: true,
|
||||
)
|
||||
|
||||
vkbootstrap_dep = cc.find_library(
|
||||
@@ -78,6 +94,7 @@ add_project_arguments(
|
||||
'-Wno-exit-time-destructors',
|
||||
'-Wno-zero-as-null-pointer-constant',
|
||||
'-Wno-unused-macros',
|
||||
'-Wno-reserved-macro-identifier',
|
||||
'-Wno-suggest-override',
|
||||
'-Wno-macro-redefined',
|
||||
'-DVULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE',
|
||||
@@ -114,6 +131,21 @@ imgui_lib = static_library('imgui',
|
||||
],
|
||||
)
|
||||
|
||||
exe_deps = [
|
||||
wayland_dep,
|
||||
vulkan_dep,
|
||||
openxr_dep,
|
||||
vkbootstrap_dep,
|
||||
zlib_dep,
|
||||
sdl3_dep,
|
||||
fastgltf_dep,
|
||||
libinput_dep,
|
||||
libudev_dep,
|
||||
]
|
||||
if tracy_enable
|
||||
exe_deps += tracy
|
||||
endif
|
||||
|
||||
exe = executable('vr-compositor',
|
||||
[
|
||||
'src/main.cpp',
|
||||
@@ -136,18 +168,8 @@ exe = executable('vr-compositor',
|
||||
'thirdparty/smath/include'
|
||||
],
|
||||
link_with: imgui_lib,
|
||||
dependencies: [
|
||||
wayland_dep,
|
||||
vulkan_dep,
|
||||
openxr_dep,
|
||||
vkbootstrap_dep,
|
||||
zlib_dep,
|
||||
sdl3_dep,
|
||||
fastgltf_dep,
|
||||
libinput_dep,
|
||||
libudev_dep,
|
||||
],
|
||||
dependencies: exe_deps,
|
||||
cpp_args: [
|
||||
'--embed-dir=' + join_paths(meson.project_build_root(), 'shaders')
|
||||
'--embed-dir=' + join_paths(meson.project_build_root(), 'shaders'),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
option('vkbootstrap_dev', type: 'string', description: 'vk-bootstrap dev output path')
|
||||
option('vkbootstrap_lib', type: 'string', description: 'vk-bootstrap lib output path')
|
||||
option('tracy_enable', type: 'boolean', value: false, description: 'Enable profiling')
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
#include "Util.h"
|
||||
#include "VulkanRenderer.h"
|
||||
|
||||
#if defined(TRACY_ENABLE)
|
||||
# include <tracy/Tracy.hpp>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
int open_restricted(char const *path, int flags, void * /*user_data*/)
|
||||
@@ -424,6 +428,9 @@ auto Application::run() -> void
|
||||
uint64_t last { 0 };
|
||||
float fps { 0.0f };
|
||||
while (m_running) {
|
||||
#if defined(TRACY_ENABLE)
|
||||
ZoneScopedN("Frame");
|
||||
#endif
|
||||
uint64_t now { SDL_GetTicks() };
|
||||
uint64_t dt { now - last };
|
||||
float dt_seconds { static_cast<float>(dt) / 1000.0f };
|
||||
@@ -613,6 +620,9 @@ auto Application::run() -> void
|
||||
ImGui::Render();
|
||||
|
||||
m_renderer->render([&](VulkanRenderer::GL &gl) {
|
||||
#if defined(TRACY_ENABLE)
|
||||
ZoneScopedN("Render");
|
||||
#endif
|
||||
auto view { smath::matrix_look_at(
|
||||
m_camera.position, m_camera.target, m_camera.up) };
|
||||
auto const draw_extent = m_renderer->draw_extent();
|
||||
@@ -670,6 +680,9 @@ auto Application::run() -> void
|
||||
|
||||
gl.draw_sphere(m_camera.target, 0.01f);
|
||||
});
|
||||
#if defined(TRACY_ENABLE)
|
||||
FrameMark;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <span>
|
||||
|
||||
#include <vulkan/vk_enum_string_helper.h>
|
||||
#include <vulkan/vulkan.hpp>
|
||||
|
||||
template<typename F> struct privDefer {
|
||||
|
||||
Reference in New Issue
Block a user