ソースを参照

Fixed issues with iOS when shaders were not able to compile

David Catuhe 8 年 前
コミット
d0231fb7a7

ファイルの差分が大きいため隠しています
+ 11 - 11
dist/preview release/babylon.core.js


ファイルの差分が大きいため隠しています
+ 2105 - 2105
dist/preview release/babylon.d.ts


ファイルの差分が大きいため隠しています
+ 21 - 21
dist/preview release/babylon.js


+ 9 - 7
dist/preview release/babylon.max.js

@@ -21584,7 +21584,9 @@ var BABYLON;
                 return this;
             }
             if (!this._sourcePositions) {
+                var submeshes = this.subMeshes.slice();
                 this.setPositionsForCPUSkinning();
+                this.subMeshes = submeshes;
             }
             if (!this._sourceNormals) {
                 this.setNormalsForCPUSkinning();
@@ -24948,25 +24950,25 @@ var BABYLON;
                     }
                 }
                 engine.bindSamplers(this);
+                this._compilationError = "";
                 this._isReady = true;
                 if (this.onCompiled) {
                     this.onCompiled(this);
                 }
             }
             catch (e) {
+                this._compilationError = e.message;
                 // Let's go through fallbacks then
+                BABYLON.Tools.Error("Unable to compile effect: ");
+                BABYLON.Tools.Error("Defines: " + defines);
+                BABYLON.Tools.Error("Error: " + this._compilationError);
+                this._dumpShadersName();
                 if (fallbacks && fallbacks.isMoreFallbacks) {
-                    BABYLON.Tools.Error("Unable to compile effect with current defines. Trying next fallback.");
-                    this._dumpShadersName();
+                    BABYLON.Tools.Error("Trying next fallback.");
                     defines = fallbacks.reduce(defines);
                     this._prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks);
                 }
                 else {
-                    BABYLON.Tools.Error("Unable to compile effect: ");
-                    this._dumpShadersName();
-                    BABYLON.Tools.Error("Defines: " + defines);
-                    BABYLON.Tools.Error("Error: " + e.message);
-                    this._compilationError = e.message;
                     if (this.onError) {
                         this.onError(this, this._compilationError);
                     }

ファイルの差分が大きいため隠しています
+ 21 - 21
dist/preview release/babylon.noworker.js


+ 7 - 7
src/Materials/babylon.effect.js

@@ -286,25 +286,25 @@ var BABYLON;
                     }
                 }
                 engine.bindSamplers(this);
+                this._compilationError = "";
                 this._isReady = true;
                 if (this.onCompiled) {
                     this.onCompiled(this);
                 }
             }
             catch (e) {
+                this._compilationError = e.message;
                 // Let's go through fallbacks then
+                BABYLON.Tools.Error("Unable to compile effect: ");
+                BABYLON.Tools.Error("Defines: " + defines);
+                BABYLON.Tools.Error("Error: " + this._compilationError);
+                this._dumpShadersName();
                 if (fallbacks && fallbacks.isMoreFallbacks) {
-                    BABYLON.Tools.Error("Unable to compile effect with current defines. Trying next fallback.");
-                    this._dumpShadersName();
+                    BABYLON.Tools.Error("Trying next fallback.");
                     defines = fallbacks.reduce(defines);
                     this._prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks);
                 }
                 else {
-                    BABYLON.Tools.Error("Unable to compile effect: ");
-                    this._dumpShadersName();
-                    BABYLON.Tools.Error("Defines: " + defines);
-                    BABYLON.Tools.Error("Error: " + e.message);
-                    this._compilationError = e.message;
                     if (this.onError) {
                         this.onError(this, this._compilationError);
                     }

+ 9 - 7
src/Materials/babylon.effect.ts

@@ -357,23 +357,25 @@
 
                 engine.bindSamplers(this);
 
+                this._compilationError = "";
                 this._isReady = true;
                 if (this.onCompiled) {
                     this.onCompiled(this);
                 }
             } catch (e) {
+                this._compilationError = e.message;
+
                 // Let's go through fallbacks then
+                Tools.Error("Unable to compile effect: ");
+                Tools.Error("Defines: " + defines);
+                Tools.Error("Error: " + this._compilationError);
+                this._dumpShadersName();
+
                 if (fallbacks && fallbacks.isMoreFallbacks) {
-                    Tools.Error("Unable to compile effect with current defines. Trying next fallback.");
-                    this._dumpShadersName();
+                    Tools.Error("Trying next fallback.");
                     defines = fallbacks.reduce(defines);
                     this._prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks);
                 } else { // Sorry we did everything we can
-                    Tools.Error("Unable to compile effect: ");
-                    this._dumpShadersName();
-                    Tools.Error("Defines: " + defines);
-                    Tools.Error("Error: " + e.message);
-                    this._compilationError = e.message;
 
                     if (this.onError) {
                         this.onError(this, this._compilationError);

+ 2 - 0
src/Mesh/babylon.mesh.js

@@ -2232,7 +2232,9 @@ var BABYLON;
                 return this;
             }
             if (!this._sourcePositions) {
+                var submeshes = this.subMeshes.slice();
                 this.setPositionsForCPUSkinning();
+                this.subMeshes = submeshes;
             }
             if (!this._sourceNormals) {
                 this.setNormalsForCPUSkinning();

+ 2 - 0
src/Mesh/babylon.mesh.ts

@@ -2509,7 +2509,9 @@
             }
 
             if (!this._sourcePositions) {
+                var submeshes = this.subMeshes.slice();
                 this.setPositionsForCPUSkinning();
+                this.subMeshes = submeshes;
             }
 
             if (!this._sourceNormals) {