-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* include-shaders: this is about right * include-shaders: this works! * include-shaders: remove debug stuff * include-shaders: cannot remove that cache buster for now * include-shaders: move size2str into Manager as static * include-shaders: use static const shaders * include-shaders: remove dead platform code * include-shaders: disable cache buster for now * include-shaders: rename vertex to vertex_3d * include-shaders: re-enable cache buster
- Loading branch information
Showing
10 changed files
with
59 additions
and
139 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,8 @@ | ||
add_custom_command( | ||
OUTPUT shaders.hh | ||
cache-buster.hh | ||
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/pack_GLSLs.sh ${CMAKE_CURRENT_BINARY_DIR}/shaders.hh | ||
) | ||
|
||
set(GENERATED_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
add_custom_target(shaders_out ${GLSLs} DEPENDS shaders.hh) |
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,24 @@ | ||
#!/bin/bash | ||
|
||
# Combine surrounding GLSL files into C++ data | ||
|
||
[[ $# -ne 1 ]] && echo "Usage: $0 <path to target header file>" && exit 1 | ||
|
||
hh="$1" | ||
hh_dir="$(dirname "$0")" | ||
|
||
pack_GLSL() { | ||
local glsl="$1" | ||
local name="$(basename "$glsl" .glsl)" | ||
echo >>"$hh" | ||
echo "static const std::string shader__${name} = R\"(\\" >>"$hh" | ||
cat "$glsl" >>"$hh" | ||
echo ')";' >>"$hh" | ||
echo >>"$hh" | ||
} | ||
|
||
echo '#pragma once' >"$hh" | ||
echo '#include <string>' >>"$hh" | ||
for glsl in "$hh_dir"/*.glsl; do | ||
pack_GLSL "$glsl" | ||
done |
File renamed without changes.