Linker 添加附加函数调用时,WebGL片段着色器无法链接

Linker 添加附加函数调用时,WebGL片段着色器无法链接,linker,linker-errors,webgl,raytracing,fragment-shader,Linker,Linker Errors,Webgl,Raytracing,Fragment Shader,我有一个WebGL片段着色器,用于光线跟踪。我使用纹理传入球体和三角形数据。到目前为止,我有2个球体和3个三角形在工作。当我使用第四个三角形添加check interestion调用时,着色器不会链接,调用getProgramInfoLog只会返回null 碎片着色器是否会变得太大?还是我需要寻找另一个原因?我如何确定问题可能在哪里 下面是一个代码片段,注释掉任何一个checkTriangleIntersection调用都会导致着色器成功链接 checkTriangleIntersection(

我有一个WebGL片段着色器,用于光线跟踪。我使用纹理传入球体和三角形数据。到目前为止,我有2个球体和3个三角形在工作。当我使用第四个三角形添加check interestion调用时,着色器不会链接,调用getProgramInfoLog只会返回null

碎片着色器是否会变得太大?还是我需要寻找另一个原因?我如何确定问题可能在哪里

下面是一个代码片段,注释掉任何一个checkTriangleIntersection调用都会导致着色器成功链接

checkTriangleIntersection(0.0, rayOrigin, rayDir, piOfNearest, normalOfNearest, colourOfNearest, distOfNearest);        
checkTriangleIntersection(1.0, rayOrigin, rayDir, piOfNearest, normalOfNearest, colourOfNearest, distOfNearest);
checkTriangleIntersection(2.0, rayOrigin, rayDir, piOfNearest, normalOfNearest, colourOfNearest, distOfNearest);
//checkTriangleIntersection(3.0, rayOrigin, rayDir, piOfNearest, normalOfNearest, colourOfNearest, distOfNearest);
因为除了索引之外,所有的调用都是相同的,所以我认为代码本身不会有什么问题,但是是否存在某种我可能遇到的限制


在添加额外的函数调用之前,我得到了超过30 FPS的速度,即使添加了额外的调用,vertex和fragemnt着色器都可以编译。

我通过将对checkTriangleIntersection的调用放入一个for循环来解决这个问题