Added fully functional build shaders with dependencies on folders
This commit is contained in:
parent
9e72620c1c
commit
2490708486
7 changed files with 88 additions and 8 deletions
|
|
@ -5,13 +5,12 @@ set(CMAKE_CXX_STANDARD 17)
|
|||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
option(KOMPUTE_OPT_INSTALL_PYTHON_REQS "Enable if you want to install python reqs" OFF)
|
||||
option(KOMPUTE_OPT_BUILD_TESTS "Enable if you want to build tests" ON)
|
||||
|
||||
# Allow scripts to call main kompute Makefile
|
||||
function(kompute_make KOMPUTE_MAKE_TARGET)
|
||||
add_custom_target(${KOMPUTE_MAKE_TARGET}
|
||||
COMMAND make -C ${PROJECT_SOURCE_DIR} ${KOMPUTE_MAKE_TARGET} ${ARGN})
|
||||
COMMAND make -C ${PROJECT_SOURCE_DIR} ${KOMPUTE_MAKE_TARGET})
|
||||
endfunction()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
|
|
|||
2
LICENSE
2
LICENSE
|
|
@ -1,4 +1,4 @@
|
|||
Copyright 2020 Alejandro Saucedo
|
||||
Copyright 2020 The Institute for Ethical AI & Machine Learning
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
|||
|
|
@ -16,6 +16,27 @@ CWD=os.path.dirname(os.path.abspath(__file__))
|
|||
XXD_LINUX_CMD="xxd"
|
||||
XXD_WINDOWS_CMD=os.path.abspath(os.path.join(CWD, "..\\external\\bin\\", "xxd.exe"))
|
||||
|
||||
SHADER_GENERATED_NOTICE = """/*
|
||||
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
|
||||
|
||||
---
|
||||
|
||||
Copyright 2020 The Institute for Ethical AI & Machine Learning
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
"""
|
||||
|
||||
@click.command()
|
||||
@click.option(
|
||||
"--shader-path",
|
||||
|
|
@ -112,6 +133,7 @@ def run_cli(
|
|||
header_file_define = "SHADEROP_" + header_file.replace(".", "_").upper()
|
||||
logger.debug(f"Converting to hpp: {file_name}")
|
||||
with open(os.path.join(header_path, header_file), "w+") as fstream:
|
||||
fstream.write(f"{SHADER_GENERATED_NOTICE}\n")
|
||||
fstream.write(f"#ifndef {header_file_define}\n")
|
||||
fstream.write(f"#define {header_file_define}\n\n")
|
||||
fstream.write("namespace kp {\n")
|
||||
|
|
|
|||
|
|
@ -1,3 +1,23 @@
|
|||
/*
|
||||
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
|
||||
|
||||
---
|
||||
|
||||
Copyright 2020 The Institute for Ethical AI & Machine Learning
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef SHADEROP_SHADEROPMULT_HPP
|
||||
#define SHADEROP_SHADEROPMULT_HPP
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,10 @@ find_package(fmt REQUIRED)
|
|||
find_package(spdlog REQUIRED)
|
||||
find_package(Vulkan REQUIRED)
|
||||
|
||||
kompute_make(install_python_reqs)
|
||||
kompute_make(build_shaders)
|
||||
kompute_make(build_single_header)
|
||||
kompute_make(build_shaders
|
||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
kompute_make(build_single_header
|
||||
OUTPUT ${PROJECT_SOURCE_DIR}/single_include)
|
||||
|
||||
file(GLOB kompute_CPP
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
|
||||
|
|
@ -31,8 +32,6 @@ add_dependencies(kompute
|
|||
build_shaders
|
||||
build_single_header)
|
||||
|
||||
add_dependencies(kompute
|
||||
install_python_reqs)
|
||||
|
||||
add_library(kompute::kompute ALIAS kompute)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,23 @@
|
|||
/*
|
||||
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
|
||||
|
||||
---
|
||||
|
||||
Copyright 2020 The Institute for Ethical AI & Machine Learning
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef SHADEROP_SHADERMACHINELEARNING_HPP
|
||||
#define SHADEROP_SHADERMACHINELEARNING_HPP
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,23 @@
|
|||
/*
|
||||
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
|
||||
|
||||
---
|
||||
|
||||
Copyright 2020 The Institute for Ethical AI & Machine Learning
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef SHADEROP_SHADEROPMULT_HPP
|
||||
#define SHADEROP_SHADEROPMULT_HPP
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue