-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Egl api enum type -gl-shadertoy example (3.3 Core) - plan to remove after vk-shadertoy done -vk-shadertoy loader - wip -third_party add glm 1.0.1 Signed-off-by: Joel Winarske <[email protected]>
- Loading branch information
Showing
468 changed files
with
69,497 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# | ||
# Copyright 2024 Joel Winarske | ||
# | ||
# 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. | ||
# | ||
|
||
find_program(GLSL_VALIDATOR glslangValidator REQUIRED) | ||
|
||
macro(append_glsl_to_target target sources version) | ||
|
||
foreach (GLSL ${sources}) | ||
|
||
get_filename_component(FILE_NAME ${GLSL} NAME) | ||
|
||
set(SPIRV "${CMAKE_CURRENT_BINARY_DIR}/shaders/${FILE_NAME}.spv") | ||
|
||
if (NOT EXISTS "${GLSL}") | ||
set(GLSL "${CMAKE_CURRENT_SOURCE_DIR}/${GLSL}") | ||
endif () | ||
|
||
add_custom_command( | ||
OUTPUT ${SPIRV} | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/shaders | ||
COMMAND ${GLSL_VALIDATOR} -V${version} ${GLSL} -o ${SPIRV} | ||
DEPENDS ${GLSL} | ||
) | ||
|
||
list(APPEND SPIRV_BINARY_FILES ${SPIRV}) | ||
|
||
endforeach () | ||
|
||
add_custom_target(Shaders DEPENDS ${SPIRV_BINARY_FILES}) | ||
|
||
add_dependencies(${target} Shaders) | ||
|
||
add_custom_command(TARGET ${target} POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:${target}>/shaders/" | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_BINARY_DIR}/shaders" "$<TARGET_FILE_DIR:${target}>/shaders" | ||
) | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Copyright 2024 Joel Winarske | ||
# | ||
# 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. | ||
# | ||
|
||
add_executable(gl-shadertoy shadertoy.cc) | ||
|
||
target_compile_definitions(gl-shadertoy PRIVATE EGL_NO_X11 MESA_EGL_NO_X11_HEADERS) | ||
|
||
target_link_libraries(gl-shadertoy PRIVATE waypp wayland-gen PkgConfig::GLESv2 cxxopts::cxxopts) | ||
|
||
if (IPO_SUPPORT_RESULT) | ||
set_property(TARGET gl-shadertoy PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
endif () | ||
|
||
add_sanitizers(gl-shadertoy) |
Oops, something went wrong.