shader预编译的bug

private initShader()
    {
        var shaderObj:object = {"PBR":[{"defineNames":["RECEIVESHADOW","DIRECTIONLIGHT","UV","ALBEDOTEXTURE"],"passIndex":0,"subShaderIndex":0},{"defineNames":["RECEIVESHADOW","DIRECTIONLIGHT","UV","BONE","ALBEDOTEXTURE"],"passIndex":0,"subShaderIndex":0},{"defineNames":["RECEIVESHADOW","GPU_INSTANCE","DIRECTIONLIGHT","UV","ALBEDOTEXTURE"],"passIndex":0,"subShaderIndex":0},{"defineNames":["RECEIVESHADOW","GPU_INSTANCE","DIRECTIONLIGHT","UV","ALBEDOTEXTURE","TRANSPARENTBLEND"],"passIndex":0,"subShaderIndex":0},{"defineNames":["RECEIVESHADOW","DIRECTIONLIGHT","UV","ALBEDOTEXTURE","TRANSPARENTBLEND"],"passIndex":0,"subShaderIndex":0},{"defineNames":["RECEIVESHADOW","DIRECTIONLIGHT","UV"],"passIndex":0,"subShaderIndex":0}],"LineShader":[{"defineNames":[],"passIndex":0,"subShaderIndex":0}],"Unlit":[{"defineNames":["TILINGOFFSET","ALBEDOTEXTURE"],"passIndex":0,"subShaderIndex":0},{"defineNames":["ALBEDOTEXTURE"],"passIndex":0,"subShaderIndex":0},{"defineNames":["GPU_INSTANCE","ALBEDOTEXTURE"],"passIndex":0,"subShaderIndex":0}]}; 
        var list:any[];
        var item:any;
        
        for(var key in shaderObj)
        {
            list = shaderObj[key];
            for(var i:number=0;i<list.length;i++)
            {
                item = list[i];
                Laya.Shader3D.compileShaderByDefineNames(key,item.subShaderIndex,item.passIndex,item.defineNames);
            }
        } 
        console.log("预编译完成");
    }
 
问题描述
问题1:代码里面有10个预编译shader有一个没编译,下图中标识了最后一个没编译出来的
问题2:预编译完成后,后面有的shader又给编译了一遍,下图中有标识
AF1GZ~1XG[Z6B501X279KM.png
已邀请:

要回复问题请先

商务合作
商务合作