-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge the current vulkan-dev to the master #119
Changes from 3 commits
731bae1
a05f278
5d20ddf
39db3ce
3439dfa
3f5511d
b6e1a1a
e9bd0ce
7db4655
c06b917
018beb8
2effe91
957bd74
36c6eb5
46ac6ae
d0f22a6
661c4c1
c02ba4e
420decb
e324bdc
c6a567a
a8e85ca
9ff8d42
f0f5bf9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
set(VK_SHADER_DIRECTORY ${PROJECT_SOURCE_DIR}/src/engines/vulkan/shaders) | ||
set(SPIRV_DIRECTORY ${PROJECT_BINARY_DIR}/spirv) | ||
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/spirv) | ||
|
||
add_custom_target( | ||
vulkan_shaders | ||
DEPENDS ${SPIRV_DIRECTORY}/fill-rect.vert.inc | ||
${SPIRV_DIRECTORY}/fill-rect.frag.inc | ||
${SPIRV_DIRECTORY}/image.vert.inc | ||
${SPIRV_DIRECTORY}/image.frag.inc | ||
) | ||
|
||
add_custom_command( | ||
OUTPUT ${SPIRV_DIRECTORY}/fill-rect.vert.inc | ||
COMMAND ${GLSLANG_VALIDATOR} -V -x -o ${SPIRV_DIRECTORY}/fill-rect.vert.inc ${VK_SHADER_DIRECTORY}/fill-rect.vert | ||
DEPENDS ${VK_SHADER_DIRECTORY}/fill-rect.vert ${GLSLANG_VALIDATOR} | ||
) | ||
|
||
add_custom_command( | ||
OUTPUT ${SPIRV_DIRECTORY}/fill-rect.frag.inc | ||
COMMAND ${GLSLANG_VALIDATOR} -V -x -o ${SPIRV_DIRECTORY}/fill-rect.frag.inc ${VK_SHADER_DIRECTORY}/fill-rect.frag | ||
DEPENDS ${VK_SHADER_DIRECTORY}/fill-rect.frag ${GLSLANG_VALIDATOR} | ||
) | ||
|
||
add_custom_command( | ||
OUTPUT ${SPIRV_DIRECTORY}/image.vert.inc | ||
COMMAND ${GLSLANG_VALIDATOR} -V -x -o ${SPIRV_DIRECTORY}/image.vert.inc ${VK_SHADER_DIRECTORY}/image.vert | ||
DEPENDS ${VK_SHADER_DIRECTORY}/image.vert ${GLSLANG_VALIDATOR} | ||
) | ||
|
||
add_custom_command( | ||
OUTPUT ${SPIRV_DIRECTORY}/image.frag.inc | ||
COMMAND ${GLSLANG_VALIDATOR} -V -x -o ${SPIRV_DIRECTORY}/image.frag.inc ${VK_SHADER_DIRECTORY}/image.frag | ||
DEPENDS ${VK_SHADER_DIRECTORY}/image.frag ${GLSLANG_VALIDATOR} | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,8 @@ set(INCLUDE_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/include) | |
# - A subdirectory in PROJECT_BINARY_DIR can be used as a build directory. | ||
|
||
add_custom_target(common ALL | ||
DEPENDS gtest) | ||
DEPENDS gtest | ||
glslang) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't only the vulkan backend depend on this? Please move this to the vulkan target below this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I wasn't sure if I first build the gles2 backend then I build the vulkan it would get the glslang and I thought it doesn't have a big toll to build the glslang for every traget. Now I've tried what happend in this case and it works flawless, thanks. |
||
|
||
add_custom_target(gles2 ALL | ||
DEPENDS common) | ||
|
@@ -44,6 +45,15 @@ ExternalProject_Add(gtest | |
BUILD_COMMAND make gtest | ||
INSTALL_COMMAND make install > /dev/null) | ||
|
||
ExternalProject_Add(glslang | ||
PREFIX ${PROJECT_SOURCE_DIR}/src/glslang | ||
GIT_REPOSITORY https://github.com/KhronosGroup/glslang.git | ||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROJECT_SOURCE_DIR} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_INCLUDEDIR=include | ||
GIT_TAG master-tot | ||
BINARY_DIR ${PROJECT_BINARY_DIR}/glslang | ||
BUILD_COMMAND make glslangValidator | ||
INSTALL_COMMAND make install > /dev/null) | ||
|
||
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/stamps) | ||
add_custom_command(TARGET gles2 | ||
POST_BUILD | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file should go into the
cmake/
directory, with the other cmake modules. Then you can simply useinclude(VulkanShaders)
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay