Commit graph

78 commits

Author SHA1 Message Date
Bill Currie
c0c728b188 [vulkan] Fix a few code generation issues
QC's int type is named "integer" (didn't feel like changing that right
now), so special case it to be "int".

Output the parse func name (instead of "fix me").

Output a parse func for enums (needed for arrays of enums
(VkDynamicState)).
2020-12-25 00:17:20 +09:00
Bill Currie
cb2bdb0224 [util] Rename PL_ParseDictionary to PL_ParseStruct
Struct is far more appropriate for its function, and I need to parse a
dictionary into a hash table.
2020-12-24 13:33:37 +09:00
Bill Currie
5c0ce2c414 [vulkan] Correct the usage of custom field offsets
I had missed the array declaration and thus initialized the pointer to
the offset array incorrectly. Didn't show up until I tried using
multiple offsets.
2020-12-24 11:50:52 +09:00
Bill Currie
2430f44d7b [vulkan] Support parsing numeric types 2020-12-24 09:58:27 +09:00
Bill Currie
25ade4c0f3 [vulkan] Add support for custom parsers
And provisionally parse shader stage defs.
2020-12-24 01:36:17 +09:00
Bill Currie
017d2c1f44 [vulkan] Refactor vkgen struct generation
The addition of data an then string support made keeping track of things
in struct's writeTable a nightmare.
2020-12-23 22:13:50 +09:00
Bill Currie
7fb335a215 [vulkan] Add support for building and loading shaders
Shaders can be built as spv files and installed into
$libdir/quakeforge/shaders or as spvc files and compiled into the
engine. Loading supports $builtin/name to access builtin shaders,
$shader/path to access external standard shaders and quake filesystem
access for all other paths.
2020-12-23 14:32:29 +09:00
Bill Currie
f1848bb5b7 [vulkan] Add support for parsing binary data 2020-12-23 14:08:53 +09:00
Bill Currie
91c5baa708 [util] Add size_t support to cexpr 2020-12-23 14:06:20 +09:00
Bill Currie
80aec45e35 [vulkan] Ensure msaa settings are consistent
I had forgotten that msaa samples was governed by the driver (as a max)
and the renderpass setup code simply took the max. Thus why 1 vs 8
caused the display to render incorrectly.
2020-12-21 20:17:27 +09:00
Bill Currie
ac8206555e [vulkan] Get the parsed pipeline working
It turned out the msaa setting defaulting to 1 instead of 8 was the
problem no idea why at this stage (need to read up on just how that
setting works). Once I understand just how it works, I'll rework the
msaa handling.
2020-12-21 19:30:00 +09:00
Bill Currie
96df447c45 [vulkan] Hook up the expression parser
The pipeline parser still isn't hooked up yet as something isn't quite
right, but it seems all the parsing works.
2020-12-21 18:38:31 +09:00
Bill Currie
591667c36d [util] Add a context parameter to the plist parsers
Not used by the dict/array parsers themselves, but is passed on to any
value parser callbacks for their own use.
2020-12-21 14:22:42 +09:00
Bill Currie
ab04a1915e [build] Fix a pile of gcc 10 issues
gcc got stricter about array accesses, complicating progs macros, and
much better at detecting buffer overflows.
2020-12-21 14:14:29 +09:00
Bill Currie
91ff15ca7c [vulkan] Correct some plist errors in the renderpass
Typos and incorrect attachment array reference.
2020-07-17 00:33:00 +09:00
Bill Currie
f4c8d341e1 [vulkan] Implement most of the parser
This gets renderpass parsing almost working (not hooked up, though). The
missing bits are support for expressions for flags (namely support for
the | operator) and references (eg $swapchain.format). However, this
shows that the basic concept for the parser is working.
2020-07-17 00:29:53 +09:00
Bill Currie
8184c546db [vulkan] Fix dereference for non-pointer aliases
Fixes breakage for uint32_t for array/single handling.
2020-07-17 00:24:41 +09:00
Bill Currie
79177e96e8 [vulkan] Start work on scripted pipeline
Nothing is actually done yet other than parsing the built-in property
list to property list items (the actual parser is just a skeleton), but
everything compiles
2020-07-16 22:14:19 +09:00
Bill Currie
0945f30731 [vulkan] Use a property list to drive code gen
The property list specifies the base structures for which parser code
will be generated (along with any structures and enums upon which those
structures depend). It also defines option specialized parsers for
better control.
2020-07-05 16:53:35 +09:00
Bill Currie
e4ee5c70e0 [vulkan] Rework vkgen alias handling
This is much cleaner and now that all the types are there properly,
doing a parser generator should be easier.
2020-07-05 16:53:35 +09:00
Bill Currie
2ca9f80d56 [vulkan] Split up vkgen
It worked as a proof of concept, but as the code itself needs to be a
bit smarter, it would be a lot smarter to break up that code to make it
easier to work on the individual parts.
2020-07-05 16:53:35 +09:00
Bill Currie
cf3262991d [vulkan] Add a tool for making vulkan enum tables
The tables are generated from the enums pulled out of the vulkan headers
using a ruamoko program (thanks to its reflection capabilities). They
will be used for parsing property lists used to create render passes and
pipelines.
2020-06-28 19:08:18 +09:00
Bill Currie
19c75f5e49 [vulkan] Clean up QFV_CreateFramebuffer's prototype
It now takes qfv_imageviewset_t instead of separate count and
VkImageView array.
2020-06-28 13:53:11 +09:00
Bill Currie
c1ffb05b87 Remove dead Makefile.am
Forgot this in the merge.
2020-06-25 16:14:39 +09:00
Bill Currie
86b5b30b45 Merge branch 'master' into vulkan 2020-06-25 14:03:52 +09:00
Bill Currie
ad175d054b Sanitize pipelines
wow, talk about doing things the wrong way. I guess that's the problem
with following a book targeted for C++: you get all that safety-goat
nonsense.
2020-02-18 22:38:01 +09:00
Bill Currie
264c4ccdac Sanitize descriptors
I'm sure it will end soon, I think pipelines is the end of it.
2020-02-18 21:18:03 +09:00
Bill Currie
c740dea212 Use the correct constant for "infinity" 2020-02-18 19:44:40 +09:00
Bill Currie
0a0035e5e5 Use the render pass to clear the window
Very satisfying to get to this point.
2020-02-18 17:48:22 +09:00
Bill Currie
ba654b09f7 Create and destroy render pass and frame buffers 2020-02-18 17:18:37 +09:00
Bill Currie
1f4c019abc Create and destroy color/depth resources 2020-02-18 14:28:28 +09:00
Bill Currie
89d48b5650 Output first pixels
Just clearing the screen to 0xbada55, but the validation layer is quiet.
2020-02-18 01:03:36 +09:00
Bill Currie
73fde40cad Sanitize some more structs 2020-02-17 23:30:25 +09:00
Bill Currie
94565c2382 Rework much of the Vulkan array handling
So much for all those little wrappers hiding the device. Some survived,
but mostly just the bigger things like device, swapchain, etc.
2020-02-17 20:29:35 +09:00
Bill Currie
ce72135e70 Fix incorrect init of command buffer set 2020-02-17 00:10:59 +09:00
Bill Currie
4b152a4492 Rework semaphore sets 2020-02-17 00:10:32 +09:00
Bill Currie
b947cc1791 Rework command buffer and fence-set management
I found command buffer handling to be totally redundant and fence-set
management to be a bit awkward.
2020-02-16 22:43:57 +09:00
Bill Currie
d56f88f779 Implement swapchain image acquisition 2020-02-15 17:56:02 +09:00
Bill Currie
53b46f0541 Implement pipeline stuff 2020-02-13 04:21:35 +09:00
Bill Currie
69c110193a Fix a thinko
Wrong var for computing number of slots used.
2020-02-13 04:20:54 +09:00
Bill Currie
61036378e2 Implement render pass stuff 2020-02-12 18:55:51 +09:00
Bill Currie
44f5b134e6 Free custom descriptor structs
Forgot this earlier
2020-02-12 18:55:22 +09:00
Bill Currie
85a2f9f621 Implement descriptor stuff 2020-02-12 16:36:01 +09:00
Bill Currie
6e96b91aa1 Fix a couple more optimization warnings 2020-02-11 15:59:12 +09:00
Bill Currie
3144443a82 Allow vulkan_draw to compile when optimizing
Even though it's nowhere near done
2020-02-11 12:19:16 +09:00
Bill Currie
29b1d6baf8 Finish up memory stuff
For now, of course.
2020-02-11 09:37:04 +09:00
Bill Currie
1baee0cbba Implement mem mapping and buffer/image copying 2020-02-10 20:42:19 +09:00
Bill Currie
43e37aa31e Separate out the generic memory stuff 2020-02-10 18:33:29 +09:00
Bill Currie
9fdc15c439 Implement image stuff up to view creation 2020-02-10 18:18:37 +09:00
Bill Currie
f4c0d0ebcf Implement buffer view creation
And rename memory allocation as it's buffer-specific.
2020-02-10 18:17:58 +09:00