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)
CMake: two shaders targets, instead of single target per shader. a708650319e44c7b98056f3bc85a896dd65d96f3 Jackalope 2020-05-28 11:06:13
Reduced amount of warnings. 18bf33ca4e0e7f0369f6b5fdc59b81a8420dde8e Jackalope 2020-05-27 15:11:37
Replace jl::rarray with generic structure in shader header file. 1cedb5886becc0f70c19d1c649e96f7eac5e0037 Jackalope 2020-05-27 13:07:31
Embedding shaders in obj library. e877e7a688ee4a899480c12acba55c340622f993 Jackalope 2020-05-27 12:40:34
Update jlib 0.3.0 (refactoring of threads, new thread pool). 1c713a320ced91d0ad5f1606c39f1187871d28e5 Jackalope 2020-05-26 14:44:35
Update graphics after change of "wait for monitor" flag. 29d9b749c803646006b9b0071b54256bd3c08ca8 Jackalope 2020-05-26 14:40:34
reduced number of -Wno* warnings bf3ec94ce3020715e246107a47efc9a8772db382 Jackalope 2020-05-25 01:48:40
Disable "find_package(jlib 0.2.0 REQUIRED)" in jrf b4903e20d9128227163119fe73e32cda5050cb67 Jackalope 2020-05-24 16:40:26
Update jrf-0.2.1 3518adb37045d4e4eb4488c8c07e3f674f5fbac3 Jackalope 2020-05-24 14:33:14
Update jrf-0.2.0 8720e50ca5f692a96ba764cab1a250683c6a0c59 Jackalope 2020-05-24 13:42:55
Update jlib-0.2.0 98c73665c12797a530d12e34dc764e72a8767ad1 Jackalope 2020-05-24 00:32:02
Mistake in CMake option 112275a2e0bc8619612ab49d808daeeeb599b8de Jackalope 2020-05-24 00:11:04
Device selection settings: 1. First suitable. 2. User can select with stdin/stdout. 3. User function callback. adcfd55f60dfc6eea019f083019012a0b4aa8f02 Jackalope 2020-05-23 13:52:07
ModuleGraphics: fix for mip level computation was wrong because depth is ignored. 834ceab8e0ea99b6b8c25928c9f3be968679cff3 Jackalope 2020-05-21 11:57:26
Compute module. Image copy staging buffer size limit problem fixed by representing row image memory in staging buffer. 740d8bf1d12352b08da05a63957afcb508ea6fd5 Jackalope 2020-05-21 11:55:31
Math new types update d0069637df7a0f74a9492a2a2a2d7a33102afde6 Jackalope 2020-05-21 11:51:46
Checking for blit support and fix typo in texture write f1adac801689ee3f7905d2582ac26948260bb352 Jackalope 2020-05-20 18:39:36
Added VkFormat properties checks and fallbacks to follow specification rules. 3c38bb0e9916aea31ef796a53a024aa3111e1ec7 Jackalope 2020-05-19 17:42:59
renamed compute::BindingsSet to BindingSet, vkw::BindNo to vkw::Binding, compute::BindingCreateInfo.bindingNo to binding 072430e257166208d6f4a7b759169779f21bf4c8 Jackalope 2020-05-18 17:51:25
better documentation 5233938573e5c557667de4f467209099a3d48faa Jackalope 2020-05-18 17:38:59
Commit a708650319e44c7b98056f3bc85a896dd65d96f3 - CMake: two shaders targets, instead of single target per shader.
Author: Jackalope
Author date (UTC): 2020-05-28 11:06
Committer name: Jackalope
Committer date (UTC): 2020-05-28 12:21
Parent(s): 18bf33ca4e0e7f0369f6b5fdc59b81a8420dde8e
Signing key:
Tree: 244870d4f87a6bab6aaf642d87f024cbe25f171b
File Lines added Lines deleted
src/graphics/shaders/CMakeLists.txt 59 33
File src/graphics/shaders/CMakeLists.txt changed (mode: 100644) (index 5171840..ad29e46)
17 17 cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
18 18
19 19 set(SPIRV_COMPILER "glslangValidator" CACHE set(SPIRV_COMPILER "glslangValidator" CACHE
20 STRING "Path to glslangValidator, compiler from GLSL to SPIR-V")
21 set(DST ${CMAKE_CURRENT_BINARY_DIR})
20 STRING "Path to glslangValidator, compiler from GLSL to SPIR-V"
21 )
22 set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
23 set(BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
22 24
25 set(SHADER_SRC_PATHS)
26 set(SHADER_SPV_PATHS)
27 set(SHADER_OBJ_PATHS)
28
29 #for template.h -> shader.h configuration:
23 30 set(SHADERS_EXTERN "") set(SHADERS_EXTERN "")
24 31 set(SHADERS_IDS "\n ") set(SHADERS_IDS "\n ")
25 32 set(SHADERS_RARRAYS "\n ") set(SHADERS_RARRAYS "\n ")
26 set(SHADER_LIBS)
27 33
28 function(add_shader_extra NAME FORMAT NAME2 PARAMS)
29 set(SHADER_IN ${NAME}.${FORMAT})
30 set(SHADER_SPV ${NAME}${NAME2}_${FORMAT})
31 set(SHADER_OBJ ${NAME}${NAME2}_${FORMAT}.o)
34 function(add_shader NAME FORMAT)
35 set(FUNC_ARGS ${ARGN})
36 list(LENGTH FUNC_ARGS FUNC_NARGS)
37 if (${FUNC_NARGS} GREATER 0)
38 list(GET FUNC_ARGS 0 ARGS)
39 list(GET FUNC_ARGS 1 NAME_SUFFIX)
40 endif()
41
42 set(SHADER_SRC ${NAME}.${FORMAT})
43 set(SHADER_SPV ${NAME}${NAME_SUFFIX}_${FORMAT})
44 set(SHADER_OBJ ${NAME}${NAME_SUFFIX}_${FORMAT}.o)
45 set(SHADER_SRC_PATH ${SRC_DIR}/${SHADER_SRC})
46 set(SHADER_SPV_PATH ${BIN_DIR}/${SHADER_SPV})
47 set(SHADER_OBJ_PATH ${BIN_DIR}/${SHADER_OBJ})
48
49 set(SHADER_SRC_PATHS "${SHADER_SRC_PATHS}${SHADER_SRC_PATH};" PARENT_SCOPE)
50 set(SHADER_SPV_PATHS "${SHADER_SPV_PATHS}${SHADER_SPV_PATH};" PARENT_SCOPE)
51 set(SHADER_OBJ_PATHS "${SHADER_OBJ_PATHS}${SHADER_OBJ_PATH};" PARENT_SCOPE)
52
32 53 add_custom_command( add_custom_command(
33 OUTPUT ${DST}/${SHADER_SPV}
34 COMMAND ${SPIRV_COMPILER} -V ${SHADER_IN} -o ${DST}/${SHADER_SPV} ${PARAMS}
35 DEPENDS ${SHADER_IN}
36 COMMENT "Compiling shader ${SHADER_SPV}"
37 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
54 COMMENT "Compiling shader: ${SHADER_SPV}."
55 DEPENDS ${SHADER_SRC_PATH}
56 COMMAND ${SPIRV_COMPILER} -V ${SHADER_SRC} -o ${SHADER_SPV_PATH} ${ARGS}
57 OUTPUT ${SHADER_SPV_PATH}
58 WORKING_DIRECTORY ${SRC_DIR}
38 59 ) )
39 60 add_custom_command( add_custom_command(
40 OUTPUT ${DST}/${SHADER_OBJ}
61 COMMENT "Shader binary object: ${SHADER_OBJ}."
62 DEPENDS ${SHADER_SPV_PATH}
41 63 COMMAND ld -r -b binary ${SHADER_SPV} -o ${SHADER_OBJ} COMMAND ld -r -b binary ${SHADER_SPV} -o ${SHADER_OBJ}
42 DEPENDS ${DST}/${SHADER_SPV}
43 COMMENT "Making binary object from binary shader ${SHADER_OBJ}"
44 WORKING_DIRECTORY ${DST}
64 OUTPUT ${SHADER_OBJ_PATH}
65 WORKING_DIRECTORY ${BIN_DIR}
45 66 ) )
46 add_custom_target(${SHADER_OBJ}t ALL DEPENDS ${DST}/${SHADER_OBJ})
47 add_dependencies(JEN_GRAPHICS ${SHADER_OBJ}t)
48 set(SHADER_LIBS ${SHADER_LIBS} ${DST}/${SHADER_OBJ} PARENT_SCOPE)
49 set(SHADER_DECL ${SHADER_SPV})
67
50 68 set(SHADERS_EXTERN "${SHADERS_EXTERN}\ set(SHADERS_EXTERN "${SHADERS_EXTERN}\
51 extern const uint8_t _binary_${SHADER_DECL}_start[];\n\
52 extern const uint8_t _binary_${SHADER_DECL}_end[];\n"
69 extern const uint8_t _binary_${SHADER_SPV}_start[];\n\
70 extern const uint8_t _binary_${SHADER_SPV}_end[];\n"
53 71 PARENT_SCOPE PARENT_SCOPE
54 72 ) )
55 73 set(SHADERS_IDS "${SHADERS_IDS}\ set(SHADERS_IDS "${SHADERS_IDS}\
56 ${SHADER_DECL},\n "
74 ${SHADER_SPV},\n "
57 75 PARENT_SCOPE PARENT_SCOPE
58 76 ) )
59 77 set(SHADERS_RARRAYS "${SHADERS_RARRAYS}\ set(SHADERS_RARRAYS "${SHADERS_RARRAYS}\
60 {_binary_${SHADER_DECL}_start,_binary_${SHADER_DECL}_end},\n "
78 {_binary_${SHADER_SPV}_start,_binary_${SHADER_SPV}_end},\n "
61 79 PARENT_SCOPE PARENT_SCOPE
62 80 ) )
63 81 endfunction() endfunction()
64 macro(add_shader NAME FORMAT)
65 add_shader_extra(${NAME} ${FORMAT} "" "")
66 endmacro()
67 82
83 add_shader(default vert)
84 add_shader(default frag)
85 add_shader(default vert "-DMIX_TEXTURES" "_terrain")
86 add_shader(default frag "-DMIX_TEXTURES" "_terrain")
68 87 add_shader(debug_normals vert) add_shader(debug_normals vert)
69 88 add_shader(debug_normals geom) add_shader(debug_normals geom)
70 89 add_shader(debug_normals frag) add_shader(debug_normals frag)
71 add_shader(default vert)
72 add_shader(default frag)
73 add_shader_extra(default vert "_terrain" "-DMIX_TEXTURES")
74 add_shader_extra(default frag "_terrain" "-DMIX_TEXTURES")
75 90 add_shader(composition vert) add_shader(composition vert)
76 91 add_shader(composition frag) add_shader(composition frag)
77 92 add_shader(fonts vert) add_shader(fonts vert)
 
... ... add_shader(shadow_cube frag)
82 97 add_shader(debug_depth_cube vert) add_shader(debug_depth_cube vert)
83 98 add_shader(debug_depth_cube frag) add_shader(debug_depth_cube frag)
84 99
85 configure_file(template.h ${CMAKE_CURRENT_SOURCE_DIR}/shaders.h)
86 set(SHADER_LIBS ${SHADER_LIBS} PARENT_SCOPE)
100 add_custom_target(JEN_GRAPHICS_SHADERS_SPV
101 DEPENDS ${SHADER_SPV_PATHS}
102 COMMENT "Compile shaders for graphics module."
103 SOURCES ${SHADER_SRC_PATHS}
104 )
105 add_custom_target(JEN_GRAPHICS_SHADERS_OBJ
106 DEPENDS ${SHADER_OBJ_PATHS}
107 COMMENT "Creating obj files from shaders with ld linker for graphics module."
108 )
109 add_dependencies(JEN_GRAPHICS JEN_GRAPHICS_SHADERS_OBJ)
110
111 configure_file(template.h ${SRC_DIR}/shaders.h)
112 set(SHADER_LIBS ${SHADER_OBJ_PATHS} PARENT_SCOPE)
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