From 8f137322da4220aeb3863ff79724644e7e5152a0 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Thu, 14 May 2026 23:30:06 +0200 Subject: Remove usage of PathFindExtensionA and shlwapi include Fix input bug due to a switch to main fiber in message handler --- src/gltf.cpp | 16 +++++----------- src/main.cpp | 1 - src/scene.cpp | 4 ++-- src/window.cpp | 2 -- 4 files changed, 7 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gltf.cpp b/src/gltf.cpp index 2ddf16a..3e0af7d 100644 --- a/src/gltf.cpp +++ b/src/gltf.cpp @@ -166,12 +166,11 @@ static void load_textures(char* path, std::vector>& textu vkdevice& device = vkdevice::get(); constexpr auto buffers_count = 2U; - auto total_size = images.size() * 4096U * 4096 * sizeof(uint32_t); + size_t total_size = images.size() * 4096U * 4096 * sizeof(uint32_t); // TODO: Fix nasty stuff going on - // Crash on buffer destruction - // Load wrong images - // auto buffer_size = total_size / 32U; - auto buffer_size = total_size / 2U; + // Crash on buffer destruction and load wrong images + // size_t buffer_size = total_size / 32U; + size_t buffer_size = total_size / 4U; handle staging_buffers_handle[buffers_count] = { device.create_buffer({ @@ -289,23 +288,18 @@ static void load_materials(std::vector& materials, std::vector #include #include - #include #include #include #endif // _WIN32 diff --git a/src/scene.cpp b/src/scene.cpp index 9369eae..d8533f9 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -55,13 +55,13 @@ metadata::metadata(const camera &cam, uint32_t width, uint32_t height) : cam(cam), width(width), height(height) {} scene::scene(const camera& cam, uint32_t width, uint32_t height) - // :model("../models/sponza/Sponza.gltf"), meta(cam, width, height) { + :model("../models/sponza/Sponza.gltf"), meta(cam, width, height) { // :model("../models/BistroInterior/BistroInterior.gltf"), meta(cam, width, height) { // :model("../models/BistroExterior/BistroExterior.gltf"), meta(cam, width, height) { // :model("../models/sponza-avif-hi.glb"), meta(cam, width, height) { // :model("../models/main_sponza/NewSponza_Main_glTF_003.gltf"), meta(cam, width, height) { // :model("../models/pkg_a_curtains/NewSponza_Curtains_glTF.gltf"), meta(cam, width, height) { - :model("../models/sponza.glb"), meta(cam, width, height) { + // :model("../models/sponza.glb", true), meta(cam, width, height) { auto& device = vkdevice::get(); diff --git a/src/window.cpp b/src/window.cpp index 38c9765..b2c25fd 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -425,8 +425,6 @@ LRESULT window::message_handler(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM lpar } } - SwitchToFiber(main_fiber); - return 0; } -- cgit v1.3