Commit graph

14072 commits

Author SHA1 Message Date
Bill Currie
c512af4f21 [vulkan] Check output framebuffers exist before destroying
The output framebuffers array is dynamic, so trying to index it before
it has been created results in a segfault (which is rather inconvenient
during shutdown).
2024-01-19 15:45:04 +09:00
Bill Currie
52f012cc11 [console] Flush any pending draw data
This takes care of a 5s hang when the engine aborts before the first
frame is rendered (for vulkan).
2024-01-19 15:45:04 +09:00
Bill Currie
87357f98d3 [vulkan] Correct line vertex input spec (again)
This time for the forward renderer.
2024-01-19 15:45:04 +09:00
Bill Currie
5055860c1b [vulkan] Do lightmap flush after all lightmaps uploaded
This fixes the 5s hang on shutdown.
2024-01-19 15:45:04 +09:00
Bill Currie
4a99ef5723 [vulkan] Add a function to explicitly wait on a packet
It's not currently used, but it was very handy for finding where the
cause of the 5s hang was ***not***.
2024-01-19 15:45:04 +09:00
Bill Currie
bf0d1b4f6e [vulkan] Add tracy zones to most shutdown functions
This helped find the 5s hang on exit.
2024-01-19 15:45:04 +09:00
Bill Currie
3168550935 [vulkan] Upload lightmap data to the gpu and use it
The lightmaps aren't updated at all yet, so everything is static.
Figuring out how lightmap data gets to the gpu was a chore thanks to the
spaghetti in the bsp data, and then I'd forgotten that I was
pre-expanding the light data to rgb so wound up with weird lightmaps,
but without water or particles, demo1 is getting 5000fps at 800x450, and
it seems to be CPU limited.
2024-01-19 15:45:04 +09:00
Bill Currie
329c08b934 [vulkan] Use only a single subpass for forward main
Output is still a second pass for now.
2024-01-19 15:45:04 +09:00
Bill Currie
7ce94cde14 [vulkan] Fix some bitrot in the forward render graph
Many issues, but this fixes the validation errors.
2024-01-19 15:45:04 +09:00
Bill Currie
8994042a47 [qfcc] Support expanding constant expressions
This makes a slight improvement to the commutator product in that it
removes the expand statement, but there's still the problem of (a+a)/2.
However, at least now the product is correct and slightly less abysmal.
2024-01-19 15:36:47 +09:00
Bill Currie
aa9be53b6e [qfcc] Include divide by two in commutator product
I had forgotten this, and of course didn't have any tests.
2024-01-19 15:26:18 +09:00
Bill Currie
5c22ba118c [qfcc] Support aliasing constants
This takes advantage of evaluate_constexpr to do all the work. Necessary
for use of basis blade constants in algebra contexts (avoids an internal
error).
2024-01-18 13:08:21 +09:00
Bill Currie
ec9e2c12b8 [vulkan] Implement skin support
Finally, quakeworld gets its *ahem* fancy skins. I'm not happy with how
skin loading is handled, but the whole model and skin support needs a
redesign.

Closes #74.
2024-01-15 19:07:33 +09:00
Bill Currie
fcd094ef04 [skin] Fix up dynamic library issues
And further clean up skin api.

