[英]How to create a Renderscript ScriptGroup from the following ScriptIntrinsics?
I have three script intrinsics that I would like to group together in a RenderScript ScriptGroup so as to take advantage of any performance gains associated with the grouping. 我想将三个脚本内在函数一起归类到一个RenderScript ScriptGroup中,以便利用与分组相关的任何性能提升。
I understand that in a ScriptGroup you have to set the inputs of each script from the output of another. 我了解在ScriptGroup中,您必须从另一个脚本的输出中设置每个脚本的输入。 In the case of a Blur intrinsic, how is this done?
如果是内在模糊,该如何做? For example, how can I wire the second parameter of blend1 to the first parameter of blend2?
例如,如何将blend1的第二个参数连接到blend2的第一个参数? Also, how can I wire the first parameter in blend1 to the blur?
另外,如何将blend1中的第一个参数连接到模糊?
blend1.forEachSrcOver(inAllocation, pass2ColorAllocation);
blur.forEach(inAllocation);
blend2.forEachSrcOver(pass2ColorAllocation, inAllocation);
you want to use the getKernelID
calls in the individual intrinsics for this. 您想
getKernelID
在各个内部函数中使用getKernelID
调用。
in this case, it doesn't actually matter much--there's not a performance advantage from using intrinsics in ScriptGroups versus calling them individually. 在这种情况下,实际上并没有多大关系-在ScriptGroups中使用内部函数与单独调用它们之间并没有性能优势。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.