Window shows up!

This commit is contained in:
2026-06-05 17:48:11 +02:00
parent 4b9b26f8af
commit 74d9831d68
21 changed files with 433 additions and 709 deletions
+11 -6
View File
@@ -4,7 +4,6 @@
#include <rdp_device.hpp>
#include <resources/vert.spv.h>
#include <resources/frag.spv.h>
#include <KaizenGui.hpp>
using namespace Vulkan;
using namespace RDP;
@@ -23,7 +22,8 @@ Program *fullscreen_quad_program;
// Copied and modified from WSI::init_context_from_platform
Util::IntrusivePtr<Context> InitVulkanContext(WSIPlatform *platform, const unsigned num_thread_indices,
const Context::SystemHandles &system_handles) {
const Context::SystemHandles &system_handles,
Vulkan::InstanceFactory *instanceFactory) {
VK_ASSERT(platform);
const auto instance_ext = platform->get_instance_extensions();
const auto device_ext = platform->get_device_extensions();
@@ -32,6 +32,9 @@ Util::IntrusivePtr<Context> InitVulkanContext(WSIPlatform *platform, const unsig
new_context->set_application_info(platform->get_application_info());
new_context->set_num_thread_indices(num_thread_indices);
new_context->set_system_handles(system_handles);
if (instanceFactory) {
new_context->set_instance_factory(instanceFactory);
}
if (!new_context->init_instance(instance_ext.data(), instance_ext.size(),
CONTEXT_CREATION_ENABLE_ADVANCED_WSI_BIT)) {
@@ -55,14 +58,15 @@ Util::IntrusivePtr<Context> InitVulkanContext(WSIPlatform *platform, const unsig
}
void ParallelRDP::LoadWSIPlatform(const std::shared_ptr<WSIPlatform> &wsi_platform,
const std::shared_ptr<WindowInfo> &newWindowInfo) {
const std::shared_ptr<WindowInfo> &newWindowInfo,
Vulkan::InstanceFactory *instanceFactory) {
wsi = std::make_shared<WSI>();
wsi->set_backbuffer_srgb(false);
wsi->set_platform(wsi_platform.get());
wsi->set_present_mode(PresentMode::SyncToVBlank);
if (constexpr Context::SystemHandles handles;
!wsi->init_from_existing_context(InitVulkanContext(wsi_platform.get(), 1, handles))) {
!wsi->init_from_existing_context(InitVulkanContext(wsi_platform.get(), 1, handles, instanceFactory))) {
panic("Failed to initialize WSI: init_from_existing_context() failed");
}
@@ -78,8 +82,9 @@ void ParallelRDP::LoadWSIPlatform(const std::shared_ptr<WSIPlatform> &wsi_platfo
}
void ParallelRDP::Init(const std::shared_ptr<WSIPlatform> &wsiPlatform,
const std::shared_ptr<WindowInfo> &newWindowInfo, const u8 *rdram) {
LoadWSIPlatform(wsiPlatform, newWindowInfo);
const std::shared_ptr<WindowInfo> &newWindowInfo, Vulkan::InstanceFactory *instanceFactory,
const u8 *rdram) {
LoadWSIPlatform(wsiPlatform, newWindowInfo, instanceFactory);
ResourceLayout vertLayout;
ResourceLayout fragLayout;