Remove application::get_device()

This commit is contained in:
Patrick Nicolas
2025-08-20 22:11:43 +02:00
parent d18d33a615
commit 1390ade131
3 changed files with 3 additions and 9 deletions
-5
View File
@@ -363,11 +363,6 @@ public:
return instance().physical_device_properties;
}
static vk::raii::Device & get_device()
{
return instance().vk_device;
}
static vk::raii::Instance & get_vulkan_instance()
{
return instance().vk_instance;
+2 -3
View File
@@ -18,7 +18,6 @@
#pragma once
#include "application.h"
#include "utils/alignment.h"
#include "vk/allocation.h"
#include <fastgltf/tools.hpp>
@@ -115,10 +114,10 @@ public:
}
}
buffer_allocation copy_to_gpu()
buffer_allocation copy_to_gpu(vk::raii::Device & device)
{
buffer_allocation gpu_buffer{
application::get_device(),
device,
vk::BufferCreateInfo{
.size = bytes.size(),
.usage = usage},
+1 -1
View File
@@ -785,7 +785,7 @@ entt::registry scene_loader::operator()(const std::filesystem::path & gltf_path)
// Copy the staging buffer to the GPU
spdlog::debug("Uploading scene data ({} bytes) to GPU memory", staging_buffer.size());
auto buffer = std::make_shared<buffer_allocation>(staging_buffer.copy_to_gpu());
auto buffer = std::make_shared<buffer_allocation>(staging_buffer.copy_to_gpu(device));
for (auto & i: materials)
i->buffer = buffer;