Commit graph

2835 commits

Author SHA1 Message Date
Bill Currie
187c48bde3 [vulkan] Apply the light culling information
The results of the occlusion queries give the lights that don't have a
visible hull, but unfortunately that includes any lights which the
camera is inside, but simple distance checks sort that out (with a
fudge-factor for the icosahedron vertices (1.583 (3(2+p)/(2+3p), p is
golden ratio)).
2023-12-17 18:45:02 +09:00
Bill Currie
f08b8dc3c7 [vulkan] Move light radius calcs to the CPU
No point in calculating them for every vertex, especially when I forgot
to update the calculations for the entid vertex shader.
2023-12-17 18:45:02 +09:00
Bill Currie
00ecb7d71a [vulkan] Use separate tracy GPU context for light culling
My efforts (especially the collect zone (what was I thinking)) got
tracy's knickers in a twist resulting in vanishing zones in the server.
It looks like there are some synchronisation issues between cpu and gpu,
but I'm not *too* worried about it at this stage.
2023-12-17 18:45:02 +09:00
Bill Currie
f282bfc045 [vulkan] Use occlusion queries for culling lights
The info isn't used yet, but this shows that vulkan's occlusion queries
are at least somewhat useful. However, the technique isn't perfect:
infinite radius lights (1/r and 1/r^2) are difficult to cull, and all
lights can poke through thin enough walls, and then lights containing
the camera get culled incorrectly (will need a separate test). Still, it
looks like it will help once everything is tied together.
2023-12-17 18:45:02 +09:00
Bill Currie
1c13879fb9 [vulkan] Split out the render pass core
And make it callable directly (needed to be able to submit the command
buffer separately from the main commands (though this does mess with
tracy a little).
2023-12-17 18:45:02 +09:00
Bill Currie
8e7c21e36a [vulkan] Implement staged shadow maps
This doesn't make much of a difference on the GPU, but it drastically
cuts down CPU usage, especially for ad_tears: shadow map drawing is down
from 16.3ms to 3.7ms thanks to no having to run the alias model queues
as often.
2023-12-17 18:45:02 +09:00
Bill Currie
5637bae20c [vulkan] Move on to vulkan api 1.3
I decided there's little point in hanging onto old API versions when the
newer ones have some nice things like vkCmdCopyImage2.
2023-12-17 18:45:02 +09:00
Bill Currie
72ef0662f5 [vulkan] Add a level of indirection to shadow matrices
Batching shadow map rendering needs be able to reference matrices for
multiple lights in a single batch, but the only input is the view index,
so use that to look up the matrix index rather than using it to index
the matrices directly (modulo the base index that's still there).
2023-12-17 18:45:02 +09:00
Bill Currie
75ce49b1f0 [vulkan] Switch to vulkan 1.1/1.2 prop/feat structs
Since switching to the 1.2 api as a requirement, might as well use the
relevant structs instead of extension struct (for multiview). Came up
when double-checking the max views property due to running into what
appears to be an nvidia bug where > 29 views (any bit pattern) cause a
segfault when creating the pipeline.
2023-12-17 18:45:02 +09:00
Bill Currie
7506117e43 [vulkan] Increase matrix id bits
I had missed that upping max lights to 2048 meant that up to 12288
matrices are needed for all the possible lights. This made it so the
light type could not be encoded in id_data, but the shaders never used
it anyway. This leaves one bit free.
2023-12-17 18:45:02 +09:00
Bill Currie
39616bc84d [vulkan] Remove old descriptor and pipeline code
Pipeline cache handling is still there for now, but the rest hasn't been
used since the render graph rewrite, if not before (and good riddance).
2023-12-17 18:45:02 +09:00
Bill Currie
03af3c5cc9 [vulkan] Make the tracy macros more robust
Now some of the hacks needed for GPU zones work without tracy being
enabled (ie, no compiler warnings about unused variables).
2023-12-07 14:51:58 +09:00
Bill Currie
7ff0e95c52 [vulkan] Merge lighting updates into one packet
While QFV_PacketScatterBuffer works on only one destination buffer, it
turns out it's still useful for scattering to multiple buffers, just
with multiple calls. This makes it pretty easy to combine multiple
buffer updates into a single staging buffer packet, resulting in
reducing lighting's packet use from up to 7 to just one, drastically
reducing the pressure on the stating buffer packet pool, and thus
reducing the chances of QFV_PacketAcquire stalling.
2023-12-06 00:15:42 +09:00
Bill Currie
fccd06c5bf [vulkan] Add gpu profiling zones
This relies on my fork of tracy: https://github.com/taniwha/tracy
on the wip-c-vulkan branch. Everything is still rather flaky though.

This necessitated the jump to vulkan 1.2 as a requirement.
2023-12-05 22:55:57 +09:00
Bill Currie
d908016606 [sys] Use a jump buffer to exit to main
This allows tracy to clean up properly. However, Sys_Quit will use the
jump buffer (sys_exit_jmpbuf) only if it has been set, so the use of
Sys_setjmp is optional.
2023-12-05 19:02:51 +09:00
Bill Currie
63e66e81c5 [vulkan] Increase ring buffer size to 32 packets
I'm still not happy with it being a compile time constant, but this
takes care of the interlock between frames in flight... for now: it's
fragile and really needs the excessive small-packet use in draw and
lighting to be cleaned up.

After discussion with Darian, I've decided to go with one big staging
buffer (with lots of packets) shared between FiF as the large size will,
in the end, be more flexible.
2023-12-05 16:43:05 +09:00
Bill Currie
e65e80f573 [vulkan] Report long packet acquisition times
Here long is considered to be 500μs. This shows the problem mentioned in
test scene, in lighting updates.
2023-12-04 23:41:46 +09:00
Bill Currie
d48f76eb57 [gamecode] Fix a typo in a comment 2023-12-04 23:23:58 +09:00
Bill Currie
e30f2cbacc [util] Add a wrapper for libgcc's backtrace functions
Right now, just backtrace_pcinfo is supported, but it's enough for
testing.
2023-12-04 17:53:12 +09:00
Bill Currie
1a83fe21c1 [util] Add Sys_setjmp and Sys_longjmp
Host_Error and Host_EndGame use setjmp/longjmp to implement an exception
of sorts, but this messes with tracy's state even with cleanup
attributes. However, it turns out that those cleanup attributes are
exactly how gcc implements C++ destructors, and so the standard Unwind
api (part of libgcc) respects them (so long as -fexceptions is enabled
for C). Thus... replace longjmp with an implementation that uses Unwind
to unwind the stack and call the cleanup functions as needed. This is
actually important for more than just tracy as the cleanup attributed
vars can be thread locks.
2023-12-01 12:13:26 +09:00
Bill Currie
52210b8c55 [util] Add leb123 signed and unsigned message readers
Needed for parsing dwarf eh_frame data, but I'm sure it will come in
handy for other things.
2023-12-01 02:55:08 +09:00
Bill Currie
da9e5d9ff3 [build] Make scoped zones a little easier to use
And report checking for tracy.
2023-11-30 21:08:34 +09:00
Bill Currie
010c658653 [build] Add support for building with Tracy
Tracy is a frame profiler: https://github.com/wolfpld/tracy

This uses Tracy's C API to instrument the code (already added in several
places). It turns out there is something very weird with the fence
behavior between the staging buffers and render commands as the
inter-frame delay occurs in a very strangle place (in the draw code's
packet acquisition rather than the fence waiter that's there for that
purpose). I suspect some tangled dependencies.
2023-11-28 15:54:55 +09:00
Bill Currie
9e43675c8f [vulkan] Add length and int color to graph labels
Tracy wants string lengths and uint32_t colors, so set them up
automatically from provided info.
2023-11-28 14:15:43 +09:00
Bill Currie
8e4f0f3837 [win] Implement borderless fullscreen mode
And rip out all the crufty DIB mode junk.
Fixes #60
2023-11-26 14:18:54 +09:00
Bill Currie
4eef0889ee [win] Communicate application focus to the client
This fixes the weird slug when running nq on windows. It turns out it
was the "friendly neighbor" sleep code activating due to bitrot. In
addition, there are cvars for enabling unfocused sleep (defaults off)
and disabling minimized sleep (defaults on).
2023-11-26 13:40:00 +09:00
Bill Currie
7024e4efb1 [win] Hide the mouse in a system-friendly way
ShowCursor is system-wide and thus not suitable for general use. It
turns out hiding the cursor in windows is the same as x11: use a null
cursor.
2023-11-25 22:03:27 +09:00
Bill Currie
30489e1812 [win] Set window style correctly
This fixes the incorrectly sized window (I think).
2023-11-25 21:03:51 +09:00
Bill Currie
250cac6079 [vid] Remove direct draw interface
It has been dead for a long time.
2023-11-24 12:28:55 +09:00
Bill Currie
f721021fec [win] Clean up event handling and a pile of dead code
The event handling changes take care of VagueLobster's segfaults on
startup for all renderers (vulkan will still be iffy depending on his
hardware: it dies on my GTX 965 M, probably due to memory and QF's
shadows). One nice side effect is it takes care of the broken CD audio
event handling (does anyone even care, though?).
2023-11-24 12:28:06 +09:00
Bill Currie
97a9620cb9 Do the distcheck dance 2023-11-23 17:55:33 +09:00
Bill Currie
7a2a61d365 Merge branch 'wip-trails' 2023-11-23 14:00:11 +09:00
Bill Currie
34daf9032d [renderer] Get trails rendering again
They're not quite working (trail path offset is incorrect) but their
pixels are getting to the screen. Also, lifetimes are off for rocket
trails in that as soon as the entity dies, so does the trail.
2023-11-23 13:58:44 +09:00
Bill Currie
70d07d8026 [quakefs] Document that QFS_LoadFile closes the file
In the end, I decided that the behavior isn't so bad, but it does need to
be documented.

Closes #34
2023-11-19 16:40:24 +09:00
Bill Currie
c322fb68d3 [cexpr] Remove unnecessary config.h include 2023-11-17 20:51:12 +09:00
Bill Currie
c467d2f9b8 [vulkan] "Use" most params for QFV_duSetObjectName
When disabled, its params go unused and thus results in gcc unused
locals warnings.
2023-10-15 18:20:55 +09:00
Bill Currie
1c6986f0ab Merge branch 'master' into wip-trails 2023-10-03 14:11:22 +09:00
Bill Currie
c5731374cd [glsl] Separate out the trails implementation
This gets things *compiling* again, though it's still non-functional and
definitely wrong (don't want trail in renderer_t), but I need to think
about the design for getting trails as components. Also need to think
about integrating trails into the client effects system so trails can be
shared between renderers.
2023-10-03 13:49:25 +09:00
Bill Currie
ba35ce71b3 [qfcc] Support 32-bit and 64-bit handle types
32-bit is nice because it's small, but 64-bit is handy for special
handle encodings.
2023-10-02 23:33:37 +09:00
Bill Currie
bde35749f5 [util] Define ALLOC_FREE_BLOCKS for DEBUG_QF_MEMORY
More bitrot.
2023-10-02 20:40:21 +09:00
Bill Currie
6423c13108 Merge branch 'master' into wip-trails 2023-10-02 00:48:14 +09:00
Bill Currie
2e90022d5c [util] Define ALLOC_STATE for DEBUG_QF_MEMORY
I haven't used DEBUG_QF_MEMORY for a while, so it suffered a bit of
bitrot.
2023-09-22 20:22:24 +09:00
Bill Currie
5c72ce10d2 [input] Delay event system init
I think I had though it using a constructor init was ok, but it turns
out that was problematic. That, or I missed it in my recent audit. Fixes
a sys syserror during shutdown.
2023-09-21 02:02:12 +09:00
Bill Currie
9a081b6809 [input] Fix input shutdown order
This fixes another segfault on shutdown (not sure just which recent
change caused it, but the listener pointer needed clearing) but while
fixing the listener issue, I noticed that binding and imt shutdown were
in the wrong order with respect to buttons and axes.
2023-09-21 01:36:43 +09:00
Bill Currie
1a36d3786d [input] Allow buttons and axes to be deregistered
This is used by the Ruamoko input bindings so progs can clean up.
2023-09-15 14:04:21 +09:00
Bill Currie
fab5ae9d1f [input] Delay button and axis init
It turns out that initializing them via constructors led to their
shutdowns happening too late which resulted in problems with button and
axis cleanup.
2023-09-15 13:51:59 +09:00
Bill Currie
cb72769aa9 [model] Clean up the model struct a little
Mostly just removing some (near) dead fields and making the
flags/effects more clear on what it's for.
2023-09-14 20:35:45 +09:00
Bill Currie
5c32077c2a [iqm] Use type-specified enums
This should make debugging a little easier in the future.
2023-09-04 12:24:40 +09:00
Bill Currie
a66fb80517 [gamecode] Switch dot products to give a scalar
Making them give a vector was a mistake for Ruamoko. I've probably got a
mess to clean up in game-source, but oh well.
2023-08-31 15:32:52 +09:00
Bill Currie
8ff2c5a747 [util] Support utf-8 strings in Sys_Printf
By default. Conversion of quake strings needs to be requested (which is
done by nq and qw clients and servers, as well as qfprogs via an
option). I got tired of seeing mangled source code in the disassembly.
2023-08-23 21:40:50 +09:00
Bill Currie
2e91b29580 [qfcc] Start work on implementing geometric algebra
This gets only some very basics working:
 * Algebra (multi-vector) types: eg @algebra(float(3,0,1)).
 * Algebra scopes (using either the above or @algebra(TYPE_NAME) where
   the above was used in a typedef.
 * Basis blades (eg, e12) done via procedural symbols that evaluate to
   suitable constants based on the basis group for the blade.
 * Addition and subtraction of multi-vectors (only partially tested).
 * Assignment of sub-algebra multi-vectors to full-algebra multi-vectors
   (missing elements zeroed).

There's still much work to be done, but I thought it time to get
something into git.
2023-08-21 17:58:20 +09:00
Bill Currie
74405ee31b [gamecode] Switch dstatement ops to signed
I realized recently that I had made a huge mistake making Ruamoko's
based addressing use unsigned offsets as it makes stack-relative
addressing more awkward when it comes to runtime-determined stack frames
(eg, using alloca). This does put a bit of an extra limit on directly
addressable globals, but that's what the based addressing is meant to
help with anyway.
2023-08-21 17:47:55 +09:00
Bill Currie
c46e15af9b [vulkan] Up max lights to 2048 and quantize sizes
This seems excessive, but gmsp3v2 map has 1399 lights. Worse, it has a
lot of different light sizes that go up by small increments (generally
around 10) resulting in 33 shadow map images (1 too many). Quantizing
the sizes to 32 drops this nicely to 20, and reduces memory consumption
slightly too (image buffer overhead, I guess).
2023-08-15 14:44:38 +09:00
Bill Currie
5abe467f7d [gamecode] Specify underlying type for opcode enums
And remove the bitfield from dstatement_t. I have wanted this for over
twenty years :)
2023-08-13 23:51:53 +09:00
Bill Currie
77842bdeb4 [build] Require C23 (gnu2x)
Now that gcc-13 is default on Debian sid, I'm happy to switch to
requiring it for building QF. As a celebration, I removed the bool and
auto hacks.
2023-08-13 23:51:53 +09:00
Bill Currie
618740663b [vulkan] Implement CSM rendering
This covers only the rendering of the shadow maps (actual use still
needs to be implemented). Working with orthographic projection matrices
is surprisingly difficult, partly because creating one includes the
translations needed to get the scene into the view (and depth range),
which means care needs to be taken with the view (camera) matrix in
order to avoid double-translating depending on just how the orthographic
matrix is set up (if it's set up to focus on the origin, then the camera
matrix will need translation, otherwise the camera matrix needs to avoid
translation).
2023-08-13 17:36:32 +09:00
Bill Currie
f3ca2f158b [vulkan] Add a scatter buffer copy function
Updating directional light CSM matrices made me realize I needed to be
able to send the contents of a packet to multiple locations in a buffer
(I may need to extend it to multiple buffers). Seems to work, but I have
only the one directional light with which to test.
2023-08-13 17:30:59 +09:00
Bill Currie
558e11e9b7 [vulkan] Make near and far clip explicit parameters
This improves the projection API in that near clip is a parameter rather
than being taken directly from the cvar, and a far clip (ie, finite far
plane) version is available (necessary for cascaded shadow maps as it's
rather hard to fit a box to an infinite frustum).

Also, the orthographic projection matrix is now reversed as per the
perspective matrix (and the code tidied up a little), and a version that
takes min and max vectors is available.
2023-08-13 17:30:24 +09:00
Bill Currie
2b879af3e1 Fix most of the hacks for clang
gcc didn't like a couple of the changes (rightly so: one was actually
incorrect), and the fix for qfcc I didn't think to suggest while working
with Emily.

The general CFLAGS etc fixes mostly required just getting the order of
operations right: check for attributes after setting the warnings flags,
though those needed some care for gcc as it began warning about main
wanting the const attribute.

Fixing the imui link errors required moving the ui functions and setup
to vulkan_lighting.c, which is really the only place they're used.
2023-08-11 18:29:30 +09:00
Th3T3chn0G1t
3098b5d3f7 Implement clang support
Fixing a load of issues related to autoconf and some small source-level issues to re-add clang support.
autoconf feature detection probably needs some addressing - partially as -Werror is applied late.
2023-08-11 14:25:01 +09:00
Bill Currie
481c12468e [vulkan] Show surfaces for selected light leaf
This has resulted in some rather interesting information: it seems the
surfaces (and thus, presumably bounding boxes) for leafs have little to
do with the actual leaf node's volume.
2023-08-09 02:01:47 +09:00
Bill Currie
5bc1924a25 [vulkan] Clean up some bsp pass name confusion
I had gotten stage and pass confused at some stage. Also, name the
passes in C (enum).
2023-08-08 19:23:30 +09:00
Bill Currie
a5fcc41d08 [vulkan] Rename bsp aux pass to shadow
Much better name.
2023-08-08 18:04:58 +09:00
Bill Currie
1319ed0e94 [scene] Implement simple UI functions for lights
Both dynamic lights and "static" lights display their values, but
currently no interaction.
2023-08-08 17:25:53 +09:00
Bill Currie
102a0d591b [ecs] Add a ui function pointer to components
This allows components to display themselves in the UI. Because the
component meta-data is copied into the registry, the function pointer
can be updated by systems (eg, the renderers) to display system-specific
interpretations of the component.
2023-08-08 17:02:53 +09:00
Bill Currie
c99a49a958 [vulkan] Save the current scene in the scene context
Now this I really don't know why I didn't do when I first created the
context.
2023-08-08 12:00:03 +09:00
Bill Currie
ff5d4d8de1 [vulkan] Move Vulkan_NewScene into vulkan_scene
It probably should have been there all along, and with this
vulkan_main/qf_main goes away.
2023-08-08 11:52:31 +09:00
Bill Currie
9ede227da4 [ui] Edge detect all mouse buttons
And return mouse button info in the io struct.
2023-08-07 22:20:34 +09:00
Bill Currie
1745d3bccc [vulkan] Implement mouse-picking for light entities
Currently, only light entities get drawn to the entid buffer, and the
ids are simply displayed in a window for now (not very useful yet).
2023-08-07 17:47:49 +09:00
Bill Currie
95b660d7fd [ui] Add a function to get current mouse position
And hot/active ids.
2023-08-07 17:42:59 +09:00
Bill Currie
bf951c3ba2 [vulkan] Get debug light objects working again
And also get them working for infinite radius lights.
2023-08-06 00:20:25 +09:00
Bill Currie
6892dc1422 [scene] Add flags for finer rendering control
This takes care of rockets and lava balls casting shadows when they
shouldn't (rockets more because the shadow doesn't look that nice, lava
balls because they glow and thus shouldn't cast shadows). Same for
flames, though the small torches lost their cool sconce shadows (need to
split up the model into flame and sconce parts and mark each
separately).
2023-08-05 18:09:20 +09:00
Bill Currie
f436806006 [scene] Remove full_transform from renderer_t
I've wanted to do this for a long while, but I finally got the
motivation to clean up the two uses in gl and glsl. Removes 64 bytes
from the struct.
2023-08-05 15:56:01 +09:00
Bill Currie
15d7222ebb [model] Remove Mod_LeafPVS in favor of mix/set
The use of a static set makes Mod_LeafPVS not thread safe and also means
that the set is not usable with the set iterators after going to a
smaller map from a larger map.
2023-08-05 11:51:01 +09:00
Bill Currie
7294a77356 [client] Put dynamic lights on separate entities
Dynamic lights can't go directly on visible entities as one or the other
will fail to be queued. In addition, the number of lights on an entity
needs to be limited. For now, one general purpose light for various
effects (eg, quad damage etc) and one for the muzzle flash.
2023-08-05 01:42:15 +09:00
Bill Currie
fb818d15d9 [scene] Support extra component systems
I've finally come across the need for "client" (hah) code to have
additional components on scene entities.
2023-08-05 01:35:09 +09:00
Bill Currie
9328c90a74 [vulkan] Implement shadows for dynamic lights
This also fixes the segfault in the previous commit.

Dynamic light shadow sizes are fixed, but can be controlled via the
dynlight_size cvar (defaults to 250).
2023-08-04 15:44:07 +09:00
Bill Currie
35ec2ebb4c [scene] Move dynamic lights into the scene ECS
While the insertion of dlights into the BSP might wind up being overly
expensive, the automatic management of the component pool cleans up the
various loops in the renderers.

Unfortunately, (current bug) lights on entities cause the entity to
disappear due to how the entity queue system works, and the doubled
efrag chain causes crashes when changing maps, meaning lights should be
on their own entities, not additional components on entities with
visible models.

Also, the vulkan renderer segfaults on dlights (fix incoming, along with
shadows for dlights).
2023-08-04 15:08:56 +09:00
Bill Currie
a626dc7ca8 [vulkan] Split the lighting pass into per-type passes
This takes care of the type punning issue by each pass using the correct
sampler type with the correct view types bound. Also, point light and
spot light shadow maps are now guaranteed to be separated (it was just
luck that they were before) and spot light maps may be significantly
smaller as their cone angle is taken into account. Lighting is quite
borked, but at least the engine is running again.
2023-08-02 19:34:26 +09:00
Bill Currie
39bb433498 [vulkan] Add an undefined to shader-ro barrier
I guess it's kind of UB, but it's handy for images that will be
conditionally written by the GPU but need to be in shader-read-only for
draw calls and the validation layers can't tell that the layers won't be
used.
2023-08-02 17:51:04 +09:00
Bill Currie
00040c8900 [vulkan] Hook up all the shadow resources
This gets everything but the actual shadow map bindings working: the
validation layers don't like my type punning (which may well be the
right thing) and specialization constants don't help (yet, anyway) but I
want to get things into git.
2023-08-01 23:34:08 +09:00
Bill Currie
7487a00b36 [renderer] Return number of nearby dynamic lights
It allows for a minor optimization when allocating resources for those
lights.
2023-08-01 23:28:24 +09:00
Bill Currie
a50bc1c6ef [scene] Make light style unsigned
Not that it really matters for only 64 styles, but it feels more
consistent.
2023-08-01 23:26:26 +09:00
Bill Currie
2d7f671da8 [vulkan] Remove depth buffer from lighting pass
It's not needed and exceeds the minimum maximum input attachments.
2023-08-01 14:35:23 +09:00
Bill Currie
ff27da4a05 [vulkan] Use the shadow matrices when rendering maps
It turns out bsp faces are still back-face culled despite the null point
being on the front of every possible plane... or really, because it's on
the front of every possible plane: sometimes the back face is the front
face, and this breaks the face selection code (a separate traversal
function will be needed for non-culling rendering).

Despite that, other than having to deal with different pipelines,
getting the model renderers working went better than expected.
2023-07-30 11:52:13 +09:00
Bill Currie
aed1e7e077 [vulkan] Upload light matrices for shadow maps
This involved rewriting the descriptor update code too, but that now
feels cleaner.

The matrices are loaded into a storage buffer as it can get quite big at
6 matrices per light (and the current max lights is 768).
2023-07-30 11:35:07 +09:00
Bill Currie
aac6fca2c5 [vulkan] Pass a data parameter to QFV_RunRenderPass
The parameter will be passed on to the pipeline tasks in their task
context, allowing for communication between the subsystem calling
QFV_RunRenderPass and the pipeline tasks (for the case of lighting,
passing the current matrix base index).
2023-07-30 11:25:08 +09:00
Bill Currie
e83854a760 [vulkan] Make z_up and box_rotations public
They're now qfv_* and shared within the vulkan renderer. qfv_z_up cannot
be shared across renderers as they have their own ideas for the world
frame. qfv_box_rotations currently can't be shared across renderers
because if the Y-axis flip and the way it's handled, but sharing should
be achievable by modifying the other renderers to handle the sides
correctly (glsl and gl need to do lookups for the side enums, sw just
needs to be shown which way is up).
2023-07-30 11:13:48 +09:00
Bill Currie
931175b21d [vulkan] Run the shadow render passes
The shadow maps are rendered incorrectly because the matrices aren't set
correctly yet, but the dual-pass bsp rendering is working.
2023-07-29 01:17:53 +09:00
Bill Currie
3d4cca4393 [vulkan] Allow render passes to be run by processes
This lets the shadow step run its passes as needed.
2023-07-29 01:10:26 +09:00
Bill Currie
3b0dcd2cdc [vulkan] Connect the shadow pass to the renderers
It's only partially complete, but R_VisitWorldNodes is now run for both
the main pass and the shadow auxiliary pass.
2023-07-27 16:09:33 +09:00
Bill Currie
123bf14784 [scene] Add a leaf component to lights
Regular leaf number for positional lights, 0 for directional, and ~0 for
ambient.
2023-07-27 15:50:53 +09:00
Bill Currie
2790972cb0 [renderer] Separate core of R_MarkLeaves
I needed to mark leaves based on an arbitrary PVS (for lighting) that is
independent of the camera position. Also cleaned up some const
correctness.
2023-07-27 15:43:47 +09:00
Bill Currie
6c631693bd [vulkan] Clean out old command buffers from bsp
Missed from the render job cleanup.
2023-07-24 19:13:43 +09:00
Bill Currie
f4d6a41901 [vulkan] Hook up a shadow render job step
It doesn't do much yet, but did help in getting light ids working.
2023-07-24 19:13:43 +09:00
Bill Currie
05f0fe9204 [scene] Add a render-internal lightid component
The vulkan shadow code needs to associate extra information with the
lights, but I don't want such renderer-specific data in the scene.
2023-07-24 19:11:18 +09:00
Bill Currie
31cf3ed248 [vulkan] Register external attachments
This is along the lines of what I originally intended, but now I need
more than just the swapchain (which is now registered by vulkan_output).
2023-07-24 19:11:18 +09:00
Bill Currie
72f6048a20 [scene] Put lights into the bsp tree via efrags
This eliminates the O(N^2) (N = map leaf count) operation of finding
visible lights and will later allow for finer culling of the lights as
they can be tested against the leaf volume (which they currently are
not as this was just getting things going). However, this has severely
hurt ad_tears' performance (I suspect due to the extreme number of
leafs), but the speed seems to be very steady. Hopefully, reconstructing
the vis clusters will help (I imagine it will help in many places, not
just lights).
2023-07-22 17:53:07 +09:00
Bill Currie
c0f8d102ad [scene] Implement Scene_FreeAllEntities (and use it)
I guess I wasn't sure how to find all the allocated entities from within
the registry, but it turned out to be trivial. This takes care of leaked
static entities (and, in a later commit, leaked light entities, which is
how I found the problem).
2023-07-22 16:50:18 +09:00
Bill Currie
99c6c58e25 [vulkan] Expose pipeline disable controls
Finally, runtime control of the debug pipelines (and all the rest, but
that might come in handy at some stage).
2023-07-21 19:45:54 +09:00