[LayaAirIDE 2.0]发布原生 ios/android 的渲染问 题

游戏2d界面出现的渲染错误 xcode和androidstudio 
2dui界面会不显示,但是开始游戏之后就又显示了如果 在游戏中不进行操作 的话就又会消失 再次操作就又会显示导致显示忽闪忽闪的
都会播报这个
 
JSCallbackFuncObj::addCallbackFunc error m_vFunc[1] != NULL
JSCallbackFuncObj::addCallbackFunc error m_vFunc[2] != NULL
 
 我排查了很久在xcode里面发现如下的代码
我不知道引擎 在渲染这块进行了什么操作,我个人认为是不是 app渲染问题进行了限制
我们还发现了 不知道为什么 底层限制了native获取材质的代码 
有没有官方团队指点一下,我们具体排查就排查这么多 不知道是什么原因 还是我们少了什么操作才会出现这个问题
mmexport1560338180794.jpg 7C2CAD86-FC92-4A0B-AD8E-E59E5ECA8E98.png
已邀请:

151*****306

赞同来自:

就像最上面我发帖的另一个问题 就是
我进入游戏 就会提示alert("ShaderData getTexture can't support"); 
我们在游戏中也 确实进行了相关的操作 
private onTexLoad(tex:Laya.Texture2D):void
{
// let oldTex = this.material.getTexture();
this.material.setTexture(tex);
this.plane.active = true;
// if(oldTex)
// {
// MeshPool.destoryRes(oldTex["keyUrl"],oldTex);
// } 
}我所注视的就是上面在laya.3d.js 中出现的那个alert 的提示 
我知道为什么 在native 会受到限制 但是在 web 上 和wx上都是不会出现这个问题 是同一套代码

151*****306

赞同来自:

有人知道吗,很着急

151*****306

赞同来自:

这边老板刚发话,如果有人解决问题 奖金可以到1000

151*****306

赞同来自:

公司项目急着上线

151*****306

赞同来自:

项目用的fgui

151*****306

赞同来自:

后面我们排查到了 laya.core.js 文件中出现到
/**
    *更新_cnavas相关的状态
    */
    __proto._checkCanvasEnable=function(){
        var tEnable=this._cacheStyle.needEnableCanvasRender();
        this._getCacheStyle().enableCanvasRender=tEnable;
        if (tEnable){
            if (this._cacheStyle.needBitmapCache()){
                this._cacheStyle.cacheAs="bitmap";
                }else {
                this._cacheStyle.cacheAs=this._cacheStyle.userSetCache;
            }
            this._cacheStyle.reCache=true;
            this._renderType |=/*laya.display.SpriteConst.CANVAS*/0x08;
            }else {
            this._cacheStyle.cacheAs="none";
            this._cacheStyle.releaseContext();
            this._renderType &=~ /*laya.display.SpriteConst.CANVAS*/0x08;
        }
        this._setCacheAs(this._cacheStyle.cacheAs);
        this._setRenderType(this._renderType);
    }我们发现 laya在底层请求更新数据的时候好像失败了
上面的代码 好像调用的是laya.webgl.js 中的
    //TODO:coverage
    __proto._setCacheAs=function(value){
        DrawCanvasCmdNative.createCommandEncoder();
        if (!this._drawCanvasParamData){
            this._drawCanvasParamData=/*__JS__ */new ParamData(33 *4,true);
        }
        if (!this._callbackFuncObj){
            this._callbackFuncObj=/*__JS__ */new CallbackFuncObj();
        }
        if (!this._canvasBeginCmd){
            this._canvasBeginCmd=LayaGL.instance.createCommandEncoder(128,64,false);
        }
        if (!this._canvasEndCmd){
            this._canvasEndCmd=LayaGL.instance.createCommandEncoder(128,64,false);
        }
        this._datai32[ /*laya.display.SpriteConst.POSCALLBACK_OBJ_ID*/54]=this._callbackFuncObj.id;
        this._callbackFuncObj.addCallbackFunc(1,(this.canvasBeginRenderFromNative).bind(this));
        this._callbackFuncObj.addCallbackFunc(2,(this.canvasEndRenderFromNative).bind(this));
        this._datai32[ /*laya.display.SpriteConst.POSCANVAS_CALLBACK_FUN_ID*/56]=1;
        this._datai32[ /*laya.display.SpriteConst.POSCANVAS_CALLBACK_END_FUN_ID*/57]=2;
        this._datai32[ /*laya.display.SpriteConst.POSCANVAS_BEGIN_CMD_ID*/58]=this._canvasBeginCmd.getPtrID();
        this._datai32[ /*laya.display.SpriteConst.POSCANVAS_END_CMD_ID*/59]=this._canvasEndCmd.getPtrID();
        this._datai32[ /*laya.display.SpriteConst.POSCANVAS_DRAW_TARGET_CMD_ID*/60]=DrawCanvasCmdNative._DRAW_CANVAS_CMD_ENCODER_.getPtrID();
        this._datai32[ /*laya.display.SpriteConst.POSCANVAS_DRAW_TARGET_PARAM_ID*/61]=this._drawCanvasParamData.getPtrID();
    }中的addCallbackFunc(1,(this.canvasBeginRenderFromNative).bind(this));
和addCallbackFunc(2,(this.canvasEndRenderFromNative).bind(this)); 再绑定回调的时候出现了问题
这也跟在 androidstudio 和 xcode所报的 错误 js
E/LayaBox: JSCallbackFuncObj::addCallbackFunc error m_vFunc[1] != NULL
JSCallbackFuncObj::addCallbackFunc error m_vFunc[2] != NULL是吻合的

151*****306

赞同来自:

我怀疑是 laya 在native 加了什么限制是我所不知道的

该问题目前已经被锁定, 无法添加新回复

商务合作
商务合作