Commit graph

13514 commits

Author SHA1 Message Date
Bill Currie
eb8fc0fb9a [vulkan] Be clearer about descriptor set layouts vs sets
This get pretty confusing when you refer to both the sets and the set
layouts in close vicinity.
2023-03-29 09:45:17 +09:00
Bill Currie
511389a973 [set] Use correct size for set_bits_t on arm64 2023-03-28 17:10:55 +09:00
Bill Currie
d39f1307c5 [set] Make static init sets compatible with normal
When using SET_STATIC_INIT, the set size needs to be the same as what
set_new() would create for the same number of bits, otherwise the set
will possibly get resized incorrectly (which is bad news when the array
was allocated using alloca). While this is really a symptom of
set_bits_t not getting the right size, getting weird segfaults is not a
good way to diagnose the problem, and set_bits_t being the wrong size is
just a minor pessimism.
2023-03-28 17:01:05 +09:00
Bill Currie
451a98d391 [ruamoko] Avoid copying a block of memory to itself
Not a big deal, but valgrind didn't like it.
2023-03-28 13:23:14 +09:00
Bill Currie
9317ce7358 [ruamoko] Handle missing fonts correctly
Carrying on as if the missing font had been loaded leads to way too many
issues for it to be a good thing (not that that really needs to be
said). Fixes the segfaults in my test scene.
2023-03-28 13:23:14 +09:00
Bill Currie
eb41231559 [ruamoko] Avoid copying a block of memory to itself
Not a big deal, but valgrind didn't like it.
2023-03-28 13:21:57 +09:00
Bill Currie
25c51e8711 [ruamoko] Handle missing fonts correctly
Carrying on as if the missing font had been loaded leads to way too many
issues for it to be a good thing (not that that really needs to be
said). Fixes the segfaults in my test scene.
2023-03-28 13:20:29 +09:00
Bill Currie
53ae2fe223 [util] Fix more ULP issues in the simd tests on arm
This time for debug (unoptimized) builds. While I could just do an
approximate check, I think it's better to document (as such) the
expected errors.
2023-03-28 12:46:16 +09:00
Bill Currie
b1de1b8747 [util] Fix more ULP issues in the simd tests on arm
This time for debug (unoptimized) builds. While I could just do an
approximate check, I think it's better to document (as such) the
expected errors.
2023-03-28 12:43:05 +09:00
Bill Currie
47bfa23d09 [vulkan] Stub out the basic job execution
Really, a bit more than stub as the basic code is there, but nothing
works properly yet due to missing resources (especially descriptor sets
and pools), and the frame buffer creation is still disabled.
2023-03-28 10:28:44 +09:00
Bill Currie
34ece7ad03 [vulkan] Add buffer and buffer view support
Not fully implemented, but the parsing is done. Needed image view refs
to be renamed.
2023-03-28 00:15:04 +09:00
Bill Currie
aba057b827 [vulkan] Correct type of queue family
No idea why I had int32_t instead of uint32_t.
2023-03-27 23:51:32 +09:00
Bill Currie
a1e15603a3 [vulkan] Implement job initialization
The step dependencies are not handled yet as threading isn't used at
this stage, but since I'll require dependencies to always come earlier,
this shouldn't cause a problem.
2023-03-26 18:22:46 +09:00
Bill Currie
c3558091ac Fix some mxe build issues 2023-03-25 21:37:26 +09:00
Bill Currie
a8efde1dd3 Fix some mxe build issues 2023-03-25 21:36:45 +09:00
Bill Currie
c59840683d [plist] Use correct attribute for pl_error
Because mxe builds need gnu_printf instead of printf, need to use
PRINTF. I had forgotten that.
2023-03-25 21:31:24 +09:00
Bill Currie
86f2df4939 [vulkan] Respect the VULKAN_SDK environment variable
Thanks to Peter for the report and help in getting it working (I hope I
got all the changes right).
2023-03-25 21:21:13 +09:00
Bill Currie
f098bbf48b [util] Clean up some ULP errors in tests
The problem with floating point in unit tests is, well, comparisons are
finicky.
2023-03-25 21:21:13 +09:00
Bill Currie
f18837f195 [gamecode] Fix a pile of UB in the test cases
I always suspected the overflow conversions were UB, but with gcc doing
different things on arm, I thought it was about time to abandon those
particular tests. What I was not expecting was for the return value of
strcmp to be "UB" (in that there's no guarantee of the exact value, just
< = > 0). Fortunately, nothing actually relies on the value of the op
other than the tests, so modify the test to make the behavior well
defined.
2023-03-25 21:21:13 +09:00
Bill Currie
a058cff59f [util] Fix incorrect check for result of Qgetc
Qgetc returns int, not char. Found via arm compile due to sign of bare
char (or lack thereof).
2023-03-25 21:21:13 +09:00
Bill Currie
ef2793010c [simd] Improve portability for aarch64
No need for compiler flags for 64-bit arm, and the few intrinsics that
are actually needed are in a different header.
2023-03-25 21:21:13 +09:00
Bill Currie
2dd3ea2182 [vulkan] Respect the VULKAN_SDK environment variable
Thanks to Peter for the report and help in getting it working (I hope I
got all the changes right).
2023-03-25 18:39:46 +09:00
Bill Currie
5f6c007c7c [util] Clean up some ULP errors in tests
The problem with floating point in unit tests is, well, comparisons are
finicky.
2023-03-25 17:37:36 +09:00
Bill Currie
b82174558b [gamecode] Fix a pile of UB in the test cases
I always suspected the overflow conversions were UB, but with gcc doing
different things on arm, I thought it was about time to abandon those
particular tests. What I was not expecting was for the return value of
strcmp to be "UB" (in that there's no guarantee of the exact value, just
< = > 0). Fortunately, nothing actually relies on the value of the op
other than the tests, so modify the test to make the behavior well
defined.
2023-03-25 16:46:46 +09:00
Bill Currie
ae9787228e [util] Fix incorrect check for result of Qgetc
Qgetc returns int, not char. Found via arm compile due to sign of bare
char (or lack thereof).
2023-03-25 16:44:16 +09:00
Bill Currie
56344e478d [simd] Improve portability for aarch64
No need for compiler flags for 64-bit arm, and the few intrinsics that
are actually needed are in a different header.
2023-03-25 16:44:05 +09:00
Bill Currie
a1c67ea24b [vulkan] Implement most of the new job system
There's still the actual job objects to create, but all the vulkan bits
have been created and get destroyed on shutdown.
2023-03-22 19:32:49 +09:00
Bill Currie
2fbc27f6a0 [vkgen] Fix ignored field init and dealloc
I had somehow missed vkfieldignore in a consistency pass, or just messed
up its initialization (and thus deallocation) resulting in a double-free
of the strings.
2023-03-21 17:53:55 +09:00
Bill Currie
3fbac33ee8 [gl] Free alias model cache memory when clearing models
Like sw, gl uses the cache for alias models and thus needs to free the
cache memory when unloading the model.
2023-03-21 13:18:16 +09:00
Bill Currie
793525a50a [sw] Free alias model cache memory when clearing models
This fixes a Sys_Error when loading the level for the first demo (and
probably many other times). It was mod_numknown getting set to 0 that
triggered the issue, but that seems to be necessary for the other
renderers. I think the whole model loading and caching system needs an
overhaul as this doesn't feel quite right due to removing part of the
advantage of caching the model data.
2023-03-20 17:45:28 +09:00
Bill Currie
654b208641 [plist] Add functions to extend dictionaries and arrays
The idea is to make it easy (and efficient) to merge property list
items.
2023-03-15 19:47:30 +09:00
Bill Currie
5255c9c7a8 [set] Initialize pool's dynamic arrays
Testing had missed this because qfvis is the main user of set pools.
2023-03-15 10:17:42 +09:00
Bill Currie
68b5cd89d2 [vkgen] Plug a pile of ruamoko memory leaks
While the previous cleanup took care of the C side, it turns out vkgen
was leaking property list items all over the place, but they were
cleaned up by the shutdown code.
2023-03-13 11:26:13 +09:00
Bill Currie
7d4c1d79b1 [plist] Use reference counts for items
This makes it much easier to share items between property lists (eg,
targets and the main entity list in cl_light).
2023-03-13 11:26:13 +09:00
Bill Currie
45bcb31684 [vulkan] Use bare dictionaries for spec files
Every time I created a new file from scratch, I always forgot the
enclosing {}. Now I will probably include them by accident :P
2023-03-12 14:48:14 +09:00
Bill Currie
3cdcc2c62c [vkgen] Switch to bare dictionary for parse spec
This served as a nice test for the bare dictionary parsing (though
quakefs.c did, too), and even found a bug in vkgen's error handling.
2023-03-12 14:36:47 +09:00
Bill Currie
8f87407133 [ruamoko] Add wrappers for the new plist functions
With both file and string versions (as per PL_GetPropertyList).
2023-03-12 14:35:17 +09:00
Bill Currie
ea77df2daa [plist] Add parsing for bare dictionaries and arrays
Requiring top-level {} or () for (usually) hand-written files is awkward
and even a little error prone, and certainly ugly at times. With this,
loaders that expect a particular format can specify the format a little
more directly.
2023-03-12 14:31:17 +09:00
Bill Currie
e57a06f37b [plist] Refactor the dictionary and array parsing
This makes it easier to reuse the code for parsing bare dictionaries and
arrays.
2023-03-12 12:27:45 +09:00
Bill Currie
4cf1c167bd [vulkan] Start work on a render job system
The jobs will become the core of the renderer, with each job step being
one of a render pass, compute pass, or processor (CPU-only) task. The
steps support dependencies, which will allow for threading the system in
the future.

