Commit graph

1549 commits

Author SHA1 Message Date
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
9ff4eefe65 Merge branch 'master' into vulkan 2020-02-16 18:17:50 +09:00
Bill Currie
f5741a979e Implement parameter alignment in the engine
The engine now requires non-v6 progs to store the log2 alignment for the
param struct in .param_alignment.

PR_EnterFunction is clearer and possibly more efficient.
2020-02-16 17:13:45 +09:00
Bill Currie
7a399c956b Encode function parameter alignment
The encoding is 3:5 giving 3 bits for alignment (log2) and 5 bits for
size, with alignment in the 3 most significant bits. This keeps the
format backwards compatible as until doubles were added, all types were
aligned to 1 word which gets encoded as 0, and the size is unaffected.
2020-02-16 17:10:43 +09:00
Bill Currie
b4fd804e4e Implement true modulo in the engine 2020-02-16 11:53:56 +09:00
Bill Currie
4269c8cb07 Rename the mod instruction to rem
Because % really implements remainder rather than true modulo, and I
plan on adding %% to implement true modulo.
2020-02-16 11:04:30 +09:00
Bill Currie
98216c6eb0 Fixed some missed doxygen updates 2020-02-15 23:49:12 +09:00
Bill Currie
df7c08a010 Add support for doubles to Ruamoko
Only as scalars, I still need to think about what to do for vectors and
quaternions due to param size issues. Also, doubles are not yet
guaranteed to be correctly aligned.
2020-02-15 23:49:12 +09:00
Bill Currie
c50dda1d08 Document segmented text 2020-02-15 23:48:47 +09:00
Bill Currie
8654ac44bb Fix incorrect struct forward declaraction 2020-02-15 17:56:11 +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
61036378e2 Implement render pass stuff 2020-02-12 18:55:51 +09:00
Bill Currie
85a2f9f621 Implement descriptor stuff 2020-02-12 16:36:01 +09:00
Bill Currie
31501ad641 Add some docs for linked lists
Found in an old stash
2020-02-12 10:52:47 +09:00
Bill Currie
9248e8cf01 Update for doxygen 1.8.16 2020-02-11 15:22:42 +09:00
Bill Currie
fbd79963bb Update for doxygen 1.8.16 2020-02-11 15:20:49 +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
Bill Currie
2f9ad73f78 Implement buffer memory up to barriers
Still lots to go (views, destruction, transfer...) and I'm uncertain
about the location of the pipeline barrier function.
2020-02-10 15:07:35 +09:00
Bill Currie
8148f256f5 Rework object device caching
It turned out I needed access to the physical device from a buffer
object, so rather than storing the vulkan logical device directly in
buffer (and other) objects, store the qfv logical device.
2020-02-07 11:45:05 +09:00
Bill Currie
d3b4e4653e Cache physical devices in the instance 2020-02-06 19:04:28 +09:00
Bill Currie
4957c4f31a Implement the rest of the command stuff 2019-07-23 13:05:32 +09:00
Bill Currie
a165d67dfa Add a queue type 2019-07-23 12:37:47 +09:00
Bill Currie
411b897f09 Implement most of the stuff for command submission 2019-07-23 12:28:57 +09:00
Bill Currie
ae11a70147 Correct a comment 2019-07-23 12:27:57 +09:00
Bill Currie
b4dc746a66 Clean up the debug callback 2019-07-13 01:11:34 +09:00
Bill Currie
1eafc33052 Ensure vulkan gets shut down 2019-07-13 00:36:21 +09:00
Bill Currie
4e4d1b99b4 Clean up all the system shutdown calls
I added Sys_RegisterShutdown years ago and never really did anything
with it: now any system that needs to be shutdown can ensure it gets
shutdown on program exit, and in the correct order (ie, reverse to init
order).
2019-07-12 23:15:26 +09:00
Bill Currie
b2e12d701b Fix up swapchain creation
Things are working again.
2019-07-12 14:09:42 +09:00
Bill Currie
75f19f7243 Completely rework the vulkan related api
Things don't work yet, but this feels much cleaner.
2019-07-12 13:34:31 +09:00
Bill Currie
c0bc5cfad6 Implement swapchain creation 2019-07-11 00:58:14 +09:00
Bill Currie
2771e9c573 Correct extension handling
I had missed a critical bit from the cookbook.
2019-07-10 13:16:46 +09:00
Bill Currie
31ead15e96 Add comment about developer flags 2019-07-09 22:04:48 +09:00
Bill Currie
8a3cd224a3 Add vulkan developer flag 2019-07-09 20:14:30 +09:00
Bill Currie
68449d0f6f Create a window and a surface for vulkan
Yay, segfaults in R_Init :)
2019-07-09 16:33:44 +09:00
Bill Currie
b3d982bfc3 Remove global vulkan_ctx
While I can't say that I'm happy with the details of vulkan_ctx_t, I am
pretty sure I don't want to be limited to having only one.
2019-07-09 11:54:23 +09:00
Bill Currie
707bdfc5f2 Get vulkan back to where it was 2019-07-09 09:06:35 +09:00
Bill Currie
8ee06d75a9 Separate render and presentation initialization
This paves the way for clean initialization of the Vulkan renderer, and
very much cleans up the older renderer initialization code as gl and sw
are no longer intertwined.
2019-07-09 01:00:47 +09:00
Bill Currie
cb10175824 Pass vid_internal to R_LoadModule
This fixes the segfault and pushes things very much in the desired
direction of proper system independence for rendering and presentation
separation (though things were headed in the right direction before).
2019-07-08 14:04:03 +09:00
Bill Currie
6ee2df8445 Move vid callbacks into vid_internal
Currently segfaults because viddef is an alias for *r_data->vid, which
has not yet been initialized (chicken and egg).
2019-07-08 13:40:29 +09:00
Bill Currie
3e1520c246 Move vid callback access into vid
The plan is to move the callbacks into a "private" struct.
2019-07-08 12:46:22 +09:00
Bill Currie
a755e50c84 Clean up vid access a little
Things are still a mess, but a proper cleanup will be a lot of work and
will, really, involve properly splitting quake-specific code* out from
the rest of the renderer.

* data loading and format specific stuff
2019-07-07 15:38:29 +09:00
Bill Currie
940ef833ae Shutdown Vulkan properly
Well, as properly as can be considering how little is started up :P
2019-07-07 14:34:02 +09:00
Bill Currie
ab08e4f207 Create a logical device with a single queue
A single graphics-capable queue should be enough for now. However, I'm
not sure I'm happy with a lot of the code: it's a bit difficult to write
flexibly configured code for Vulkan (or seems to be at this stage),
especially in C.
2019-07-07 01:28:05 +09:00
Bill Currie
2bc78e7f0a Start work on a Vulkan-based renderer
Doesn't do much other than create an instance and enumerate some stuff,
but the build system is working.
2019-07-06 14:56:15 +09:00
Bill Currie
ab71311174 Correct some comments 2019-07-06 14:44:22 +09:00