From 8a127bc0e7aef3f805867db5905b566f1aaa3220 Mon Sep 17 00:00:00 2001 From: Yun Hsiao Wu Date: Fri, 5 Jul 2019 17:52:55 +0800 Subject: [PATCH] shut down gracefully when shader compile error encountered (#4828) --- cocos/gfx/webgl/webgl-commands.ts | 2 ++ cocos/gfx/webgl2/webgl2-commands.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cocos/gfx/webgl/webgl-commands.ts b/cocos/gfx/webgl/webgl-commands.ts index 15180c607b..65af4701e3 100644 --- a/cocos/gfx/webgl/webgl-commands.ts +++ b/cocos/gfx/webgl/webgl-commands.ts @@ -1146,6 +1146,7 @@ export function WebGLCmdFuncCreateShader (device: WebGLGFXDevice, gpuShader: Web gl.deleteShader(gpuStage.glShader); gpuStage.glShader = null; + return; } } } @@ -1175,6 +1176,7 @@ export function WebGLCmdFuncCreateShader (device: WebGLGFXDevice, gpuShader: Web gpuStage.glShader = null; } } + return; } // parse inputs diff --git a/cocos/gfx/webgl2/webgl2-commands.ts b/cocos/gfx/webgl2/webgl2-commands.ts index f59e780e3e..c3333c836c 100644 --- a/cocos/gfx/webgl2/webgl2-commands.ts +++ b/cocos/gfx/webgl2/webgl2-commands.ts @@ -1395,6 +1395,7 @@ export function WebGL2CmdFuncCreateShader (device: WebGL2GFXDevice, gpuShader: W gl.deleteShader(gpuStage.glShader); gpuStage.glShader = null; + return; } } } @@ -1424,6 +1425,7 @@ export function WebGL2CmdFuncCreateShader (device: WebGL2GFXDevice, gpuShader: W gpuStage.glShader = null; } } + return; } // parse inputs