Currently, just the structures, parse support, and prototype job
specification (render.plist) have been implemented. No conversion to
working data is done yet, and many things, in particular resources, will
need to be reworked, but this gets the basic design in.
2023-03-10 19:47:40 +09:00
Bill Currie
374ca602a7 [vkgen] Use designated init for fixed array data
It seems I hadn't used fixed arrays for a while as the size field (which
really should be count) had moved and its spot taken by a data pointer.
2023-03-09 15:32:52 +09:00
Bill Currie
b9106c09cb [plist] Clean up string parsing
I had looked into doing reference counting on the strings, but didn't
like the implementation. However, it did make for better string handling
in the property list parser.
2023-03-09 13:33:49 +09:00
Bill Currie
98fb9e0942 [qfcc] Fix declarators for pointers/functions/arrays
I had messed up the handling of declarators for combinations of pointer,
function, and array: the pointer would get lost (and presumably arrays
of functions etc). I think I had gotten confused and thought things were
a tree rather than a simple list, but Holub set me straight once again
(I've never regretted getting that book). Once I understood that, it was
just a matter of finding all the places that needed to be fixed. Nicely,
most of the duplicated code has been refactored and should be easier to
debug in the future.
2023-03-09 10:27:20 +09:00
Bill Currie
ae5dbdb7fb [qfcc] Add failing test for function/array pointers
It turns out I broke the type system when it comes to pointers to
functions and arrays. This test checks basic function and array pointers
and passes with qfcc from before the type system rework.
2023-03-09 10:27:20 +09:00
Bill Currie
99af93c6e6 [qfcc] Actually skip compile for -E etc
The preprocess-only option wasn't being checked enough.
2023-03-09 10:27:20 +09:00
Bill Currie
119001de6f [qfcc] Ensure params and arguments have unique flow addresses
This fixes the false-negative in the dealloc-warn4.r test (and thus what
I found in vkgen), and should stave off a few other issues.
2023-03-09 10:27:20 +09:00
Bill Currie
1293fc5d0e [qfcc] Fix incorrect build error in dealloc-warn2
It was dying due to an undefined symbol rather than the warning.
2023-03-09 10:27:20 +09:00
Bill Currie
a5f82004bc [qfcc] Add failing test for super dealloc
While working on vkgen, I found a dealloc that wasn't calling [super
dealloc] but qfcc hadn't noticed it.
2023-03-09 10:27:20 +09:00
Bill Currie
faef61aab6 [vulkan] Ensure host-visible buffers are big enough to flush
Flushing memory requires nonCoherentAtomSize alignment, but this can
cause the flush range to go out of bounds of an improperly sized buffer.
However, only host-visible (and probably really only cached, but all
three covered) needs flushing, so no rounding up is done for
device-local memory.
2023-03-09 10:19:24 +09:00
Bill Currie
cee00c8243 [qfcc] Fix declarators for pointers/functions/arrays
I had messed up the handling of declarators for combinations of pointer,
function, and array: the pointer would get lost (and presumably arrays
of functions etc). I think I had gotten confused and thought things were
a tree rather than a simple list, but Holub set me straight once again
(I've never regretted getting that book). Once I understood that, it was
just a matter of finding all the places that needed to be fixed. Nicely,
most of the duplicated code has been refactored and should be easier to
debug in the future.
2023-03-09 02:22:23 +09:00