Jackalope / jen (public) (License: GPLv3 or later version) (since 2018-10-24) (hash sha1)
----> ABOUT:

3D rendering and computing framework based on Vulkan API.

Libraries:
- simdcpp submodule (see my simdcpp repo)
- jmath submodule (see my jmath repo)
- mesh (constexpr generation of cubes, spheres, icosahedrons subdivisions)
- atlas (1D lines and 2D rectangles cutting)
- jlib submodule (see my jlib repo)
- jrf submodule (see my jrf repo)
- vkw (Vulkan API C++ wrapper)
Modules:
- compute (run compute shaders on gpu)
- graphics (draw models with clustered forward rendering and onscreen text)
- resource manager (load meshes, models, textures, scene data from
files and create related objects in graphics module)

----> INSTALLING:

To download all the parts of this framework it's enough to launch
git clone with recursive flag:

$ git clone —recursive ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/jen

After this look at git tags:

$ git tag

It is recommended to use a tagged version instead of the latest commit,
because the first commit after the tagged one mostly includes incompatible
parts of future changes for the next version.

$ git checkout v0.1.0

----> DEPENDENCIES:

To use JEN as CMake subdirectory and successfully build programs with it
you need to make sure you have all of its dependencies:
- compiler: Clang or GCC, support for C++17. Clang 10+ or GCC 9+ is recommended,
compiling on Windows OS is tricky and requires something like MinGW with MSYS,
there are also some complications to go through to make dependencies work;
- GLFW3 library, supported version is 3.2.1;
- FreeType library, if graphics module will be used;
- Vulkan API headers, and optional validation layers to debug sneaky problems,
you also need Vulkan support in your graphics driver to run compiled programs;
- LibZip can be necessary, if JRF is used to read zip files;
- CMake, for obvious reasons;
- glslangValidator to compile shader for the graphics module.

CMake must be able to find GLFW3, Vulkan and FreeType (for graphics)
with find_package().

----> HOW TO USE IT:

To use JEN, you need to add it as a subdirectory:

add_subdirecroty(${PATH_TO_JEN})

There are several configuration options:
- JEN_MODULE_COMPUTE - turn compute module on for compiling and including;
- JEN_MODULE_GRAPHICS - turn graphics module on ...;
- JEN_MULTITHREADED_DRAW_FRAME - draw_frame function will use thread pool queue
instead of linear executing;
- JEN_MODULE_RESOURCE_MANAGER - resource manager module ON, if graphics is ON;
- JEN_VLK_VALIDATION - enable Vulkan Validation Layers to debug some errors
related to JEN. This will often produce false-positive,
as well as true-positive errors.

Look in CMakeLists.txt at JenExamples repo for details on how to use and
configure JEN automatically:

$ git clone ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/JenExamples

Also I recommend to compile and run examples to make sure it works correctly.

----> SUPPORTED HARDWARE:

JEN has not been tested well, because it requires running it on large amount of
different hardware to do so. It must work with mesa driver and modern
Intel i965 GPUs as well as AMD GPUs.


----> DOCUMENTATION:

You can generate Doxygen documentation, to do so
turn on any of JEN_DOXYGEN_* options and run documentation target in cmake:

$ cmake -G %1 -DJEN_DOXYGEN_HTML=ON -DJEN_DOXYGEN_LATEX=ON
$ cmake —build —target documentation

