Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New staging #742

Merged
merged 62 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
231996c
vk: move BOUNDED_ARRAY to arrays.h
w23 May 30, 2024
db7ca29
NOT TESTED vk: stage images using new mechanism
w23 May 30, 2024
243ef25
vk: fixup new image staging
w23 May 30, 2024
ddbad5e
vk: silence sync validation woes around image clearing
w23 May 31, 2024
7502303
vk: silence inefficient buffer barrier usage validation messages
w23 Nov 26, 2024
ade78d0
vk: add logs to staging
w23 Nov 27, 2024
c1f629d
vk: do not upload emissive materials twice
w23 Nov 27, 2024
dadc47c
vk: add PTR_CAST to slience -Werror=cast-align
w23 Nov 29, 2024
0e79f69
vk: fixup printf types to fix linux build
w23 Nov 29, 2024
c66ac8d
vk: fixup printf format of VkBuffer for 32bit
w23 Nov 29, 2024
5001c22
vk: rt: make all kusochki functions internal and static
w23 Nov 30, 2024
7ea67a0
vk: cleanup unused staging code
w23 Dec 5, 2024
dda1a30
vk: [WIP|BROKEN] begin massive staging and barrier refactoring
w23 Dec 6, 2024
85c3cb1
vk: fix compilation errors; up vk to 1.3 and use synchronization2
w23 Dec 7, 2024
62f140a
vk: start using the new combuf-barriers thing
w23 Dec 7, 2024
97ed9c2
vk: rt: tweak output image staging to allow for a couple more frames …
w23 Dec 9, 2024
239f374
oh god why
w23 Dec 9, 2024
43fc05f
vk: add a pile of new staging/sync debug log messages
w23 Dec 9, 2024
cede8dd
vk: fix serious submit synchronization issue
w23 Dec 9, 2024
2f6755c
vk: remove duplicate stage flags from logs
w23 Dec 10, 2024
44da344
vk: issue index+vertex geom buf barrier for trad rendering only
w23 Dec 10, 2024
5d5f70d
vk: precalculate gamma table early at startup
w23 Dec 10, 2024
0ce6da2
ci: update vulkan sdk version for
w23 Dec 10, 2024
51f120b
ci: update ubuntu to 22.04
w23 Dec 10, 2024
80f4069
ci: don't forget to update ubuntu name you dummy
w23 Dec 10, 2024
a9cf15b
vk: fixup printf types to fix linux build
w23 Dec 10, 2024
116214c
vk: fixup printf for 32-bit linux
w23 Dec 10, 2024
8afa9e7
vk: yet another 32 bit linux fixup
w23 Dec 10, 2024
485e986
vk: rt: upload more staged buffers
w23 Dec 10, 2024
1354bb1
vk: minor metadata and things update
w23 Dec 10, 2024
bf53d6d
vk: do not print light stats if there are no brush lights
w23 Dec 10, 2024
8406ee1
vk: improve staging debug tracking
w23 Dec 10, 2024
8794685
wasuremono!
w23 Dec 10, 2024
2b5a02c
vk: rt: fix glitched dynamic geometry by actually tracking counts pro…
w23 Dec 10, 2024
a4eb783
vk: update todo
w23 Dec 11, 2024
637b4d2
vk: make image upload cancel function private
w23 Dec 12, 2024
e7dcf3d
vk: just a bit of cleaning commented out stuff
w23 Dec 12, 2024
96667c7
vk: rt: deduse barriers automatically for buffers too
w23 Dec 12, 2024
6146adc
vk: WIP begin using combuf barriers for images
w23 Dec 12, 2024
7b93e13
ignore ./prefix directory too
w23 Dec 12, 2024
d20e868
vk: rt: fixup resource-image tracking
w23 Dec 13, 2024
4a3ec4f
vk: track pending staging items and push on frame end
w23 Dec 15, 2024
0fcb033
vk: add per-user staging stats
w23 Dec 15, 2024
3cf98c1
vk: rt: build BLASes lazily
w23 Dec 16, 2024
221da26
vk: rt: build all BLASes in a single command
w23 Dec 16, 2024
6632b1b
vk: rt: fixup linux build; clean a few things
w23 Dec 16, 2024
6643204
vk: rt: use combuf barriers for accels_buffer
w23 Dec 16, 2024
86c3cb7
vk: set up framebuffer image in swapchain
w23 Dec 16, 2024
4e7ff4e
vk: change verbose logs src/dst+acces/stage order a bit for combuf ba…
w23 Dec 16, 2024
513396c
vk: make ReadPixels use combuf barriers
w23 Dec 16, 2024
4fb325a
vk: minor comments update
w23 Dec 16, 2024
f9b5cc8
vk: specity transfer stages more precisely
w23 Dec 16, 2024
814458a
vk: rt: remove unnecessary accel frame boundary func
w23 Dec 17, 2024
4a19583
vk: s/alloc|free/lock|unlock/ for staging for readability
w23 Dec 17, 2024
7217b69
vk: fix unintended clearing of images on barriers
w23 Dec 17, 2024
38ae4fe
vk: allow specifying color for image clearing
w23 Dec 17, 2024
5e66d6d
vk: rt: cleanup TLAS creation and building code
w23 Dec 18, 2024
e76d6d9
vk: update TODO
w23 Dec 18, 2024
8fb8ede
vk: handle emissive brush surfaces earlier in the loading loop
w23 Dec 18, 2024
149cd01
vk: remove old validation message silencing workaround
w23 Dec 19, 2024
6ac2fe3
vk: use correct swapchain image sync state
w23 Dec 19, 2024
9ad0888
vk: also print out current resolution for r_speeds
w23 Dec 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
vk: minor comments update
w23 committed Dec 16, 2024
commit 4fb325aec17c879dd2870208806a8ac1e1e9b721
14 changes: 8 additions & 6 deletions ref/vk/TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
## Next
- [ ] Proper staging-vs-frame tracking, replace tag with something sensitive
- currently assert fails because there's 2 frame latency, not one.
- [ ] comment for future: full staging might want to wait for previous frame to finish

