Files
2026-08-25 16:26:52 -04:00

2.9 KiB

title, type, source, source_url, author, handle, post_id, date, archived, draft, tags, description, in_reply_to
title type source source_url author handle post_id date archived draft tags description in_reply_to
Working towards a new bring up of front-buffering on NV via VK. archive twitter https://x.com/NOTimothyLottes/status/1858709400791261630 NOTimothyLottes NOTimothyLottes 1858709400791261630 2024-11-19 2026-08-24 false
archive
twitter
NOTimothyLottes
Working towards a new bring up of front-buffering on NV via VK.

Source

Thread

1/ @NOTimothyLottes ^1858709400791261630

Working towards a new bring up of front-buffering on NV via VK. My last implementation had been tuned on AMD and didn't work on NV any more. NV does seem to accept a 1-deep swap with IMMEDIATE presentation at least on latest drivers, so that is a good start.

2/ @NOTimothyLottes ^1858710122727391666

Since my image resources are static after init time, only swap images change when the driver kills the swap chain (which once upon a time seemed to happen on ALT+TAB maybe). So it's one descriptor set always bound.

3/ @NOTimothyLottes ^1858710719018979651

Stopped using VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT (god awful naming length people), because I think it could be a perf hit on NV due to extra indirection. NV driver is free to bake down the single set now before the command buffer is sent over.

4/ @NOTimothyLottes ^1858712158004994552

At this stage, to the point of having everything loaded and swap chain created, it's 2700 lines of engine code. That includes embedding headers (no external includes), so it's a one file compile. People claim rolling your own engine is hard? Not really if you keep it focused.

5/ @NOTimothyLottes ^1858713499716694264

So far it's a 0.25 sec hot load time on this NV dGPU laptop. Includes mapping a 4 MiB 'cart' file from pagecache, doing a 512 MiB buffer for GPU usage, hits on all PSOs, allocating some images, and kicking the command buffer that copies in the cart, and clears everything.

6/ @NOTimothyLottes ^1858714108415119495

Everything at load-time is multi-threaded to try to minimize start to in-game time. This is in sharp contrast to runtime where the only multi-threading being used is to separate things that are blocking.

7/ @NOTimothyLottes ^1858714908516381114

I get some utility on parallelizing {vulkan instance creation, mapping the cart file, warming the TLBs by walking all the pages, bringing up the window} it's about 0.08 seconds in at that point

8/ @NOTimothyLottes ^1858715434436227544

After VK device is open, I signal a background thread to load the SPIR-V module, while building the descriptor set layout, which then unblocks PSO compile on background threads. And the rest of the VK setup runs in parallel. Working towards swap creation.