Skip to content

Commit 33ab254

Browse files
committed
Add Bool type to WebGL shader interface (ref: elm#2120)
1 parent 3307235 commit 33ab254

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/Compiler/AST/Utils/Shader.elm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type Type
4242
| V4
4343
| M4
4444
| Texture
45+
| Bool
4546

4647

4748

@@ -176,6 +177,9 @@ typeEncoder type_ =
176177

177178
Texture ->
178179
6
180+
181+
Bool ->
182+
7
179183
)
180184

181185

@@ -206,6 +210,9 @@ typeDecoder =
206210
6 ->
207211
BD.succeed Texture
208212

213+
7 ->
214+
BD.succeed Bool
215+
209216
_ ->
210217
BD.fail
211218
)

src/Compiler/Parse/Shader.elm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ extractInputs decl =
227227
GLS.Sampler2D ->
228228
[ ( qual, Shader.Texture, name ) ]
229229

230+
GLS.Bool ->
231+
[ ( qual, Shader.Bool, name ) ]
232+
230233
_ ->
231234
[]
232235

src/Compiler/Type/Constrain/Expression.elm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,9 @@ glToType glType =
802802
Shader.Texture ->
803803
Type.texture
804804

805+
Shader.Bool ->
806+
Type.bool
807+
805808

806809

807810
-- CONSTRAIN DESTRUCTURES

0 commit comments

Comments
 (0)