## Upcoming
- [ ] framectl frame tracking, e.g.:
@@ -16,9 +13,14 @@
- [ ] performance profiling and comparison

## 2024-12-12 E384
- [ ] zero vkCmdPipelineBarriers calls
- [x] track image sync state with image (and not with resource)
- [ ] grep for anything else
- [x] track image sync state with the image object itself (and not with vk_resource)

### After stream
- [x] Proper staging-vs-frame tracking, replace tag with something sensitive
- currently assert fails because there's 1 frame latency, not one.
- [x] comment for future: full staging might want to wait for previous frame to finish
- [x] zero vkCmdPipelineBarriers calls
- [x] grep for anything else

## 2024-12-10 E383
- [x] Add transfer stage to submit semaphore separating command buffer: fixes sync for rt
8 changes: 2 additions & 6 deletions ref/vk/vk_image.c
Original file line number Diff line number Diff line change
@@ -315,8 +315,7 @@ void R_VkImageUploadCommit( struct vk_combuf_s *combuf, VkPipelineStageFlagBits

// 1.b Invoke the barriers
vkCmdPipelineBarrier(combuf->cmdbuf,
//VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT,
0, 0, NULL, 0, NULL,
barriers_count, g_image_upload.barriers.items
@@ -397,10 +396,7 @@ void R_VkImageUploadCommit( struct vk_combuf_s *combuf, VkPipelineStageFlagBits
}

// 3.b Submit the barriers
/* const VkPipelineStageFlagBits dest_stages = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | ( */
/* vk_core.rtx */
/* ? VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR */
/* : 0); */
// It's a massive set of barriers (1e3+), so using manual barriers instead of automatic combuf ones
vkCmdPipelineBarrier(combuf->cmdbuf,
VK_PIPELINE_STAGE_TRANSFER_BIT, dst_stages,
0, 0, NULL, 0, NULL,
4 changes: 4 additions & 0 deletions ref/vk/vk_staging.c
Original file line number Diff line number Diff line change
@@ -125,6 +125,10 @@ uint32_t R_VkStagingFrameEpilogue(vk_combuf_t* combuf) {
ASSERT(user->pending_count == 0);
}

// TODO it would be nice to attach a finalization callback to combuf
// So that when the combuf is done on GPU, the callback is called and we can clean its memory
// instead of depending on framectl calling Completed function manually.

return g_staging.buffer_alloc_ring.head;
}