File tree Expand file tree Collapse file tree 3 files changed +33
-8
lines changed Expand file tree Collapse file tree 3 files changed +33
-8
lines changed Original file line number Diff line number Diff line change 1
1
This directory contains postprocessed versions of the shaders in the top-level
2
2
` shaders/ ` directory, for convenience. Don't modify the shaders here; instead
3
- modify the corresponding shaders in ` shaders/ ` and rerun ` make ` in that
4
- directory.
5
-
6
- You will need ` glslangValidator ` and ` spirv-cross ` installed to execute the
7
- Makefile. On macOS, you can get these with ` brew install glslang spirv-cross ` .
3
+ modify the corresponding shaders in ` shaders/ ` and rebuild them according to
4
+ ` shaders/README.md ` .
Original file line number Diff line number Diff line change 58
58
59
59
GLSL_3_VERSION =330
60
60
GLSL_4_VERSION =430
61
+
62
+ GLSLANG? =glslangValidator
61
63
GLSLANGFLAGS =--auto-map-locations -I.
62
64
GLSLANGFLAGS_METAL =$(GLSLANGFLAGS ) -DPF_ORIGIN_UPPER_LEFT=1
63
65
@@ -81,13 +83,13 @@ clean:
81
83
rm -f $(OUT )
82
84
83
85
build/metal/% .spv : % .glsl $(INCLUDES )
84
- mkdir -p $(dir $@ ) && glslangValidator $(GLSLANGFLAGS_METAL ) -G$(GLSL_VERSION ) -S $(GLSL_SHADER_TYPE$(suffix $(basename $(notdir $< ) ) ) ) -o $@ $<
86
+ mkdir -p $(dir $@ ) && $( GLSLANG ) $(GLSLANGFLAGS_METAL ) -G$(GLSL_VERSION ) -S $(GLSL_SHADER_TYPE$(suffix $(basename $(notdir $< ) ) ) ) -o $@ $<
85
87
86
88
$(TARGET_DIR ) /gl3/% .glsl : % .glsl $(INCLUDES )
87
- mkdir -p $(dir $@ ) && echo $(GLSL_VERSION_HEADER ) > $@ && echo $(HEADER ) >> $@ && ( glslangValidator $( GLSLANGFLAGS) -S $( GLSL_SHADER_TYPE$( suffix $( basename $( notdir $< ) ) ) ) -E $< | sed $( GLSL_SED_ARGS) >> $@ ) || ( rm $@ && exit 1 )
89
+ mkdir -p $(dir $@ ) && echo $(GLSL_VERSION_HEADER ) > $@ && echo $(HEADER ) >> $@ && ( $( GLSLANG ) $( GLSLANGFLAGS) -S $( GLSL_SHADER_TYPE$( suffix $( basename $( notdir $< ) ) ) ) -E $< | sed $( GLSL_SED_ARGS) >> $@ ) || ( rm $@ && exit 1 )
88
90
89
91
$(TARGET_DIR ) /gl4/% .glsl : % .glsl $(INCLUDES )
90
- mkdir -p $(dir $@ ) && echo $(GLSL_VERSION_HEADER ) > $@ && echo $(HEADER ) >> $@ && ( glslangValidator $( GLSLANGFLAGS) -S $( GLSL_SHADER_TYPE$( suffix $( basename $( notdir $< ) ) ) ) -E $< | sed $( GLSL_SED_ARGS) >> $@ ) || ( rm $@ && exit 1 )
92
+ mkdir -p $(dir $@ ) && echo $(GLSL_VERSION_HEADER ) > $@ && echo $(HEADER ) >> $@ && ( $( GLSLANG ) $( GLSLANGFLAGS) -S $( GLSL_SHADER_TYPE$( suffix $( basename $( notdir $< ) ) ) ) -E $< | sed $( GLSL_SED_ARGS) >> $@ ) || ( rm $@ && exit 1 )
91
93
92
94
$(TARGET_DIR ) /metal/% .metal : build/metal/% .spv
93
95
mkdir -p $(dir $@ ) && echo $(HEADER ) > $@ && ( $( SPIRVCROSS) $( SPIRVCROSSFLAGS) $< >> $@ ) || ( rm $@ && exit 1 )
Original file line number Diff line number Diff line change
1
+ # Building the shaders
2
+
3
+ You will need ` glslangValidator ` and ` spirv-cross ` installed to execute the
4
+ Makefile from this directory. You can speed up the build by parallelizing the
5
+ build: ` make -j ` .
6
+
7
+ ## macOS
8
+
9
+ You can use [ Homebrew] ( https://brew.sh/ ) to install the dependencies:
10
+
11
+ ``` sh
12
+ brew install glslang spirv-cross
13
+ ```
14
+
15
+ ## Windows
16
+
17
+ ` glslangValidator ` and ` spirv-cross ` are available by installing the
18
+ [ Vulkan SDK] ( https://vulkan.lunarg.com/sdk/home ) . You'll also need some commands
19
+ like ` make ` , ` rm ` , etc. These are available on the
20
+ [ Windows Subsystem for Linux] ( https://docs.microsoft.com/en-us/windows/wsl/install-win10 )
21
+ shell. You'll need to set these environment variables for ` make ` to succeed:
22
+
23
+ ``` sh
24
+ export GLSLANG=glslangValidator.exe
25
+ export SPIRVCROSS=spirv-cross.exe
26
+ ```
You can’t perform that action at this time.
0 commit comments