aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gltf.cpp16
-rw-r--r--src/main.cpp1
-rw-r--r--src/scene.cpp4
-rw-r--r--src/window.cpp2
4 files changed, 7 insertions, 16 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;
diff --git a/src/main.cpp b/src/main.cpp
index 4d56a3c..74bb655 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -12,7 +12,6 @@
#include <winuser.h>
#include <winnls.h>
#include <fileapi.h>
- #include <shlwapi.h>
#include <handleapi.h>
#include <errhandlingapi.h>
#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;
}