It turns out that skin functions must all be in the render libs, and
this results in Skin_Set (was Skin_SetSkin) needs to be accessed via a
function pointer rather than directly :(
2024-01-15 15:26:09 +09:00
Bill Currie
d39630580e [skin] Get team colors working for model skins
This should actually get team colors working for all models, not just
player.mdl.
2024-01-15 14:59:11 +09:00
Bill Currie
baa11cd710 [image] Ensure tex fields are all initialized
Designated initializers for the win.
2024-01-15 14:59:11 +09:00
Bill Currie
346ed29f49 [skin] Implement top/bottom colors for gl
They don't work yet if the entity does not have an external skin.
2024-01-15 14:59:06 +09:00
Bill Currie
0539f07c1a [skin] Use an ECS registry to manage skins
This takes care of the double free and also cleans up a lot of the skin
api. However, the gl renderer lost top/bottom colors (for now). Vulkan
skins still don't work yet.
2024-01-15 14:56:37 +09:00
Bill Currie
739adad3d5 [skin] Clean up the API a little
Only the renderer-specific functions are in the plugin functions struct,
and only the client functions are global.
2024-01-13 13:42:03 +09:00
Bill Currie
6c03d72c26 [qw] Clean up player info processing
It should be much harder for a malicious server to crash the client
(there were a few holes in there still).

Also, set the fallback (server didn't specify) top/bottom colors to be
such that the default colors from the skin are used instead of white.
2024-01-13 13:22:52 +09:00
Bill Currie
ad852a15b6 [qw] Add a cvar to control player shadows
cl_player_shadows defaults to 1 thus giving a nice (for the resolution)
shadow of the player (and disables the weapon shadow). Mirrors the
change to nq (I really need to get these last bits merged).
2024-01-13 02:43:15 +09:00
Bill Currie
e978234018 [qw] Fix a bunch of punchangle issues
punchangle wasn't getting decayed for two reasons: I had forgotten to
set the flag in qw, and the decayed value was not getting written to
viewstate.

Also, the rotation was misapplied (I had the two quaternions swapped) so
punchangle was being applied to world Y instead of local Y, thus the
seemingly random rolls.
2024-01-13 02:00:23 +09:00
Bill Currie
962438bddc [sound] Flush sfx hash table on gamedir change
Along with "releasing" all the sfx entries, need to flush the name
lookup so correct names don't get the wrong sounds. Fixes the ricochet
sound for rocket explosions (and shotgun sounds for nail guns) in
quakeworld.
2024-01-13 01:03:23 +09:00
Bill Currie
80a4970ee6 [qw] Keep the predicted players in the world
Wandering off to infinity makes for some interesting side effects (in
solid, world partially drawn). Fixes the green screen and missing walls
for the first few seconds of being in a map.
2024-01-12 23:59:48 +09:00
Bill Currie
163451a29a [qw] Test the muzzle_flash flag
I had forgotten this when doing dynamic lights on entities. Fixes the
eternal flickering light.
2024-01-12 23:15:06 +09:00
Bill Currie
c01c4180f3 [glsl] Handle verts with no bones
Same issue as in vulkan (surprise surprise, considering the glsl code
came first).
2024-01-09 20:42:18 +09:00
Bill Currie
119e9766b9 [iqm] Use 32-bit indices for large models
That is, those with more than 65520 vertices. Not properly supported for
sw or gl, and glsl isn't rendering properly for some reason (renderdoc
does see the meshes, though, so maybe depth or winding issues).
2024-01-09 13:36:46 +09:00
Bill Currie
834587f102 [ui] Update mouse buttons only for button events
This seems to have fixed the sticky mouse. If nothing else, I've at
least established that the problem is in IMUI (it sees the events) and
not in QF's input system.
2024-01-09 09:58:03 +09:00
Bill Currie
3cd0703249 [ui] Implement scroll bars
There's a bit of nasty hard-coding around passages at the moment, but
the basics are working in a fairly generic way.
2024-01-09 09:12:29 +09:00
Bill Currie
c460d03371 [ui] Propagate passage view size to its container
This gets the container view sized properly such that the scroll box has
something to work with for determining how much the view can slide.
2024-01-08 11:18:21 +09:00
Bill Currie
97a83bf1ed [ui] Move passage paragraph placement into text handling
This allows the passage view to be sized properly during imui's layout
phase.
2024-01-08 10:27:17 +09:00
Bill Currie
ab702d7fb7 [ui] Add some more info to imui tree dumps
Item name (from state label) and flags for onresize and onmove.
2024-01-08 00:38:00 +09:00
Bill Currie
c9a8a340f0 [ecs] Don't free the name string pointer
At least for now, anyway, I think the ecs should not own the entity
name: doing so makes ownership of the string a nightmare.
2024-01-07 13:50:48 +09:00
Bill Currie
585c47bc2d [ui] Use actual fractions for fractional values
Integral percentage is not always enough.
2024-01-07 12:03:22 +09:00
Bill Currie
2e00fd1165 [ui] Pass a data pointer to update functions 2024-01-07 11:58:01 +09:00
Bill Currie
32c65294ba [ui] Use a view-relative anchor position for drags
With this, the mouse no longer stays disconnected from the dragged item
when the item can't move any further. It does show some interesting
behavior when window resizes don't behave, but it's still an
improvement.
2024-01-06 19:39:42 +09:00
Bill Currie
aa5dc657fd [ui] Add some basic math ops for view_pos_t
Just add and subtract, but I got tired of having to write two lines of
code for such.
2024-01-06 19:38:20 +09:00
Bill Currie
082d00b6c3 [ui] Use the shaped text cache for passage text
This makes a pretty significant difference (~520us down to 80us) for
simple text passage, and even the first time is fast due to word
repetition.
2024-01-06 02:59:31 +09:00
Bill Currie
ce7c2183d3 [ecs] Delay component destruction
Copy the component out of the pool so that it can be overwritten now,
thus removing it from the pool, before actually destroying the component
so that any recursive removals of the same component don't mess up the
indices, and also don't try to remove the component from the same
entity.

This fixes a rather sneaky component leak caused by said recursion.
2024-01-06 02:11:31 +09:00
Bill Currie
0307e9d165 [ui] Set all glyph views to be free-floating
This gets passage text working mostly nicely in IMUI: just some
ascender/descender issues.
2024-01-06 00:13:22 +09:00
Bill Currie
1ab68ca5fd [vulkan] Correct line vertex input spec
I suspect I may have done the incorrect offset for color to get a
gradient for some testing, but forgot to put it back. Or, of course, I
just completely and utterly brain-farted when writing the attribute.
2024-01-05 22:44:09 +09:00
Bill Currie
969678d53c [ui] Update passage paragraph vertical offsets
Descenders still cause problems for layout, but now the paragraphs are
no longer on top of each other. Also, the paragraph spacing is currently
hard-coded (but should be part of a style).
2024-01-05 17:30:44 +09:00
Bill Currie
4d0c1c66b3 [ui] Refresh hierarchy pointers
With the change to hierarchies being components, any pointers to the
hierarchy component are not stable and must be refreshed after the
possibility of adding or removing a hierarchy.
2024-01-05 16:34:18 +09:00
Bill Currie
c2316a4173 [ui] Add support for passage views to imui
It was a right cow to get working at all due to the tangled mess of
dependencies between different hierarchies (switching to hierarchies as
components helpt), but other that some vertical positioning (paragraphs
and descenders), it's working fairly well now (and fairly quick other
than I think I need to ensure the shaping cache is used).
2024-01-05 16:34:18 +09:00
Bill Currie
871d8729f5 [ruamoko] Free fonts on shutdown
I guess I had figured out how to free fonts sometime after writing
rua_gui.c.
2024-01-05 11:50:48 +09:00
Bill Currie
9b0589f7e5 [ruamoko] Add tracy zones
Mostly for tracking memory issues, but handy for seeing where time is
spent, of course.
2024-01-05 11:50:48 +09:00
Bill Currie
0ed4df3fb9 [quakeio] Rework Qgetline to use dstring
This clears up its stray memory allocation, and incidentally makes it
thread-safe.
2024-01-05 11:50:48 +09:00
Bill Currie
860f48d541 Clean up about 12000 allocations
Some of them were actual leaks, but tracking memory should be a lot
easier now. However, there's a lot of room for optimization of
allocations (eg, recylcling of hierarchies. There is now 1 active
allocation (according to tracy) when nq exits: Qgetline's string buffer
(I think an api change is in order).
2024-01-05 11:50:48 +09:00
Bill Currie
929b1f0662 [ui] Plug a memory leak and use-after-free in imui
The leak was due to forgetting to reset the links array, and
use-after-free needed running through the imui_reference pool to reset
any owning links.
2024-01-05 11:50:48 +09:00
Bill Currie
bfa7c1722a [build] Implement tracy memory zones
This proved to be quite the challenge, and is probably rather fragile,
but it does seem to work, and might help with tracking down memory
leaks.
2024-01-05 11:50:48 +09:00