Commit graph

11351 commits

Author SHA1 Message Date
Bill Currie
4eb07220cd [util] Make plists more const-correct 2021-02-25 11:55:25 +09:00
Bill Currie
f8961e4376 [qflight] Fix some typos in comments 2021-02-25 10:12:19 +09:00
Bill Currie
6c1d6666b4 [vulkan] Actually write the alias g-buffer commands
It seems to help for some reason.
2021-02-24 20:24:46 +09:00
Bill Currie
10a1b99a92 [vulkan] Implement lighting and compose passes
Lighting doesn't actually do lights yet, but it's producing pixels.
Translucent seems to be working (2d draw uses it), and compose seems to
be working.
2021-02-24 19:58:31 +09:00
Bill Currie
9229b67633 [vulkan] Clean up the new render pass and framebuffers 2021-02-24 16:27:56 +09:00
Bill Currie
e6ecf5e855 [vulkan] Fix up commands for deferred rendering
Nothing gets output yet (lighting and composite passes not implemented),
but everything passes validation until exit (not destroying everything).
2021-02-23 15:43:02 +09:00
Bill Currie
82eabb5ca2 [vulkan] Parse clear values
And get the render pass working in general. Note that this is only the
render pass and frame buffers: actual commands still have problems.
2021-02-23 14:37:48 +09:00
Bill Currie
0cd2ece38e [util] Correct element order for vector expressions 2021-02-23 14:37:13 +09:00
Bill Currie
cbc8ad271a [vulkan] Convert bsp and draw to deferred
This has bsp and draw passing muster with the validation layers.
2021-02-19 11:14:54 +09:00
Bill Currie
4245c6ad3b [vulkan] Specify subpass number in pipeline def
This gets the alias model render pass and pipeline passing validation.

