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

Add vulkan+rtx renderer #9

Draft
wants to merge 1,721 commits into
base: master
Choose a base branch
from
Draft

Add vulkan+rtx renderer #9

wants to merge 1,721 commits into from

Conversation

w23
Copy link
Owner

@w23 w23 commented Jun 7, 2021

This is here for now only for tracking mergeability + CI purposes

w23 and others added 30 commits February 1, 2024 10:36
Now indirect diffuse channel gets blurred with 2 Á-Trous passes. It
mostly follows the paper, except for Σd_i, which gives very bad
viusal artifacts.
Under `-vkvalidate` enables `debugPrintfEXT()` in shaders, allowing
extra validation and error reporting from shaders.
Severely degrades performance, so should be enabled only for debugging.
Hand-made organic bespoke GMO-free BRDFs

- [x] Fix black metals in #666
  - [x] Better diffuse-vs-specular channels tracking
  - [x] specular reflections
- [x] Fix new `test_material` glitches
- [x] Fix #461 
- [x] Fix #151 
- [x] Fix #266 
- [x] Filter out zero-area degenerate triangles (NOTE: might affect normal smoothing)
- [x] Implement #126 
  - [x] sun solid angle parametrization
- [x] Make new brdfs sampling functions
- [ ] distant light circular glitches
  - [x] not enough float precision, addressed to a degree with slight modifications to equations
- [x] Address glow over weapons in RT, see #442 
- [x] bounces
  - [x] diffuse
    - [x] why is it so dark?
  - [x] specular
- [x] Peformance differences. Why is there no CPU-GPU parallelism anymore?
  - [x] `VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT` forces cpu-gpu sync. 💩 
    - [x] Make a special flag for it
- [x] Update rendertests
  - [x] add more channels
  - [x] add white furnace display test
Once upon a time, there were some BLASes. There were the BLASes for dynamic geometry, that were to be used every frame to draw very dynamic things, like sprites and beams. They were initialized at the very begining of the renderer's lifetime, and were expected to live happily for the entire process duration.
However, an evil NewMap appeared. It didn't care abount anything or anyone, so when it came, it just cleared all the allocators, and allowed other BLASes to be allocated into the same space as dynamic BLASes were already given. This made BLASes live on top of each other, use each others toys and make them fight. They weren't happy.

So we just kill them and creat them again from scratch, when the evil NewMap comes.

The end.

Fixes #729
vk: rt: add workaround for holes in geometry

Once upon a time, there were some BLASes. There were the BLASes for dynamic geometry, that were to be used every frame to draw very dynamic things, like sprites and beams. They were initialized at the very begining of the renderer's lifetime, and were expected to live happily for the entire process duration. However, an evil NewMap appeared. It didn't care abount anything or anyone, so when it came, it just cleared all the allocators, and allowed other BLASes to be allocated into the same space as dynamic BLASes were already given. This made BLASes live on top of each other, use each others toys and make them fight. They weren't happy.

So we just kill them and creat them again from scratch, when the evil NewMap comes.

The end.

Fixes #729
It is not wired up to render anything yet, but we just made sure that it
builds and gets destroyed.

Also, fixup dynamic BLAS double-free.
It does it in a super dirty way, trad renderer needs a massive
refactoring.

It also displays patched skybox, however, we need it to display the
oridingal one.
Also fix:
- a bunch of texture/image destruction issues
- `_xvk_remove_all_sky_surfaces` getting stuck
E373: Draw skybox in traditional renderer

Fixes #732
- `mem->priv_.devmem` -> `slot_index`;
- Move static `VK_DevMemUsageTypeString()` out of `devmem.h` header.
profiler: track memory usage (#502)

* [x]  vulkan device memory:
  * [x]  allocated
  * [x]  used as storage for buffers/images/etc
  * [x]  unusable alignment holes
* [x]  vulkan buffers
  * [x]  allocated
  * [x]  used as storage
  * [x]  unusable alignment holes
* [x]  images memory total
* [ ]  cpu memory allocated in ref/vk

(copied & pasted from Issue #502)
Fixes sync hazard validation error for depth buffer.
`rt_force_disable` is perfectly fine, it just needs to be written into
either `vk.cfg` or `video.cfg` to work. Other configs are read *after*
`R_VkInit()` function get called.
This is a very dirty way of silencing errors, trading them for a
waterfall of warnings. But it will allow making progress for now.
Trad rendering still works with this slightly more tight sync model.

It is suboptimal as it doesn't really know the previous op on the
buffer, so it has to do the ALL_COMMANDS stages, which makes validation
a bit sore.
Not sure what's happening with the rest, but first couple works.
This makes RT rendering work w/o sync hazards.
But it will still fail with one if menu is called.

It's as much as it can go w/o proper state tracking.
Synchronization stuff started on stream E374

Addresses a bunch of validation synchronization hazards. Not all of them. And the remaining ones require more involved state tracking, a big effort.

Also contains a few minor tweaks:
- stop using SDL_GL functions, silence errors
- increase acceleration structures buffer size -- with recent mesa update BLASes got bigger somewhat (?)
- rename ray_resources to vk_resources
- add agenda and notes
a1batross and others added 30 commits February 3, 2025 13:14
Called on game controller becoming active or by user request.
Exposes current calibration state by read-only console variable.
…opt-in, yields better performance with VBO renderer
Use existing ui_language cvar for mounting localization folders.
…hem when Cvar_Get is called with NULL description

It allows us to not lose engine-side description when client or gameui registers cvar with the same name. In case of
menu it's the only way to get cvar pointer.
…UD down to selected resolution with preserving aspect ratio
Fix CI flatpak build, also merge from master once more (as it contains flatpak fixes).
…rMode call

Not sure if this is correct, but it's generally a good idea to restore it to an
expected value.
… engine startup (it might be enabled later, it might also contain crash data)
Turns out it is invalid to calc bone quaternion for `numframes-1`.
Therefore, calc up to, but not including, that frame, but depend on
interpolation almost up to the last valid frame.

This code is only used for dynamic studio model detection.
Fix ASAN errors:
- [x] zero-sized buffers in r_speeds
- [x] OOB reads in vk_studio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

8 participants