Files
fs2open.github.com/code/graphics/vulkan/gr_vulkan.cpp
T
asarium fbdb25a10d Add more Vulkan setup code
This adds the Vulkan code for choosing a physical device, creating a
logical device from that and then initializing a swap chain.

This also contains code for filling out the graphics API pointers with
stub functions so that the API functions can be developed gradually.
These changes allow FSO to "run" with Vulkan but nothing is rendered
yet.
2020-08-20 19:08:02 +02:00

36 lines
710 B
C++

#include "gr_vulkan.h"
#include "VulkanRenderer.h"
#include "vulkan_stubs.h"
#include "mod_table/mod_table.h"
namespace graphics {
namespace vulkan {
namespace {
std::unique_ptr<VulkanRenderer> renderer_instance;
}
bool initialize(std::unique_ptr<os::GraphicsOperations>&& graphicsOps)
{
renderer_instance.reset(new VulkanRenderer(std::move(graphicsOps)));
if (!renderer_instance->initialize()) {
return false;
}
init_stub_pointers();
// Nothing else is finished so always fail here
mprintf(("Vulkan support is not finished yet so graphics initialization will always fail...\n"));
return true;
}
void cleanup() {
renderer_instance = nullptr;
}
} // namespace vulkan
} // namespace graphics