Resource manager is not documented because it still requires large enhancements.
List of commits:
Subject Hash Author Date (UTC)
Separate ComputeCmdUnit for cmds and syncs 9dc0a4a62e6fa68e60cfbd420eff61d8ee4334f0 Jackalope 2020-03-06 04:02:24
Compute descriptor set improvement, support for different descriptor types 5aad5ee0e4304b2035a652f4d4ca28e7a75bc93d Jackalope 2020-02-29 16:10:50
changed doxygen commentary style in DevMemUse description 9e9a548d6c50363a841af5d4897268aadba6ebed Jackalope 2020-02-29 16:08:33
make buffer functions const 24e343bc583629d08fad4d3dadb36a2fd72a4ca7 Jackalope 2020-02-29 16:08:04
added missing check in draw_drame cc6483e804d463fe4d1c41746692ec98bfbe53e8 Jackalope 2020-02-19 12:40:19
solved freee bug, draw data have pointer to user light data instead of applying every frame f60e7d3908651512a90488966141620306d54151 Jackalope 2020-02-19 10:50:22
solved lights flickefing issue c5cad408d3d9d908ac52760ebf1c42e7d578e61e Jackalope 2020-02-19 10:48:46
apply camera and frustum in single function ac6b09e32f0afa65eef918fb7bdb935cb99da2d8 Jackalope 2020-02-18 16:32:41
draw data wrong camera aspect fix 5d9270631a2ff3232c4928d811d55079ee30e6af Jackalope 2020-02-18 16:27:11
release macro fixed ebf6d8302ac06701d5fed4d4e153e0bc5c332990 Jackalope 2020-02-18 16:26:21
vkw memory barrier and buffer memory barrier 1df196563968fe2d0ab53f989b54b502500709e1 Jackalope 2020-02-17 18:31:15
removed forgotten redundand lines 24427796fde68c4d8a92b528ee876136da9ff365 Jackalope 2020-02-17 04:28:57
fix wrong cmd buffer begin flag f02a4272c22bfe918e4df881531699c723cf1156 Jackalope 2020-02-17 04:15:22
add temporary fix for some validation layers false-positives 9787cf6494ee83fe8c7313d0d3e7ce96ad0190e4 Jackalope 2020-02-17 06:34:31
updated descriptor pool size 8384cb8149bcba04addc908f0a5e67f291eff841 Jackalope 2020-02-17 02:43:08
new types headers for shorter integers and floating points 98da0d130bb5c78c16daaf1ffc56b046e524f756 Jackalope 2020-02-17 02:33:27
framework compute module 2441c321b81324b9873288a7c0ccb1f59fa982df Jackalope 2020-02-15 03:26:36
added conditional compiling JEN_PARALLEL_DRAW_FRAME macro 2db8f1d2583983542795ce43fe67a4505f697d39 Jackalope 2020-02-15 02:43:10
disable clusters transfer if memory is HOST_VISIBLE and DEVICE_LOCAL a85177626c71f008c4decf4a88c2ef61e6f3dda1 Jackalope 2020-02-15 02:20:00
one time submit conditional flag for cmdbuffer 1151a5f79a5c1a4e1b41ef286afe5f102a551111 Jackalope 2020-02-14 20:27:44
Commit 9dc0a4a62e6fa68e60cfbd420eff61d8ee4334f0 - Separate ComputeCmdUnit for cmds and syncs
Author: Jackalope
Author date (UTC): 2020-03-06 04:02
Committer name: Jackalope
Committer date (UTC): 2020-03-06 04:02
Parent(s): 5aad5ee0e4304b2035a652f4d4ca28e7a75bc93d
Signer:
Signing key:
Signing status: N
Tree: 22a3e3b3e75d670afaef53dda6ddc71fd1d20499
File Lines added Lines deleted
src/compute/cmd_unit.h 40 0
src/compute/compute.h 11 32
File src/compute/cmd_unit.h added (mode: 100644) (index 0000000..15f3760)
1 #pragma once
2
3 #include "../device/cmd_container.h"
4
5 namespace jen::vk
6 {
7 struct ComputeCmdUnit {
8 [[nodiscard]] Result init(Device *p_dev) {
9 Result res;
10 res = compute_cmds.init(*p_dev, p_dev->queue_indices.compute.family,
11 vkw::CmdPoolFlag::MANUAL_CMD_RESET);
12 if (res != VK_SUCCESS)
13 return res;
14 res = syncs.init(*p_dev);
15 if (res != VK_SUCCESS) {
16 compute_cmds.destroy(*p_dev);
17 return res;
18 }
19 return VK_SUCCESS;
20 }
21 void destroy(Device *p_dev) {
22 compute_cmds.destroy(*p_dev);
23 syncs.destroy(*p_dev);
24 }
25
26 struct SyncCounts : SyncContainerCounts {
27 constexpr static const uint32_t FENCES = 1;
28 };
29 struct SyncValues : SyncContainerValues<SyncCounts> {
30 constexpr static const A<vkw::Fence::Mask, SyncCounts::FENCES> FENCES {
31 vkw::Fence::Flag::SIGNALED
32 };
33 };
34
35 constexpr static const uint32_t PRIMARY_CMD_COUNT = 1;
36 constexpr static const uint32_t FENCE_S_COUNT = 1;
37 CmdPoolContainer<PRIMARY_CMD_COUNT, 0> compute_cmds;
38 SyncContainer<SyncCounts, SyncValues> syncs;
39 };
40 }
File src/compute/compute.h changed (mode: 100644) (index 1e8af63..2148214)
2 2
3 3 #include "binding_set.h" #include "binding_set.h"
4 4 #include "pipeline.h" #include "pipeline.h"
5 #include "../device/cmd_container.h"
5 #include "cmd_unit.h"
6 6
7 7 namespace jen::vk namespace jen::vk
8 8 { {
9 9 struct ModuleCompute { struct ModuleCompute {
10 10 [[nodiscard]] Result init(Device *p_dev) { [[nodiscard]] Result init(Device *p_dev) {
11 Result res;
12 res = compute_cmds.init(*p_dev, p_dev->queue_indices.compute.family,
13 vkw::CmdPoolFlag::MANUAL_CMD_RESET);
14 if (res != VK_SUCCESS)
15 return res;
16 res = syncs.init(*p_dev);
17 if (res != VK_SUCCESS) {
18 compute_cmds.destroy(*p_dev);
19 return res;
20 }
21 11 p_device = p_dev; p_device = p_dev;
22 return VK_SUCCESS;
12 return cmd_unit.init(p_dev);
23 13 } }
24 14 void destroy() { void destroy() {
25 compute_cmds.destroy(*p_device);
26 syncs.destroy(*p_device);
15 cmd_unit.destroy(p_device);
27 16 } }
28 17 [[nodiscard]] Result [[nodiscard]] Result
29 18 create_pipeline(const Bindings &bi, const char *p_shader_file_path, create_pipeline(const Bindings &bi, const char *p_shader_file_path,
 
... ... namespace jen::vk
67 56 math::v3u32 group_count) math::v3u32 group_count)
68 57 { {
69 58 Result res; Result res;
70 res = syncs.fences[0].wait_and_reset(*p_device, vkw::TIMEOUT_INFINITE);
59 res = cmd_unit.syncs
60 .fences[0].wait_and_reset(*p_device, vkw::TIMEOUT_INFINITE);
71 61 if (res != VK_SUCCESS) if (res != VK_SUCCESS)
72 62 return res; return res;
73 63
74 auto &cmd = compute_cmds.primary[0];
64 auto &cmd = cmd_unit.compute_cmds.primary[0];
75 65 res = cmd.begin(vkw::CmdUsage::ONE_TIME_SUBMIT); res = cmd.begin(vkw::CmdUsage::ONE_TIME_SUBMIT);
76 66 if (res != VK_SUCCESS) if (res != VK_SUCCESS)
77 67 return res; return res;
 
... ... namespace jen::vk
85 75 return res; return res;
86 76
87 77 vkw::QueueSubmit submit(cmd); vkw::QueueSubmit submit(cmd);
88 return p_device->queues.compute.submit_locked(submit, syncs.fences[0]);
78 return p_device->queues.compute
79 .submit_locked(submit, cmd_unit.syncs.fences[0]);
89 80 } }
90 81
91 82 [[nodiscard]] Result [[nodiscard]] Result
 
... ... namespace jen::vk
94 85 void *p_dst) { void *p_dst) {
95 86 jassert(offset + size <= buffer.size(), "region exceeds buffer"); jassert(offset + size <= buffer.size(), "region exceeds buffer");
96 87 Result res; Result res;
97 res = syncs.fences[0].wait(*p_device, vkw::TIMEOUT_INFINITE);
88 res = cmd_unit.syncs.fences[0].wait(*p_device, vkw::TIMEOUT_INFINITE);
98 89 if (res != VK_SUCCESS) if (res != VK_SUCCESS)
99 90 return res; return res;
100 91 jassert(buffer.is_mapped() and not buffer.is_flush_needed(), jassert(buffer.is_mapped() and not buffer.is_flush_needed(),
 
... ... namespace jen::vk
117 108 p_pl->destroy(p_device->device); p_pl->destroy(p_device->device);
118 109 } }
119 110
120 struct SyncCounts : SyncContainerCounts {
121 constexpr static const uint32_t FENCES = 1;
122 };
123 struct SyncValues : SyncContainerValues<SyncCounts> {
124 constexpr static const A<vkw::Fence::Mask, SyncCounts::FENCES> FENCES {
125 vkw::Fence::Flag::SIGNALED
126 };
127 };
128
129 constexpr static const uint32_t PRIMARY_CMD_COUNT = 1;
130 constexpr static const uint32_t FENCE_S_COUNT = 1;
131 CmdPoolContainer<PRIMARY_CMD_COUNT, 0> compute_cmds;
132 SyncContainer<SyncCounts, SyncValues> syncs;
133 Device *p_device;
111 ComputeCmdUnit cmd_unit;
112 Device *p_device;
134 113 }; };
135 114 } }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/Jackalope/jen

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/jen

Clone this repository using git:
git clone git://git.rocketgit.com/user/Jackalope/jen

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main