Skip to content

Commit 923006a

Browse files
authored
Merge pull request #104 from guzba/master
simpler
2 parents f9c0025 + a425cc9 commit 923006a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/fidget/opengl/shaders.nim

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,15 +382,11 @@ proc bindUniforms*(shader: Shader) =
382382
if uniform.componentType == 0.GLenum:
383383
continue
384384

385-
if uniform.componentType != cGL_INT and uniform.componentType != cGL_FLOAT:
386-
raiseUniformComponentTypeException(uniform.name, uniform.componentType)
387-
388385
if not uniform.changed:
389386
continue
390387

391388
if uniform.componentType == cGL_INT:
392389
let values = cast[array[16, GLint]](uniform.values)
393-
394390
case uniform.kind:
395391
of bkSCALAR:
396392
glUniform1i(uniform.location, values[0])
@@ -408,7 +404,7 @@ proc bindUniforms*(shader: Shader) =
408404
)
409405
else:
410406
raiseUniformKindException(uniform.name, uniform.kind)
411-
else:
407+
elif uniform.componentType == cGL_FLOAT:
412408
let values = cast[array[16, float32]](uniform.values)
413409
case uniform.kind:
414410
of bkSCALAR:
@@ -434,6 +430,8 @@ proc bindUniforms*(shader: Shader) =
434430
)
435431
else:
436432
raiseUniformKindException(uniform.name, uniform.kind)
433+
else:
434+
raiseUniformComponentTypeException(uniform.name, uniform.componentType)
437435

438436
uniform.changed = false
439437

0 commit comments

Comments
 (0)