Commit graph

2600 commits

Author SHA1 Message Date
Bill Currie
72f7fcea47 [vulkan] Switch to reversed depth, infinite far plane
Based on the article
(https://developer.nvidia.com/content/depth-precision-visualized), this
should give nice precision behavior, and removes the need to worry about
large maps getting clipped. If I'm doing my math correctly, despite
being reversed, near precision is still crazy high. And (thanks to the
reversed depth) about a quarter of a unit (for near clip of 4) out at 1M
unit distance.
2023-07-21 11:36:10 +09:00
Bill Currie
6e9f50ffe4 [vid] Ensure window size gets sent after init
This fixes a pile of window size related issues I've seen for a while,
but most importantly, some nastiness with division by 0 and segfaults.
2023-07-14 11:57:36 +09:00
Bill Currie
8068233fb2 [x11] Don't force grab or mouse warp in fullscreen
This seems to be more for legacy X11 (ie, without fixes etc), but
fullscreen really shouldn't affect grabbing directly (rather, it should
be up to the client whether grabbing (and thus warping) is enabled at
all.
2023-07-14 07:11:53 +09:00
Bill Currie
cc57d2bc5b [vulkan] Remove double-draw of skies
Due to doing most of my testing using the demos, I hadn't noticed the
double-draw until flying around with the debug camera (and it showed as
a weird shimmer behind the sky layers).
2023-07-14 00:44:09 +09:00
Bill Currie
21a9cbc61b [ui] Implement a basic menu system
Menus within menu contexts automatically create menu items for the
sub-menu, and menus collapse when leaf menus are select.
2023-07-13 23:16:26 +09:00
Bill Currie
a6fa10b24d [vulkan] Show timings for the job and steps
No real surprises anywhere other than how long things can take at random
times.
2023-07-13 18:33:31 +09:00
Bill Currie
9289e26211 [vulkan] Add a very simple job window
It shows the list of steps in the render job, but acts as something for
testing.
2023-07-13 15:41:49 +09:00
Bill Currie
7642ef5758 [vulkan] Add debug displays for lights and bsp
The lights debug is from the light splat experiment (this is why I kept
the code), and the bsp debug is based on that. Both currently disabled
for now until I get UI controls in.
2023-07-13 14:22:31 +09:00
Bill Currie
d0d39ecee0 [renderer] Allow the camera to be overridden
Necessary for a debug camera.
2023-07-12 00:47:40 +09:00
Bill Currie
1b89598b28 [renderer] Clean up SCR_UpdateScreen a little
SCR_UpdateScreen_Legacy now takes only the screen functions pointer (it
didn't need camera or realtime), and the camera sizzle code has been
moved into one place to make cleaning it up easier (when I get around to
auditing AngleVectors etc).
2023-07-11 11:41:14 +09:00
Bill Currie
7e758327f6 [glsl] Use a unified queue for batched quads
This makes the glsl renderer compatible with canvases, and thus imui. It
also makes for much saner draw call counts.
2023-07-10 19:12:41 +09:00
Bill Currie
4e7bd11415 [build] Clean up make distcheck issues 2023-07-10 11:12:22 +09:00
Bill Currie
8bb5d2e1c9 [vulkan] Plug a memory leak in capture
I probably need to do this for other subsystems as well, but it stood
out when chasing down another memory leak.
2023-07-08 11:15:51 +09:00
Bill Currie
300badc96a Fix a couple of windows build issues
There's still the problem with unused variables when building for
windows because of vulkan debug stuff, but this fixes the important
errors. It actually still works (at least under wine).
2023-07-06 02:04:47 +09:00
Bill Currie
6fa016e23b [vulkan] Delay main render resizes by 2s
This makes window resizing a little more responsive (though it could be
better yet (maybe, could be an X11 limitation)).
2023-07-03 23:38:57 +09:00
Bill Currie
cd4791c5d3 [vulkan] Get window resize working again
The biggest change was splitting up the job resources into
per-render-pass resources, allowing individual render passes to
reallocate their resources without affecting any others. After that, it
was just getting translucency and capture working after a window resize.
2023-07-03 20:05:27 +09:00
Bill Currie
45e09673c7 [vulkan] Increase (and unify) va context count
The increase wasn't really necessary, but I noticed that windows was
still at 4... not so good.
2023-07-03 19:53:53 +09:00
Bill Currie
4471a40494 [vulkan] Get the forward renderer passing validation
It looks horrible due to the lack of lighting etc, but it's good enough
for basic testing, especially of my render job design (that passed with
flying colors).
2023-07-02 19:58:56 +09:00
Bill Currie
260a10d75c [vulkan] Add a very basic forward rendering pass
It's not fully compliant yet, but it sorta kinda maybe worked on my
pinebook (still slow, but no hardware vulkan :( )
2023-07-02 18:31:22 +09:00
Bill Currie
5fcc743d1a [ui] Use fontconfig to find system fonts
I'm not sure I like fontconfig (docs are...), but it is pretty standard,
and I was able to find some reasonable examples on stackexchange
(https://stackoverflow.com/questions/10542832/how-to-use-fontconfig-to-get-font-list-c-c).
Currently, only the one font is handled, no font sets for fall backs
etc. It's meant for the debug UI I'm working on, so that shouldn't be a
big deal.
2023-07-01 19:15:22 +09:00
Bill Currie
759e67bb7c [x11] Implement mouse visibility control
That was nicely easy.
2023-06-30 14:53:47 +09:00
Bill Currie
ec0c6ad906 [vid] Add an api function to control mouse visibility
It's currently very simplistic (visible, not visible), but it gets
things started for making QF more usable in a windowed environment (not
having a visible cursor was fine in DOS, or when full screen, but not
when windowed (and not actively playing).
2023-06-30 14:50:47 +09:00
Bill Currie
c834516c3c [vulkan] Drop the id buffer for now
I've decided to just get things working the usual way for now, and I
wasn't too happy about mixing the id writing into irrelevant shaders.
2023-06-30 12:19:46 +09:00
Bill Currie
e2b6e0728e [vulkan] Render object id to a buffer
Currently the instance id is written (with the idea that it can be
mapped back to entity in C). The plan is to use it for mouse picking.
2023-06-30 03:34:16 +09:00
Bill Currie
d45b76313c [vulkan] Use correct type for parsing int32
Using size_t doesn't work too well for -1.
2023-06-30 03:31:52 +09:00
Bill Currie
665d88c353 [vulkan] Default a view's format to that of its image
Just one less thing to duplicate.
2023-06-30 03:03:21 +09:00
Bill Currie
154d1cbfcb [vkgen] Handle int32_t correctly
I'm not sure why parse_basic doesn't work for int, but I'm not too
worried about it right now.
2023-06-30 03:00:15 +09:00
Bill Currie
4adb7dfbd1 [vkgen] Support custom parsers for .parse blocks
This let me keep clearValue's simple default rgba float interpretation,
but also have full control over access to the float32, int32 and uint32
fields.
2023-06-29 18:41:18 +09:00
Bill Currie
2a9e700c92 [sw] Separate draw frames from render frames
This is necessary because fisheye rendering draws the scene up to 6
times per frame, which results in many of the limits being hit
prematurely, but updating r_framecount that often breaks dynamic lights.
2023-06-29 01:26:54 +09:00
Bill Currie
585f1161db [renderer] Clean up R_MarkLeaves
Really? More to clean up before (vulkan) bsp rendering is thread-safe?
However, R_MarkLeaves was pretty close: just oldviewleaf and
visframecount, but that's still too much. Also, the reliance on
r_refdef.worldmodel irked me.
2023-06-29 00:49:14 +09:00
Bill Currie
ecb9a15946 [model] Clean up the brush leaf api a little
Those functions now all take mod_brush_t since they don't work with any
other type of model.
2023-06-28 21:45:41 +09:00
Bill Currie
d7e312ab8b [vulkan] Don't sort brush model entities
I really don't remember why I sorted them (perhaps to ease debugging),
but it's an unnecessary cost.
2023-06-28 18:08:43 +09:00
Bill Currie
3bdc4adb4c [vulkan] Use per-pass entity queues
While there will be some GPU resources to sort out for multi-pass bsp
processing, I think this is the last piece required before shadow passes
can be implemented.
2023-06-28 17:57:41 +09:00
Bill Currie
afa84afc79 [vulkan] Abandon light splats
They were an interesting idea and might be useful in the future, but
they don't work as well as I had hoped for quake's maps due to the
overlapping light volumes causing contention while doing the additive
blends in the frame buffer. The cause was made obvious when testing in
the marcher map: most of its over 400 lights have infinite radius thus
require full screen passes: all those passes fighting for the frame
buffer did very nasty things to performance. However, light splats might be
useful for many small, non-overlapping light volumes, thus the code is
being kept (and I like the cleanups that came with it).
2023-06-28 13:26:37 +09:00
Bill Currie
49dab2af85 [vulkan] Prepare to abandon light splats
Move things around a bit so I can restore the previous behavior of doing
all lights in a single full screen pass but keep the code improvements
from trying to do splatted lighting.
2023-06-28 12:53:58 +09:00
Bill Currie
b113e8a46c [vulkan] Add debug lines for light splats
Disabled, but all that's needed is to uncomment the debug pipeline in
the compose subpass.
2023-06-28 11:47:26 +09:00
Bill Currie
85128a3e86 [vulkan] Rework lighting to use splats
It's currently slower, and the cone splats are buggy, but the lighting
code itself got some nice cleanups.
2023-06-28 01:01:56 +09:00
Bill Currie
03cfd2530b [vulkan] Ensure staging buffer packets align to 16 bytes
Unaligned packets make it rather unsafe to use vector instructions to
transfer data to them (which optimizing compilers like to do these
days).
2023-06-28 00:27:51 +09:00
Bill Currie
4932987b08 [vulkan] Hook up the view model again
And with that, the vulkan renderer is fully back to where it was before
this mini-project (and even a little ahead). Time for shadows (finally).
2023-06-26 18:14:38 +09:00
Bill Currie
614ca744ab [vulkan] Support multi-layer OIT rendering
This fixes fisheye rendering. I'm not too happy with always allocating
the cube OIT heads buffer, but that's for another day.
2023-06-26 18:00:46 +09:00
Bill Currie
8f1de6865f [vulkan] Get fisheye working except for translucency
The OIT heads buffer is only a single-layer image, which breaks cube
map rendering, but once this is sorted, it looks like fisheye will work
well.
2023-06-26 14:03:19 +09:00
Bill Currie
7ba347cb6c [vulkan] Get water warp and fisheye mostly working
Water warp works quite well, but fisheye is having a little trouble
(current issue is framebuffer size mismatch).
2023-06-26 12:07:22 +09:00
Bill Currie
ab4ea1b333 [vulkan] Fix incorrect reference to imageviews
The old system used just "views", but I had at some time decided that I
might want to support specifying buffers and buffer views, but forgot to
change the name in vkparse.c.
2023-06-26 11:55:15 +09:00
Bill Currie
25dfa75505 [vulkan] Support disabling pipelines
This is useful for selecting post-processing pipelines at run-time.
2023-06-26 11:54:28 +09:00
Bill Currie
3e28ad62f4 [vkgen] Add support for c23 bool
Even though I'm not using c23 yet :P (properly).
2023-06-26 11:00:51 +09:00
Bill Currie
f5e7d5fbbc [vulkan] Clean out the old vkparse support functions
Lots and lots of deletions.
2023-06-26 00:59:57 +09:00
Bill Currie
05c17d7247 [vulkan] Clean up the old config files 2023-06-26 00:59:57 +09:00
Bill Currie
17ee6911f9 [vulkan] Clean up the sampler config loading
Samplers have no direct relation to render passes or pipelines, so
should not necessarily be in the same config file. This makes all the
old config files obsolete, and quite a bit of support code in vkparse.c.
2023-06-25 23:41:21 +09:00
Bill Currie
f2d2db9ef3 [vulkan] Integrate screen capture in the new system
This gets screenshots working again. As the implementation is now a
(trivial) state machine, the pause when grabbing a screenshot is
significantly reduced (it can be reduced even further by doing the png
compression in a separate thread).
2023-06-25 23:41:21 +09:00
Bill Currie
eb176c37e2 [vulkan] Get brush models rendering again
The new system seems to work quite nicely with brush models, which was
the intent, but it's nice to see. Hopefully, it works well when it comes
to shadows. There's still water warp and screen shots to fix, and
fisheye to get working, as well.
2023-06-25 00:22:03 +09:00