Some progress
This commit is contained in:
64
external/parallel-rdp/ParallelRDPWrapper.cpp
vendored
64
external/parallel-rdp/ParallelRDPWrapper.cpp
vendored
@@ -5,6 +5,7 @@
|
||||
#include <core/mmio/VI.hpp>
|
||||
#include <resources/vert.spv.h>
|
||||
#include <resources/frag.spv.h>
|
||||
#include <KaizenGui.hpp>
|
||||
|
||||
using namespace Vulkan;
|
||||
using namespace RDP;
|
||||
@@ -156,7 +157,7 @@ void ParallelRDP::DrawFullscreenTexturedQuad(Util::IntrusivePtr<Image> image,
|
||||
cmd->draw(3, 1);
|
||||
}
|
||||
|
||||
void ParallelRDP::UpdateScreen(Util::IntrusivePtr<Image> image) const {
|
||||
void ParallelRDP::UpdateScreen(Util::IntrusivePtr<Image> image, KaizenGui& kaizenGui) const {
|
||||
wsi->begin_frame();
|
||||
|
||||
if (!image) {
|
||||
@@ -182,39 +183,44 @@ void ParallelRDP::UpdateScreen(Util::IntrusivePtr<Image> image) const {
|
||||
|
||||
cmd->begin_render_pass(wsi->get_device().get_swapchain_render_pass(SwapchainRenderPass::ColorOnly));
|
||||
DrawFullscreenTexturedQuad(image, cmd);
|
||||
|
||||
kaizenGui.RenderUI();
|
||||
cmd->end_render_pass();
|
||||
wsi->get_device().submit(cmd);
|
||||
wsi->end_frame();
|
||||
}
|
||||
|
||||
void ParallelRDP::UpdateScreen(const n64::VI &vi) const {
|
||||
command_processor->set_vi_register(VIRegister::Control, vi.status.raw);
|
||||
command_processor->set_vi_register(VIRegister::Origin, vi.origin);
|
||||
command_processor->set_vi_register(VIRegister::Width, vi.width);
|
||||
command_processor->set_vi_register(VIRegister::Intr, vi.intr);
|
||||
command_processor->set_vi_register(VIRegister::VCurrentLine, vi.current);
|
||||
command_processor->set_vi_register(VIRegister::Timing, vi.burst.raw);
|
||||
command_processor->set_vi_register(VIRegister::VSync, vi.vsync);
|
||||
command_processor->set_vi_register(VIRegister::HSync, vi.hsync);
|
||||
command_processor->set_vi_register(VIRegister::Leap, vi.hsyncLeap.raw);
|
||||
command_processor->set_vi_register(VIRegister::HStart, vi.hstart.raw);
|
||||
command_processor->set_vi_register(VIRegister::VStart, vi.vstart.raw);
|
||||
command_processor->set_vi_register(VIRegister::VBurst, vi.vburst);
|
||||
command_processor->set_vi_register(VIRegister::XScale, vi.xscale.raw);
|
||||
command_processor->set_vi_register(VIRegister::YScale, vi.yscale.raw);
|
||||
ScanoutOptions opts;
|
||||
opts.persist_frame_on_invalid_input = true;
|
||||
opts.vi.aa = true;
|
||||
opts.vi.scale = true;
|
||||
opts.vi.dither_filter = true;
|
||||
opts.vi.divot_filter = true;
|
||||
opts.vi.gamma_dither = true;
|
||||
opts.downscale_steps = true;
|
||||
opts.crop_overscan_pixels = true;
|
||||
Util::IntrusivePtr<Image> image = command_processor->scanout(opts);
|
||||
UpdateScreen(image);
|
||||
command_processor->begin_frame_context();
|
||||
void ParallelRDP::UpdateScreen(const n64::VI &vi, KaizenGui& kaizenGui, bool playing) const {
|
||||
if(playing) {
|
||||
command_processor->set_vi_register(VIRegister::Control, vi.status.raw);
|
||||
command_processor->set_vi_register(VIRegister::Origin, vi.origin);
|
||||
command_processor->set_vi_register(VIRegister::Width, vi.width);
|
||||
command_processor->set_vi_register(VIRegister::Intr, vi.intr);
|
||||
command_processor->set_vi_register(VIRegister::VCurrentLine, vi.current);
|
||||
command_processor->set_vi_register(VIRegister::Timing, vi.burst.raw);
|
||||
command_processor->set_vi_register(VIRegister::VSync, vi.vsync);
|
||||
command_processor->set_vi_register(VIRegister::HSync, vi.hsync);
|
||||
command_processor->set_vi_register(VIRegister::Leap, vi.hsyncLeap.raw);
|
||||
command_processor->set_vi_register(VIRegister::HStart, vi.hstart.raw);
|
||||
command_processor->set_vi_register(VIRegister::VStart, vi.vstart.raw);
|
||||
command_processor->set_vi_register(VIRegister::VBurst, vi.vburst);
|
||||
command_processor->set_vi_register(VIRegister::XScale, vi.xscale.raw);
|
||||
command_processor->set_vi_register(VIRegister::YScale, vi.yscale.raw);
|
||||
ScanoutOptions opts;
|
||||
opts.persist_frame_on_invalid_input = true;
|
||||
opts.vi.aa = true;
|
||||
opts.vi.scale = true;
|
||||
opts.vi.dither_filter = true;
|
||||
opts.vi.divot_filter = true;
|
||||
opts.vi.gamma_dither = true;
|
||||
opts.downscale_steps = true;
|
||||
opts.crop_overscan_pixels = true;
|
||||
Util::IntrusivePtr<Image> image = command_processor->scanout(opts);
|
||||
UpdateScreen(image, kaizenGui);
|
||||
command_processor->begin_frame_context();
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateScreen(static_cast<Util::IntrusivePtr<Image>>(nullptr), kaizenGui);
|
||||
}
|
||||
|
||||
void ParallelRDP::EnqueueCommand(int command_length, const u32 *buffer) const {
|
||||
|
||||
6
external/parallel-rdp/ParallelRDPWrapper.hpp
vendored
6
external/parallel-rdp/ParallelRDPWrapper.hpp
vendored
@@ -7,6 +7,8 @@ namespace n64 {
|
||||
struct VI;
|
||||
}
|
||||
|
||||
class KaizenGui;
|
||||
|
||||
class ParallelRDP {
|
||||
public:
|
||||
class WindowInfo {
|
||||
@@ -23,7 +25,7 @@ public:
|
||||
const std::shared_ptr<WindowInfo> &, const u8 *);
|
||||
ParallelRDP() = default;
|
||||
|
||||
void UpdateScreen(const n64::VI &) const;
|
||||
void UpdateScreen(const n64::VI &, KaizenGui&, bool = true) const;
|
||||
void EnqueueCommand(int, const u32 *) const;
|
||||
void OnFullSync() const;
|
||||
bool IsFramerateUnlocked() const;
|
||||
@@ -36,5 +38,5 @@ public:
|
||||
private:
|
||||
void LoadWSIPlatform(const std::shared_ptr<Vulkan::WSIPlatform> &, const std::shared_ptr<WindowInfo> &);
|
||||
void DrawFullscreenTexturedQuad(Util::IntrusivePtr<Vulkan::Image>, Util::IntrusivePtr<Vulkan::CommandBuffer>) const;
|
||||
void UpdateScreen(Util::IntrusivePtr<Vulkan::Image>) const;
|
||||
void UpdateScreen(Util::IntrusivePtr<Vulkan::Image>, KaizenGui&) const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user