소스 검색

Fix parallel shader code

David Catuhe 6 년 전
부모
커밋
ec958868fd
3개의 변경된 파일10개의 추가작업 그리고 5개의 파일을 삭제
  1. 6 3
      src/Engines/WebGL/webGLPipelineContext.ts
  2. 0 1
      src/Engines/engine.ts
  3. 4 1
      src/Materials/effect.ts

+ 6 - 3
src/Engines/WebGL/webGLPipelineContext.ts

@@ -18,10 +18,13 @@ export class WebGLPipelineContext implements IPipelineContext {
     }
 
     public get isReady(): boolean {
-        if (this.program && this.isParallelCompiled) {
-            return this.engine._isRenderingStateCompiled(this);
+        if (this.program) {
+            if (this.isParallelCompiled) {
+                return this.engine._isRenderingStateCompiled(this);
+            }
+            return true;
         }
 
-        return true;
+        return false;
     }
 }

+ 0 - 1
src/Engines/engine.ts

@@ -3342,7 +3342,6 @@ export class Engine {
         context.deleteShader(vertexShader);
         context.deleteShader(fragmentShader);
 
-        pipelineContext.context = undefined;
         pipelineContext.vertexShader = undefined;
         pipelineContext.fragmentShader = undefined;
 

+ 4 - 1
src/Materials/effect.ts

@@ -384,7 +384,10 @@ export class Effect implements IDisposable {
      * @returns if the effect is compiled and prepared.
      */
     public isReady(): boolean {
-        return this._isReady && this._pipelineContext.isReady;
+        if (this._isReady) {
+            return true;
+        }
+        return this._pipelineContext.isReady;
     }
 
     /**