Commit Graph

26 Commits

Author SHA1 Message Date
Ivan Avdeev fcd9c77bea vk: make rt renderer not fail validation at startup 2024-05-01 17:21:22 -04:00
Ivan Avdeev 180f3ed9cb vk: rt: allow per-model back face culling
Make transparent studio models, e.g. holograms, single-sided.

Related: #665
2023-12-22 15:14:27 -05:00
Ivan Avdeev 07f1bac938 vk: pass material reference explicitly in geom structure
This is needed to enable advanced material patching, where the material
can be picked up based on source type, render mode, surface number, etc
etc and all of the above combined if needed.

Previous scheme was picking up materials very late when all of this info
has been already lost.
2023-09-19 13:05:12 -04:00
Ivan Avdeev 755b2d59a9 vk: fixup BLAS preallocation on Linux/amdgpu
Fixing pool allocator to properly signal allocation failure uncovered an
existing issue where we were lacking enough memory for dynamic model
BLASes on Linux/amdgpu. Erroneously the same memory region was used for
>1 BLAS. Surprisingly this hasn't led to any noticeable issues so far.

Increasing accels buffer size fixes the issue.
2023-09-14 13:57:59 -04:00
Ivan Avdeev 3e14591082 vk: wkrutily lampotschkee
fixed missing emissive values for brush models
2023-08-31 11:45:51 -04:00
Ivan Avdeev 4409e57a8d rt: fix dynamic models colors 2023-06-07 10:43:54 -07:00
Ivan Avdeev 0b8fe6fe33 rt: implement fast dynamic models
It works, and works really fast.
Known issues:
- missing colors
2023-06-07 10:24:29 -07:00
Ivan Avdeev e6bf0c452a rt: more removals 2023-06-06 11:21:47 -07:00
Ivan Avdeev 789982277d rt: remove more unused and obsolete things 2023-06-06 10:50:16 -07:00
Ivan Avdeev 98f8300ca2 vk: remove lots of obsolete code
TriApi/dynamic stuff is still not passed to RT, but removing old code
makes it easier to reason about.
2023-06-06 10:40:10 -07:00
Ivan Avdeev edb151bd1b rt: apply instanced texture overrides to rt_model; makes sprites apply correct textures 2023-06-01 10:15:30 -07:00
Ivan Avdeev 8f47115a01 rt: hide internal apis 2023-06-01 09:25:55 -07:00
Ivan Avdeev d24961db15 vk: add block allocator draft
The intent is to manage long-vs-single-frame allocations better.
Previously long allocations were map-long bump allocations, and couldn't be freed
mid-map, as there was neither a reference to the allocated range, nor a
way to actully free it.

Add a two-mode block allocator (similar to previous debuffer alloc) that
allows making long and once allocations. But now long allocations are
backed by "pool" allocator and return references to the range.

This commit doesn't do the deallocation yet, so map chaning doesn't yet
work.
2023-05-25 12:12:18 -07:00
Ivan Avdeev 9200cbfc25 rt: step even closer to explicit blas+kusochki management
- stop tracking color/xform/mmode with vk_ray_model
- do not expose model to things that don't need to know
2023-05-22 11:02:40 -07:00
Ivan Avdeev 8724efd748 rt: massage vk_ray_model a bit
- explicitly group cache-related fields
- move kusochki allocation to where it's actually used

this makes a step towards better blas management from bottom up
2023-05-22 10:39:48 -07:00
Ivan Avdeev b65f84793a rt: start refactoring blas/tlas mgmt code
Draft the new accel/blas apis. Consolidate everything accel-related into
vk_ray_accel.c. Start splitting into more atomic functions. Prepare for
blas-model+kusochki split. etc etc.

The new code isn't really used yet.
2023-05-18 11:59:14 -07:00
Ivan Avdeev 14a648d16c rt: prepare for blas mgmt refactoring
1. Rename models passed to TLAS to instances.
2. Remove BLAS validation: old, doesn't make sense anymore.
3. Draft general blas mgmt approach in NOTES.md
2023-05-17 10:42:18 -07:00
Ivan 'provod' Avdeev 1cfb183cbd rt: extract per-model data from kusochki 2023-05-01 17:03:22 -07:00
Ivan 'provod' Avdeev 52f99ec329 rt: only upload kusochki when needed
- Once at load
- When color/mode/prevxform changed

Breaks animated textures.
#523
2023-04-28 11:19:57 -07:00
Ivan 'provod' Avdeev 1ebc1d207c rt: commoditize setting material mode
Known issues:
- Breaks sprite glow for some reason.
2023-04-27 10:59:38 -07:00
Ivan Avdeev cfddb75bc5
rt: remove freeze_models functionality (#513)
It's been obsolete and broken for many months now.

Fixes #509
2023-04-15 10:51:34 -07:00
Ivan Avdeev 92ce698292 vk: profiler: cover staging with combuf scopes; add build_as time 2023-04-10 10:24:57 -07:00
Ivan 'provod' Avdeev 6d7fd41494 rt: increase model cache size, fix #449
Apparently just increasing the model cache size limit is fine.
"LRU" cache eviction was not even used when testing.
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev 62392ac4b6 rt: increase kusochki limit to 32768, fix #85
boot_camp worldmodel has ~11k surfaces, which means it will need at least 22k kusochki for 1:1 static:dynamic split.
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev c1483216ef rt: increase MAX_ACCELS to 2048, fix #366
test_shaders_room3 has lots of sprites, and currently we create a new BLAS for each sprite.
This is not great, and a proper fix would probably mean consolidating all dynamic transparent things into BLASes per render mode or something. But for now we can just increase the limit
2023-03-04 12:46:37 -08:00
Ivan Avdeev 053d26e870 move ref_vk to ref/vk 2023-02-16 10:30:31 -08:00