update parallel rdp

This commit is contained in:
Logan McNaughton committed 2022-09-06 21:18:29 -06:00
1 parent f968a9f221
commit 775acb5ae9
3 files changed
+18 -4

No files matched your search

+16 -4
View File
@@ -31,6 +31,9 @@ bool vk_vi_aa, vk_vi_scale, vk_dither_filter;
bool vk_interlacing;
static uint64_t rdp_sync_signal;
static uint64_t last_frame_counter;
uint64_t frame_counter;
static const unsigned cmd_len_lut[64] = {
1, 1, 1, 1, 1, 1, 1, 1, 4, 6, 12, 14, 12, 14, 20, 22,
@@ -378,14 +381,20 @@ void vk_process_commands()
return;
}
if (command >= 8 && processor)
if (command >= 8)
processor->enqueue_command(cmd_length * 2, &cmd_data[2 * cmd_cur]);
if (RDP::Op(command) == RDP::Op::SyncFull)
{
// For synchronous RDP:
if (vk_synchronous && processor)
rdp_sync_signal = processor->signal_timeline();
if (vk_synchronous)
{
if (frame_counter != last_frame_counter) // Only sync once per frame
rdp_sync_signal = processor->signal_timeline();
else
rdp_sync_signal = 0;
last_frame_counter = frame_counter;
}
*gfx.MI_INTR_REG |= DP_INTERRUPT;
*GET_GFX_INFO(DPC_STATUS_REG) &= ~(DP_STATUS_PIPE_BUSY | DP_STATUS_START_GCLK);
gfx.CheckInterrupts();
@@ -402,7 +411,7 @@ void vk_process_commands()
void vk_full_sync()
{
if (vk_synchronous && processor)
if (vk_synchronous && rdp_sync_signal)
processor->wait_for_timeline(rdp_sync_signal);
}
@@ -502,5 +511,8 @@ bool vk_init()
screen_set_mode(window_fullscreen);
wsi->begin_frame();
last_frame_counter = 0;
frame_counter = 0;
return true;
}
+1
View File
@@ -60,4 +60,5 @@ m64p_error screen_get_instance_extensions(const char ** ext[], uint32_t* ext_num
void screen_frame_count()
{
CoreVideo_SwapCounter();
++frame_counter;
}
+1
View File
@@ -21,6 +21,7 @@ extern "C"
extern uint32_t window_width;
extern uint32_t window_height;
extern bool window_vsync;
extern uint64_t frame_counter;
#ifdef __cplusplus
}