Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit cf4db71

Browse files
committed
Unity's GL Core and GL ES 3.x shader pipeline supports attributes like [branch], [flatten], ...
1 parent 2131b6b commit cf4db71

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

PostProcessing/Shaders/API/OpenGL.hlsl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@
2929
#define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r
3030
#define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r
3131

32-
#define UNITY_BRANCH
33-
#define UNITY_FLATTEN
34-
#define UNITY_UNROLL
35-
#define UNITY_LOOP
36-
#define UNITY_FASTOPT
32+
#if SHADER_API_GLES
33+
# define UNITY_BRANCH
34+
# define UNITY_FLATTEN
35+
# define UNITY_UNROLL
36+
# define UNITY_LOOP
37+
# define UNITY_FASTOPT
38+
#else
39+
# define UNITY_BRANCH [branch]
40+
# define UNITY_FLATTEN [flatten]
41+
# define UNITY_UNROLL [unroll]
42+
# define UNITY_LOOP [loop]
43+
# define UNITY_FASTOPT [fastopt]
44+
#endif
3745

3846
#define CBUFFER_START(name)
3947
#define CBUFFER_END

0 commit comments

Comments
 (0)