render/d3d11: adjust allowed frame 'latency' (frames-in-queue) based on number of active windows, to not unnecessarily block if we have two windows to build frames for; demon/linux: sketch out register writing path, ensure reg read/write paths have slots for other architectures

This commit is contained in:
Ryan Fleury
2025-07-31 14:09:42 -07:00
parent ad735dab5e
commit 1a19bf9663
4 changed files with 203 additions and 156 deletions
+4
View File
@@ -548,6 +548,8 @@ r_window_equip(OS_Handle handle)
r_d3d11_state->device->lpVtbl->CreateRenderTargetView(r_d3d11_state->device, (ID3D11Resource *)window->framebuffer, &framebuffer_rtv_desc, &window->framebuffer_rtv);
result = r_d3d11_handle_from_window(window);
r_d3d11_state->window_count += 1;
r_d3d11_state->dxgi_device->lpVtbl->SetMaximumFrameLatency(r_d3d11_state->dxgi_device, Clamp(1, r_d3d11_state->window_count, 16));
}
ProfEnd();
return result;
@@ -571,6 +573,8 @@ r_window_unequip(OS_Handle handle, R_Handle equip_handle)
window->swapchain->lpVtbl->Release(window->swapchain);
window->generation += 1;
SLLStackPush(r_d3d11_state->first_free_window, window);
r_d3d11_state->window_count -= 1;
r_d3d11_state->dxgi_device->lpVtbl->SetMaximumFrameLatency(r_d3d11_state->dxgi_device, Clamp(1, r_d3d11_state->window_count, 16));
}
ProfEnd();
}
+1
View File
@@ -129,6 +129,7 @@ struct R_D3D11_State
{
// rjf: state
Arena *arena;
U64 window_count;
R_D3D11_Window *first_free_window;
R_D3D11_Tex2D *first_free_tex2d;
R_D3D11_Buffer *first_free_buffer;