Return on shader error

This commit is contained in:
luboslenco
2019-02-26 23:26:12 +01:00
parent b166cf6ce1
commit b2a0deb127
+14 -2
View File
@@ -507,7 +507,13 @@ class UINodes extends iron.Trait {
} }
if (sc != null) sc.delete(); if (sc != null) sc.delete();
sc = new ShaderContext(con.data, function(sc:ShaderContext){});
var compileError = false;
sc = new ShaderContext(con.data, function(sc:ShaderContext) {
if (sc == null) compileError = true;
});
if (compileError) return;
m.shader.raw.contexts.push(sc.raw); m.shader.raw.contexts.push(sc.raw);
m.shader.contexts.push(sc); m.shader.contexts.push(sc);
@@ -593,7 +599,13 @@ class UINodes extends iron.Trait {
// if (sc == null) { // if (sc == null) {
// from_source is synchronous.. // from_source is synchronous..
if (sc != null) sc.delete(); if (sc != null) sc.delete();
sc = new ShaderContext(cdata, function(sc:ShaderContext){});
var compileError = false;
sc = new ShaderContext(cdata, function(sc:ShaderContext) {
if (sc == null) compileError = true;
});
if (compileError) return;
m.shader.raw.contexts.push(sc.raw); m.shader.raw.contexts.push(sc.raw);
m.shader.contexts.push(sc); m.shader.contexts.push(sc);
m.raw.contexts.push(_matcon); m.raw.contexts.push(_matcon);