Skip to content

Commit 356c57c

Browse files
committed
The Shader will no longer set uniforms if the values are null, saving on GL ops.
1 parent a61207b commit 356c57c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
### Updates
2020

2121
* When calling `setHitArea` and not providing a shape (i.e. a texture based hit area), it will now set `customHitArea` to `false` by default (thanks @rexrainbow)
22+
* The Shader will no longer set uniforms if the values are `null`, saving on GL ops.
2223

2324
### Bug Fixes
2425

src/gameobjects/shader/Shader.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,11 @@ var Shader = new Class({
978978
location = uniform.uniformLocation;
979979
value = uniform.value;
980980

981+
if (value === null)
982+
{
983+
continue;
984+
}
985+
981986
if (length === 1)
982987
{
983988
if (uniform.glMatrix)

0 commit comments

Comments
 (0)