Commit Graph

553 Commits

Author SHA1 Message Date
Ivan 'provod' Avdeev fed12884dc vk: ne sri v log 2022-05-04 09:55:13 -07:00
Ivan 'provod' Avdeev 608aa4137d vk: use staging for uploading geometry 2022-05-04 09:23:37 -07:00
Ivan 'provod' Avdeev c5012328d6 vk: pick device memory slot based on type index 2022-04-30 00:28:52 -07:00
Ivan 'provod' Avdeev a3ff75b48f vk: draft staging api, use it for textures 2022-04-28 00:16:25 -07:00
Ivan 'provod' Avdeev 573d006c4a Merge remote-tracking branch 'origin/vulkan' into better-sampling-passes-parallel 2022-03-21 12:00:55 -07:00
NightFox 5342c92019
Rads and patches, rev1 (#328)
Обновлённые рады и патчи карт для лучей. Куча ненужных источников выкинута, местами освещение переделано в пользу реализма. Попытка вытянуть освещение через доступные светящиеся поверхности. Список радов и патчей будет потихоньку обновляться. Это первая ревизия, во второй будут исправляться пропущенные ошибки и коррекция освещения относительно новых материалов.

Для патчей исправлен масштаб яркости у светящихся текстур.

Также теперь рад файлы лежат в data/valve/maps/ а патчи в data/valve/luchiki/maps/. Теперь возможно добавлять другие моды.
2022-03-21 12:00:02 -07:00
Ivan 'provod' Avdeev 31e15e40c6 vk: print allocations only under `-vkdebugmem` 2022-02-22 21:46:44 -08:00
Ivan 'provod' Avdeev 00652f0e7d rt: fix pcie bus thrashing; add profiler scopes
turns out it's not cool to read color from on-gpu kusok data, modify it, and write back
2022-02-21 23:46:50 -08:00
Ivan 'provod' Avdeev 3ebdeb876e differentiate debug markers vs validation layers
Split concerns:
- validation layers help with correctness, but not performance (*generally)
- debug markers help with profiling (and ony sometimes with correctness too)

These were conflated into a single `-vkdebug` arg.
And sometimes you need only markers and no validation for performance.
(Validation is like 30% slower)

Make it so that:
- `-vkdebug` enables only debug names and time markers, but not validation
- `-vkvalidate` enables validation layers and also debug markers
2022-02-20 23:40:48 -08:00
Ivan 'provod' Avdeev e35e2aa043 rt: allocate as many desc sets as frames in flight
still not fully correct or robust, but passes validation

missing correctness things:
- Nx light data buffers
- Nx dynamic model buffers
- Nx dynamic BLASes

quite likely will also need (depending on update strategy, direct vs upload):
- Nx light data buffers
- Nx UBOs

probably fine since frames don't really overlap:
- single TLAS
2022-02-20 23:30:23 -08:00
Ivan 'provod' Avdeev 955f36a423 Merge branch 'parallel-frames' into better-sampling-passes-parallel
includes a few initial compilation fixes for parallel ray tracing. does not work yet
2022-02-20 16:00:33 -08:00
Ivan Avdeev 22917938d9 vk: initial draft of parallel frames
adds multiple command buffers and bits of synchronization.

is not correct at all:
- no depth buffer barrier
- no ubo slots in render
- no proper render memory management
- no ray tracing support whatsoever
- ... etc
2022-02-10 22:55:33 -08:00
Ivan Avdeev 668d3fb81a rt: add shadows for environment lights 2022-02-09 21:57:55 -08:00
Ivan Avdeev 152cca3a47 rt: select random triangle to sample based on solid angle
looks correct enough(ish?)

perf (c1a0):
direct poly light 4.4ms, v85(96), o10/16 (-6v +1o)
2022-02-08 23:04:00 -08:00
Ivan Avdeev e2694ecf36 rt: try single triangle solid angle sampling
1. it looks way better
2. still missing other triangles

perf (c1a0):
4.2ms, v87(96), o10/16 (-6v +1o)
2022-02-08 22:26:39 -08:00
Ivan Avdeev b68dcf81a1
vk: move big enum to string tables to dedicated source file (#345) 2022-02-06 23:16:54 -08:00
Ivan Avdeev 113039a929 vk: print surface formats and colorspaces names 2022-02-06 09:42:03 -08:00
Ivan Avdeev 8d8abb7e29 vk: synchronize screenshots with swapchain, fix #192 2022-02-06 09:42:03 -08:00
Ivan Avdeev 970089516c vk: move swapchain out from framectl 2022-02-06 09:42:03 -08:00
Ivan Avdeev dd1f58d0b7 rt: simplify polygon light sampling
do stupid first triangle sampling, w/ contrib estimation area * dot(LP) / dist^2

4.7ms all poly lights, occupancy 10, vgpr 86(96)
2022-02-04 18:38:36 -08:00
Ivan Avdeev 4bb44c1569 rt: add skybox support 2022-02-02 21:47:40 -08:00
Ivan Avdeev 3a6bed136a rt: add moving polygon lights support 2022-02-02 21:32:10 -08:00
Ivan Avdeev f9bf0aadd0 rt: add emissive color 2022-02-02 19:04:45 -08:00
Ivan Avdeev 6b381c8970 rt: flatten pass bindings a bit 2022-01-31 20:50:39 -08:00
Ivan Avdeev b6c96ddebd rt: automate image barriers for passes 2022-01-31 20:40:41 -08:00
Ivan Avdeev c2d8ecbf79 rt: make denoiser to be just another pass
that requires also supporting compute shaders as passes.
2022-01-30 22:24:55 -08:00
Ivan Avdeev 950b1ff6cf rt: tie pass binding to resource semantic
this allows removing pass write function and moves us closer to
auto-solving pass dependencies
2022-01-30 20:49:37 -08:00
Ivan Avdeev 6c6e6e191d rt: make array of resources
this moves one step closer to fully dynamic resources and automatic
barriers.
next steps would be:
- passes declaring their bindings at creation time
- resources automatically preparing values based on that declaration
- automatic barriers
- single descriptor pool stored at resources (aware of frames in flight,
  etc)
- parsing shaders to generate binding declaration
2022-01-28 22:58:07 -08:00
Ivan Avdeev 61ecda02f2 rt: add output material channel to primary ray
perf (--//--)
- total ray time: 14.5ms
- primary: 0.2ms v:81/96 s:60/128 o:10/16 (-6v +1o)
- light poly: 13.4ms v:256/256 s:98/128 o:4/16 (-28v +1o)
- light point: 0.8ms v:87/96 s:68/128 o:10/16 (-6v +1o)
2022-01-27 20:04:18 -08:00
Ivan Avdeev 90fa6161ac rt: add parallel direct point light pass
(look how easy that was! yay passes!
... still need to do spir-v parsing to extract bindings though)

perf (c1a0 lobby, 720p, 6900XT)
- total ray tracing time: 15.2ms
- primary: 0.7ms v:80/80 s:60/128 lds:2048 o:12/16 (-4v +1o)
- dir poly: 13.8ms v:256/256 s:98/128 lds:2048 o:4/16 (-28v +1o)
- dir point: 0.9ms v:85/96 s:68/128 lds:2048 o:10/16 (-6v +1o)

dir point and poly are not synchronized and overlap. but poly takes most
of the time, and point can only ramp up gradually at the very tail of
poly.
2022-01-27 19:14:56 -08:00
Ivan Avdeev c3a7a01620 rt: passify light direct poly 2022-01-27 17:47:00 -08:00
Ivan Avdeev b3c69851dc rt: draft a universal pass sketch
allows easily creating arbitrary ray tracing pipelines out of sets of
bindings and shaders

what's missing:
- optimal handling of duplicate shaders
- reading bindings from shaders (parse SPIR-V) instead of specifying in
  code
- automatic resource creation according to binding definitions
- automatic barriers according to bindings interface
2022-01-26 23:52:19 -08:00
Ivan Avdeev e384f2e1f7 rt: move shader binding defs to interop 2022-01-22 19:13:08 -08:00
Ivan Avdeev 5d8e15bfac rt: sample all poly lights more correctly 2022-01-22 18:54:40 -08:00
Ivan Avdeev 21ff19be83 rt: convert denoiser to use resources 2022-01-22 18:54:11 -08:00
Ivan Avdeev 202eccb3d1 rt: cosolidate pass args in a central structure 2022-01-21 20:55:43 -08:00
Ivan Avdeev e295f39c2b rt: fix for X macro redefinition 2022-01-21 09:52:16 -08:00
Ivan Avdeev 7b7d08a944 rt: make primary ray use ray pipeline framework 2022-01-20 20:21:06 -08:00
Ivan Avdeev 70eb2fed6f rt: read tangents and normal map 2022-01-20 20:09:21 -08:00
Ivan Avdeev 5b4a22e97e rt: remove ray_query extension dependency 2022-01-20 20:08:46 -08:00
Ivan Avdeev 23b4bdd4f8 rt: consolidate specialization data 2022-01-20 20:04:43 -08:00
Ivan Avdeev 94b4066d8d rt: move ray pipeline to vk_pipeline 2022-01-20 18:48:01 -08:00
Ivan Avdeev 63358be4a3 rt: replace ray query with rt pipeline for direct light
it stays roughly the same, vgpr 256, etc.
perf is a tiny bit better (12ms vs 14ms for all poly lights in c1a0
lobby /w shadows), but it may be sampling artifact
2022-01-20 00:06:38 -08:00
Ivan Avdeev c73f3d0dab rt: sample all polygon light sources in cluster 2022-01-19 20:23:38 -08:00
Ivan Avdeev 460b839a64 rt: add debug labels to command buffer 2022-01-18 22:29:42 -08:00
Ivan Avdeev 1ad24b657b Merge remote-tracking branch 'origin/vulkan' into better-sampling-passes 2022-01-17 23:04:06 -08:00
Ivan Avdeev 59ec44ca34 rt: align SBT buffer allocations 2022-01-17 22:06:30 -08:00
Ivan 'provod' Avdeev 951d382eb6 vk: improve memory allocation logging
print region names, requirements, etc.
also decrease default vulkan device memory allocation size to 64Mb
decrease max vertices to 512k
2022-01-17 22:06:30 -08:00
Ivan Avdeev a5f22ca11d vk: add verbose memory allocation logs 2022-01-17 22:06:30 -08:00
Ivan Avdeev 24cb0aebfb vk: add a simple block dlinked list based allocator for devmem 2022-01-17 22:06:30 -08:00