I don't know why I didn't add the subpass field to the
VkGraphicsPipelineCreateInfo parser def, though it could be I simply
missed it, or I thought I wouldn't need it at the time.
2021-02-17 13:50:36 +09:00
Bill Currie
64740b0f73 [vulkan] Create shaders for alias deferred rendering
A simple (no uv output) vertex shader that still blends the two frames,
and the relevant g-buffer fragment shader.
2021-02-17 13:35:19 +09:00
Bill Currie
b08c3881b9 [vulkan] Add a comment about using size_t
Due to wanting to access array sizes when parsing uint32_t type values,
parse_uint32_t needs to handle size_t values even though it throws out
any excess bits.
2021-02-17 13:32:04 +09:00
Bill Currie
4bda49d798 [util] Correct the lex priority for int constants
The actual need to specify unsigned int constant is a bit of a pain, but
not being able to do so due to lex priority errors is even more of a
pain.
2021-02-17 13:29:53 +09:00
Bill Currie
a94949c009 [vulkan] Start moving towards a deferred renderer
After getting lights even vaguely working for alias models, I realized
that it just wasn't going to be feasible to do nice lighting with
forward rendering. This gets the bulk of the work done for deferred
rendering, but still need to sort out the shaders before any real
testing can be done.
2021-02-14 11:35:06 +09:00
Bill Currie
121425a75b [vulkan] Allow all struct objects to be referenced 2021-02-14 11:32:57 +09:00
Bill Currie
cffd48434c [vulkan] Move the shaders into their own directory 2021-02-10 17:43:11 +09:00
Bill Currie
55104ac430 [util] Allow "any type" results for cexpr
Setting the result type cexpr_exprval tells cexpr to simply return whoe
exprval object rather than the referenced value, thus allowing the
caller to check the type when the expression is context sensitive.
2021-02-09 19:30:30 +09:00
Bill Currie
35f12c36ff [util] Catch some more cexpr errors 2021-02-09 19:29:48 +09:00
Bill Currie
5535d1f8e6 [util] Keep track of plist dictionary key order
The order in which keys are added to the dictionary object is
maintained. Adding a key after removing an old key adds the new key to
the end of the list rather than reusing the old key's spot.
2021-02-09 17:03:33 +09:00
Bill Currie
0dcd946063 [util] Add plist parser for dictionary -> array
PL_ParseLabeledArray works the same way as PL_ParseArray, but instead
takes a dictionary object. The keys of the items are ignored, and the
order is not preserved (at this stage), but this is a cleaner solution
to getting an array of objects when the definitions of those objects
need to be accessible by name as well.
2021-02-09 15:24:28 +09:00
Bill Currie
bc763da9f6 [qfcc] Fix a typo in the man page 2021-02-09 15:02:22 +09:00
Bill Currie
14e4fd9f6a [util] Pass context to the plist array/symtab parser allocator 2021-02-09 15:01:55 +09:00
Bill Currie
a408fd40da [util] Make plist more const-correct 2021-02-09 14:56:48 +09:00
Bill Currie
c8afbdf0f5 [util] Add an object-based fixed array allocator 2021-02-09 14:56:11 +09:00
Bill Currie
fdba822809 [util] Fix a code-comment disagreement
And the comment was correct :P
2021-02-09 14:43:45 +09:00
Bill Currie
8664a5b969 [util] Enable parser debugging for cexpr
Not actually turned on in the code, but cexpr_yydebug is present.
2021-02-09 10:02:04 +09:00
Bill Currie
dfa7af03c6 [util] Plug a thread-safety hole in plists 2021-02-09 09:57:07 +09:00
Bill Currie
84dc73da2c [test] Get the tests building again
They happen to all pass, which is nice :)
2021-02-05 21:43:12 +09:00
Bill Currie
f023675f8c [vulkan] Clean up draw's memory handling a little
Use cmem for pic and cachpic name allocations. If nothing else, it at
least keeps memory a little less fragmented.
2021-02-05 16:25:08 +09:00
Bill Currie
c536a363ec [vulkan] Remove namehack.h
Never really wanted in the first place (back when I did the plugin
renderers), but I didn't feel like doing the required work to avoid it
at the time. At least with Vulkan being a fresh start in an environment
that's already plugin-friendly, there was no real work involved. I'll
get to the other renderers eventually (especially now that I know gdb
does the right thing when there are multiple functions with the same
name).
2021-02-05 11:10:43 +09:00
Bill Currie
f633a846a1 [vulkan] Make the frames in flight configurable 2021-02-05 11:06:18 +09:00
Bill Currie
1275067655 [vulkan] Rename vulkan_framebuffer_t
It turns out I had conflated frame buffers with frames and wound up
making a minor mess when separating the number of frames the renderer
could have in flight from the number of swap-chain images. This is the
first step towards correcting that mistake.
2021-02-05 10:22:32 +09:00
Bill Currie
7ffe197564 [vulkan] Remove some dead code
I forgot to delete that block of code after getting the new code working.
2021-02-05 10:19:57 +09:00
Bill Currie
e929dca300 [util] Auto-cast plist string items
The casting uses a recursive call to the expression parser, so the
expressions are type-checked automatically.
2021-02-04 22:37:20 +09:00
Bill Currie
a54de63fee [vulkan] Take care of the duplicate handles 2021-02-04 20:40:28 +09:00
Bill Currie
8179c44042 [vulkan] Rework pipeline parsing for better reuse
It's not entirely there yet, but the basics are working. Work is still
needed for avoiding duplication of objects (different threads will have
different contexts and thus different tables, so necessary per-thread
duplication should not become a problem) and general access to arbitrary
fields (mostly just parsing the strings)
2021-02-04 17:03:49 +09:00
Bill Currie
d2536e584f [util] Add plist support to cexpr
This allows plist objects to be accessed directly from cexpr expressions
using struct.field syntax for dictionary objects and array[index] syntax
for array objects.
2021-02-04 16:58:13 +09:00
Bill Currie
846fcc276c [nq] Allow free-fps for demo playback
I still need to look into making physics (and network, I imagine) work
with unlimited frame rates, but this gets in what I need for now.
2021-02-03 18:24:15 +09:00
Bill Currie
5d1d85f72e [util] Resurrect Hunk_Print and fix some errors
It turned out that Hunk_HighAlloc was not creating a hunk header
(ancient bug by me), and I cleaned up a bunch of name-size issues, along
the way.
2021-02-03 13:21:08 +09:00
Bill Currie
0bfb60775e [util] Ensure hunk allocs are cache alligned
This doesn't seem to make much difference in the vulkan renderer, but it
certainly doesn't hurt.
2021-02-03 13:19:19 +09:00
Bill Currie
bc7858bb87 [model] Move parent pointer out of leaf/node struct
The node struct was 72 bytes thus two cache line. Moving the pointer
into the brush model data block allows nodes to fit in a single cache
line (not that they're aligned yet, but that's next). It doesn't seem to
have made any difference to performance (at least in the vulkan
renderer), but it hasn't hurt, either, as the only place that needed the
parent pointer was R_MarkLeaves.
2021-02-03 11:41:38 +09:00
Bill Currie
ebb73e19b2 [vulkan] Use the msaaSamples cvar
That took a bit of fiddling with the render pass to get things working
for both sampling and no sampling (ie, msaaSamples = 1).
2021-02-03 00:08:33 +09:00
Bill Currie
22fe49d0ef Add support for loading an alternative palette.
Sort of at the request of leileilol (a utility to create quakepal.py was
asked for, but this seems to be better approach). However, the feature is
not used yet (needs hooks in the import and export modules).
2021-02-02 21:47:34 +09:00
Bill Currie
d6b678ac78 [vulkan] Implement team colors
It's not quite as expected, but that may be due to one of msaa, the 0-15
range in the palette not being all the way to white, the color gradients
being not quite linear (haven't checked yet) or some combination of the
above. However, it's that what should be yellow is more green. At least
the zombies are no longer white and the ogres don't look like they're
wearing skeleton suits.
2021-02-02 19:53:36 +09:00
Bill Currie
8e63ab9f94 [vulkan] Use 4 layer arrays for alias skins
Doesn't seem to make much difference performance-wise, but speed does
seem to be fill-rate limited due to the 8x msaa. Still, it does mean
fewer bindings to worry about.
2021-02-02 00:11:47 +09:00
Bill Currie
0d4ca46923 [vulkan] Move mip map generation commands to image 2021-02-02 00:04:45 +09:00
Bill Currie
ea72d0c60e [model] Clean up the globals for alias models 2021-02-01 21:11:45 +09:00
Bill Currie
34dc7cf2df [models] Move brush data into its own struct
This is a big step towards a cleaner api. The struct reference in
model_t really should be a pointer, but bsp submodel(?) loading messed
that up, though that's just a matter of taking more care in the loading
code. It seems sensible to make that a separate step.
2021-02-01 19:31:11 +09:00
Bill Currie
6969adf02c [models] Fix black models with fullbrights in GL
I had missed the breakage when I got vulkan alias model skins working.
2021-02-01 19:20:10 +09:00
Bill Currie
f02b35a20c [model] Clean up the model array a little
Probably not really necessary, but I think I found a small opportunity
for a buffer overflow in there while I was modifying the code, so this
is probably better anyway.
2021-02-01 15:02:42 +09:00