简体   繁体   English

渲染脚本声明失败!rsAssert失败:!“未找到ScriptGroup:setInput孩子”

[英]renderscript assertion failure !rsAssert failed: !“ScriptGroup:setInput kid not found”

I dont understand why this assertion is thown. 我不明白为什么这个主张会被抛弃。 I believe I have the correct code sequence for setting up the scriptgroup 我相信我具有用于设置脚本组的正确代码序列

ScriptGroup.Builder sBuilder = new ScriptGroup.Builder(mRS);
sBuilder.addKernel(K1.getKernelID_root());
sBuilder.addKernel(K2.getKernelID_root());
sBuilder.addConnection(inAlloc.getType(),
                        K1.getKernelID_root(),
                        K2.getKernelID_root());
ScriptGroup sGroup = sBuilder.create();
sGroup.setInput(K1.getKernelID_root(), inAlloc);
sGroup.setOutput(k2.getKernelID_root(), outAlloc);
sGroup.execute();

I ask because I find that K1 executes, however, K2 does not execute at all. 我问是因为我发现K1执行,但是K2根本不执行。 Instead, this assertion is thrown. 而是抛出此断言。 Could this assertion have anything to do with this behavior? 这个断言可能与这种行为有关吗?

@jason I have solved this issue by qualifying the kernels with attribute ((kernel)) and then the scriptgroup execution triggers correctly. @jason我已经通过用属性 ((kernel))限定了内核来解决了这个问题,然后脚本组执行被正确触发了。 This avoided the assertion and I can clearly see that both kernels are executing as expected. 这避免了断言,我可以清楚地看到两个内核都按预期执行。 However, just a few more details on the scenario when this assertion occurred. 但是,仅在此断言发生时有关该场景的更多细节。 My previous definition of kernels was void root(short3 *out, uint32_t out_x, uint32_t out_y) . 我以前的内核定义是void root(short3 *out, uint32_t out_x, uint32_t out_y) So when kernels were defined as such(ie defined as root) , it appears the assertion is thrown. 因此,当内核这样定义(即定义为root)时,似乎抛出了断言。 It looks like there is some sort of clash between ScriptGroup.SetInput and if kernels are defined as root. 似乎ScriptGroup.SetInput与内核定义为root之间存在某种冲突。 When I get a chance, I will try to reproduce this issue. 如果有机会,我将尝试重现此问题。 For now, I have gone past this issue as mentioned above. 现在,我已经克服了如上所述的问题。

I don't see any obvious problem in the source. 我没有在源代码中看到任何明显的问题。 Any chance you could post some more context on what K1 & K2 are ? 您是否有机会发布有关K1和K2的更多信息?

The assert you are seeing does indicate a problem. 您看到的断言确实表明存在问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM