diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2026-05-14 23:30:06 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2026-05-14 23:33:31 +0200 |
| commit | 8f137322da4220aeb3863ff79724644e7e5152a0 (patch) | |
| tree | cceba996b5c78b35190592ba72e5c2643544e57e /src/gltf.cpp | |
| parent | f745ba47651664048a4641676453d06f2319c3d1 (diff) | |
Remove usage of PathFindExtensionA and shlwapi include
Fix input bug due to a switch to main fiber in message handler
Diffstat (limited to 'src/gltf.cpp')
| -rw-r--r-- | src/gltf.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
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<handle<device_texture>>& 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<device_buffer> staging_buffers_handle[buffers_count] = { device.create_buffer({ @@ -289,23 +288,18 @@ static void load_materials(std::vector<material>& materials, std::vector<handle< } } -gltf::gltf(const char* filepath) { +gltf::gltf(const char* filepath, bool is_glb) { BEGIN_MARKER(LOAD_GLTF); ondemand::parser parser; padded_string json; ondemand::document doc; - const char* ext = PathFindExtensionA(filepath); - char buffer_path[2048U] = { 0U }; char* filename = nullptr; GetFullPathNameA( filepath, 2048U, buffer_path, &filename); size_t parent_dir_len = filename - buffer_path; - // TODO: Remove - is_glb = strcmp(ext, ".glb") == 0; - if (is_glb) { size_t filesize = 0U; size_t read = 0U; |
