如何从以下 ScriptIntrinsics 创建 Renderscript ScriptGroup?
How to create a Renderscript ScriptGroup from the following ScriptIntrinsics?
我有三个脚本内在函数,我想将它们组合在一个 RenderScript ScriptGroup 中,以便利用与分组相关的任何性能提升。
我知道在 ScriptGroup 中,您必须根据另一个脚本的输出来设置每个脚本的输入。在 Blur intrinsic 的情况下,这是如何完成的?例如,如何将 blend1 的第二个参数连接到 blend2 的第一个参数?另外,如何将 blend1 中的第一个参数连接到模糊?
blend1.forEachSrcOver(inAllocation, pass2ColorAllocation);
blur.forEach(inAllocation);
blend2.forEachSrcOver(pass2ColorAllocation, inAllocation);
您要为此使用 getKernelID
调用各个内在函数。
在这种情况下,这实际上并不重要——在 ScriptGroups 中使用内在函数与单独调用它们相比并没有性能优势。
我有三个脚本内在函数,我想将它们组合在一个 RenderScript ScriptGroup 中,以便利用与分组相关的任何性能提升。
我知道在 ScriptGroup 中,您必须根据另一个脚本的输出来设置每个脚本的输入。在 Blur intrinsic 的情况下,这是如何完成的?例如,如何将 blend1 的第二个参数连接到 blend2 的第一个参数?另外,如何将 blend1 中的第一个参数连接到模糊?
blend1.forEachSrcOver(inAllocation, pass2ColorAllocation);
blur.forEach(inAllocation);
blend2.forEachSrcOver(pass2ColorAllocation, inAllocation);
您要为此使用 getKernelID
调用各个内在函数。
在这种情况下,这实际上并不重要——在 ScriptGroups 中使用内在函数与单独调用它们相比并没有性能优势。