ditch multi-system idea

This commit is contained in:
CocoSimone
2022-08-06 11:19:45 +02:00
parent ef29e4797c
commit c5303ede59
58 changed files with 74 additions and 82 deletions

View File

@@ -12,6 +12,7 @@ using namespace RDP;
static CommandProcessor* command_processor;
static WSI* wsi;
static std::unique_ptr<ParallelRdpWindowInfo> windowInfo;
std::vector<Semaphore> acquire_semaphore;
@@ -109,14 +110,17 @@ public:
Program* fullscreen_quad_program;
void LoadWSIPlatform() {
WSI* LoadWSIPlatform(Vulkan::WSIPlatform* wsi_platform, std::unique_ptr<ParallelRdpWindowInfo>&& newWindowInfo) {
wsi = new WSI();
wsi->set_backbuffer_srgb(false);
wsi->set_platform(new SDLWSIPlatform());
wsi->set_platform(wsi_platform);
Context::SystemHandles handles;
if (!wsi->init_context_from_platform(1, handles)) {
util::panic("Failed to initialize WSI!");
}
windowInfo = std::move(newWindowInfo);
return wsi;
}
void LoadParallelRDP(const u8* rdram) {
@@ -161,6 +165,11 @@ void LoadParallelRDP(const u8* rdram) {
}
}
void InitParallelRDP(const u8* rdram) {
LoadWSIPlatform(new SDLWSIPlatform(), std::make_unique<SDLParallelRdpWindowInfo>());
LoadParallelRDP(rdram);
}
void DrawFullscreenTexturedQuad(Util::IntrusivePtr<Image> image, Util::IntrusivePtr<CommandBuffer> cmd) {
cmd->set_texture(0, 0, image->get_view(), Vulkan::StockSampler::LinearClamp);
cmd->set_program(fullscreen_quad_program);

View File

@@ -1,12 +1,30 @@
#pragma once
#include <n64/Core.hpp>
#include <Core.hpp>
#include <wsi.hpp>
#include <SDL2/SDL.h>
#include <n64/core/mmio/VI.hpp>
struct Window;
static SDL_Window* window;
class ParallelRdpWindowInfo {
public:
struct CoordinatePair {
int x;
int y;
};
virtual CoordinatePair get_window_size() = 0;
virtual ~ParallelRdpWindowInfo() = default;
};
class SDLParallelRdpWindowInfo : public ParallelRdpWindowInfo {
CoordinatePair get_window_size() {
int width, height;
SDL_GetWindowSize(window, &width, &height);
return CoordinatePair{ width, height };
}
};
static u32 windowID;
VkQueue GetGraphicsQueue();
VkInstance GetVkInstance();
@@ -16,11 +34,10 @@ uint32_t GetVkGraphicsQueueFamily();
VkFormat GetVkFormat();
VkCommandBuffer GetVkCommandBuffer();
void SubmitRequestedVkCommandBuffer();
void LoadWSIPlatform();
void LoadParallelRDP(const u8* rdram);
void InitParallelRDP(const u8* rdram);
void UpdateScreenParallelRdp(Window& imguiWindow, const n64::VI& vi);
void ParallelRdpEnqueueCommand(int command_length, u32* buffer);
void ParallelRdpOnFullSync();
void UpdateScreenParallelRdpNoGame(Window& imguiWindow);
bool IsFramerateUnlocked();
void SetFramerateUnlocked(bool unlocked);
void SetFramerateUnlocked(bool unlocked);