File CMakeLists.txt changed (mode: 100644) (index f004471..3d4c6c8) |
... |
... |
set(JEN_COMPILE_OPTIONS ${JEN_COMPILE_OPTIONS} |
56 |
56 |
-Wno-missing-braces |
-Wno-missing-braces |
57 |
57 |
) |
) |
58 |
58 |
|
|
59 |
|
add_subdirectory(resources/shaders) |
|
60 |
59 |
add_subdirectory(libs/simdcpp) |
add_subdirectory(libs/simdcpp) |
61 |
60 |
add_subdirectory(libs/math) |
add_subdirectory(libs/math) |
62 |
61 |
add_subdirectory(libs/jlib) |
add_subdirectory(libs/jlib) |
|
... |
... |
add_subdirectory(libs/vkw) |
66 |
65 |
|
|
67 |
66 |
set(JEN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) |
set(JEN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) |
68 |
67 |
add_subdirectory(src) |
add_subdirectory(src) |
|
68 |
|
add_subdirectory(resources/shaders) |
69 |
69 |
|
|
70 |
70 |
target_compile_options(JEN PRIVATE ${JEN_COMPILE_OPTIONS}) |
target_compile_options(JEN PRIVATE ${JEN_COMPILE_OPTIONS}) |
71 |
71 |
|
|
File resources/shaders/CMakeLists.txt changed (mode: 100644) (index b2caf37..1c77436) |
14 |
14 |
# |
# |
15 |
15 |
# You should have received a copy of the GNU General Public License |
# You should have received a copy of the GNU General Public License |
16 |
16 |
# along with this library. If not, see <https://www.gnu.org/licenses/> |
# along with this library. If not, see <https://www.gnu.org/licenses/> |
17 |
|
|
|
18 |
17 |
cmake_minimum_required(VERSION 3.5) |
cmake_minimum_required(VERSION 3.5) |
19 |
18 |
|
|
|
19 |
|
set(SPIRV_COMPILER "glslangValidator" CACHE |
|
20 |
|
STRING "Path to glslangValidator, compiler from GLSL to SPIR-V") |
20 |
21 |
set(DST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/shaders) |
set(DST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/shaders) |
21 |
22 |
|
|
22 |
|
configure_file(bin/debug_normals_vert.spv ${DST}/debug_normals_vert.spv COPYONLY) |
|
23 |
|
configure_file(bin/debug_normals_geom.spv ${DST}/debug_normals_geom.spv COPYONLY) |
|
24 |
|
configure_file(bin/debug_normals_frag.spv ${DST}/debug_normals_frag.spv COPYONLY) |
|
25 |
|
|
|
26 |
|
configure_file(bin/fragment_default.spv ${DST}/fragment_default.spv COPYONLY) |
|
27 |
|
configure_file(bin/vertex_default.spv ${DST}/vertex_default.spv COPYONLY) |
|
28 |
|
|
|
29 |
|
configure_file(bin/shadow_cube_vert.spv ${DST}/shadow_cube_vert.spv COPYONLY) |
|
30 |
|
configure_file(bin/shadow_cube_geom.spv ${DST}/shadow_cube_geom.spv COPYONLY) |
|
31 |
|
configure_file(bin/shadow_cube_frag.spv ${DST}/shadow_cube_frag.spv COPYONLY) |
|
32 |
|
|
|
33 |
|
configure_file(bin/debug_depth_cube_vert.spv ${DST}/debug_depth_cube_vert.spv COPYONLY) |
|
34 |
|
configure_file(bin/debug_depth_cube_frag.spv ${DST}/debug_depth_cube_frag.spv COPYONLY) |
|
35 |
|
|
|
36 |
|
configure_file(bin/fragment_terrain.spv ${DST}/fragment_terrain.spv COPYONLY) |
|
37 |
|
configure_file(bin/vertex_terrain.spv ${DST}/vertex_terrain.spv COPYONLY) |
|
38 |
|
|
|
39 |
|
configure_file(bin/composition/vertex.spv ${DST}/composition/vertex.spv COPYONLY) |
|
40 |
|
configure_file(bin/composition/fragment.spv ${DST}/composition/fragment.spv COPYONLY) |
|
41 |
|
configure_file(bin/fonts/vertex.spv ${DST}/fonts/vertex.spv COPYONLY) |
|
42 |
|
configure_file(bin/fonts/fragment.spv ${DST}/fonts/fragment.spv COPYONLY) |
|
|
23 |
|
function(add_shader_extra NAME FORMAT NAME2 PARAMS) |
|
24 |
|
set(SHADER_IN ${NAME}.${FORMAT}) |
|
25 |
|
set(SHADER_OUT ${NAME}${NAME2}_${FORMAT}.spv) |
|
26 |
|
add_custom_command( |
|
27 |
|
OUTPUT ${DST}/${SHADER_OUT} |
|
28 |
|
COMMAND ${SPIRV_COMPILER} -V ${SHADER_IN} -o ${DST}/${SHADER_OUT} ${PARAMS} |
|
29 |
|
DEPENDS ${SHADER_IN} |
|
30 |
|
COMMENT "Compiling shader ${SHADER_OUT}" |
|
31 |
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|
32 |
|
) |
|
33 |
|
add_custom_target(${SHADER_OUT} ALL DEPENDS ${DST}/${SHADER_OUT}) |
|
34 |
|
add_dependencies(JEN ${SHADER_OUT}) |
|
35 |
|
endfunction() |
|
36 |
|
function(add_shader NAME FORMAT) |
|
37 |
|
add_shader_extra(${NAME} ${FORMAT} "" "") |
|
38 |
|
endfunction() |
|
39 |
|
|
|
40 |
|
add_shader(debug_normals vert) |
|
41 |
|
add_shader(debug_normals geom) |
|
42 |
|
add_shader(debug_normals frag) |
|
43 |
|
add_shader(default vert) |
|
44 |
|
add_shader(default frag) |
|
45 |
|
add_shader_extra(default vert "_terrain" "-DMIX_TEXTURES") |
|
46 |
|
add_shader_extra(default frag "_terrain" "-DMIX_TEXTURES") |
|
47 |
|
add_shader(composition vert) |
|
48 |
|
add_shader(composition frag) |
|
49 |
|
add_shader(fonts vert) |
|
50 |
|
add_shader(fonts frag) |
|
51 |
|
add_shader(shadow_cube vert) |
|
52 |
|
add_shader(shadow_cube geom) |
|
53 |
|
add_shader(shadow_cube frag) |
|
54 |
|
add_shader(debug_depth_cube vert) |
|
55 |
|
add_shader(debug_depth_cube frag) |
File resources/shaders/compile.sh deleted (index f3b94f8..0000000) |
1 |
|
#!/usr/bin/env bash |
|
2 |
|
glslangValidator -V debug_normals.vert -o bin/debug_normals_vert.spv |
|
3 |
|
glslangValidator -V debug_normals.geom -o bin/debug_normals_geom.spv |
|
4 |
|
glslangValidator -V debug_normals.frag -o bin/debug_normals_frag.spv |
|
5 |
|
|
|
6 |
|
glslangValidator -V default.vert -o bin/vertex_default.spv |
|
7 |
|
glslangValidator -V default.frag -o bin/fragment_default.spv |
|
8 |
|
|
|
9 |
|
glslangValidator -V default.vert -DMIX_TEXTURES -o bin/vertex_terrain.spv |
|
10 |
|
glslangValidator -V default.frag -DMIX_TEXTURES -o bin/fragment_terrain.spv |
|
11 |
|
|
|
12 |
|
glslangValidator -V composition.vert -o bin/composition/vertex.spv |
|
13 |
|
glslangValidator -V composition.frag -o bin/composition/fragment.spv |
|
14 |
|
glslangValidator -V fonts.vert -o bin/fonts/vertex.spv |
|
15 |
|
glslangValidator -V fonts.frag -o bin/fonts/fragment.spv |
|
16 |
|
|
|
17 |
|
glslangValidator -V shadow_cube.vert -o bin/shadow_cube_vert.spv |
|
18 |
|
glslangValidator -V shadow_cube.geom -o bin/shadow_cube_geom.spv |
|
19 |
|
glslangValidator -V shadow_cube.frag -o bin/shadow_cube_frag.spv |
|
20 |
|
|
|
21 |
|
glslangValidator -V debug_depth_cube.vert -o bin/debug_depth_cube_vert.spv |
|
22 |
|
glslangValidator -V debug_depth_cube.frag -o bin/debug_depth_cube_frag.spv |
|
File src/graphics/draw_stages/composition/composition.h changed (mode: 100644) (index 9b6e6fa..318c5a7) |
... |
... |
struct jen::vk::StageComposition |
30 |
30 |
update(Device*, PassMain*, vkw::Extent2D); |
update(Device*, PassMain*, vkw::Extent2D); |
31 |
31 |
void |
void |
32 |
32 |
destroy(vkw::Device, vkw::DescrPool); |
destroy(vkw::Device, vkw::DescrPool); |
33 |
|
constexpr static const char SH_VERT[] = "shaders/composition/vertex.spv"; |
|
34 |
|
constexpr static const char SH_FRAG[] = "shaders/composition/fragment.spv"; |
|
|
33 |
|
constexpr static const char SH_VERT[] = "shaders/composition_vert.spv"; |
|
34 |
|
constexpr static const char SH_FRAG[] = "shaders/composition_frag.spv"; |
35 |
35 |
vkw::Pipeline pipeline; |
vkw::Pipeline pipeline; |
36 |
36 |
vkw::PipelineLayout pipeline_layout; |
vkw::PipelineLayout pipeline_layout; |
37 |
37 |
DescriptorImageView descriptor; |
DescriptorImageView descriptor; |
File src/graphics/draw_stages/offscreen/offscreen.h changed (mode: 100644) (index 444cc4b..498c4be) |
... |
... |
struct jen::vk::StageOffscreen |
151 |
151 |
TERRAIN_VERT, TERRAIN_FRAG, |
TERRAIN_VERT, TERRAIN_FRAG, |
152 |
152 |
DEBUG_NORMALS_VERT, DEBUG_NORMALS_GEOM, DEBUG_NORMALS_FRAG |
DEBUG_NORMALS_VERT, DEBUG_NORMALS_GEOM, DEBUG_NORMALS_FRAG |
153 |
153 |
}; |
}; |
154 |
|
constexpr static const char S_VERT [] = "shaders/vertex_default.spv"; |
|
155 |
|
constexpr static const char S_FRAG [] = "shaders/fragment_default.spv"; |
|
156 |
|
constexpr static const char S_VERT_TM[] = "shaders/vertex_terrain.spv"; |
|
157 |
|
constexpr static const char S_FRAG_TM[] = "shaders/fragment_terrain.spv"; |
|
|
154 |
|
constexpr static const char S_VERT [] = "shaders/default_vert.spv"; |
|
155 |
|
constexpr static const char S_FRAG [] = "shaders/default_frag.spv"; |
|
156 |
|
constexpr static const char S_VERT_TM[] = "shaders/default_terrain_vert.spv"; |
|
157 |
|
constexpr static const char S_FRAG_TM[] = "shaders/default_terrain_frag.spv"; |
158 |
158 |
constexpr static const char S_DN_VERT[] = "shaders/debug_normals_vert.spv"; |
constexpr static const char S_DN_VERT[] = "shaders/debug_normals_vert.spv"; |
159 |
159 |
constexpr static const char S_DN_GEOM[] = "shaders/debug_normals_geom.spv"; |
constexpr static const char S_DN_GEOM[] = "shaders/debug_normals_geom.spv"; |
160 |
160 |
constexpr static const char S_DN_FRAG[] = "shaders/debug_normals_frag.spv"; |
constexpr static const char S_DN_FRAG[] = "shaders/debug_normals_frag.spv"; |