nvoglv32.dll 中未处理的异常 - 在 for 循环中调用 imageStore
Unhandled Exception in nvoglv32.dll - Calling imageStore in a for loop
我正在尝试在我的计算着色器中使用 for 循环填充 image3D。
以下三行代码在 for 循环之外有效,因为程序将 运行 并给出预期结果:
position = ivec3(gl_GlobalInvocationID.xyz);
colour = vec4(0.5, 0.0, 0.0, 1.0);
imageStore(visualTexture, position, colour); //visualTexture being an empty image3D
//fed into the shader
但是,当置于 for 循环中时,会抛出 nvoglv32.dll
中未处理的异常,并请求致命程序退出。最初我认为这可能是因为我试图多次写入同一位置,但当然这不适用于此代码,因为全局调用 ID 对于每次迭代都是唯一的,对吧?
我觉得自己很蠢。它不起作用的原因是我的 for 循环看起来像这样:
for (int j = 0; j < i; i++)
i是之前for循环中的一个变量,现在已经不存在了,程序因此中断。
我正在尝试在我的计算着色器中使用 for 循环填充 image3D。
以下三行代码在 for 循环之外有效,因为程序将 运行 并给出预期结果:
position = ivec3(gl_GlobalInvocationID.xyz);
colour = vec4(0.5, 0.0, 0.0, 1.0);
imageStore(visualTexture, position, colour); //visualTexture being an empty image3D
//fed into the shader
但是,当置于 for 循环中时,会抛出 nvoglv32.dll
中未处理的异常,并请求致命程序退出。最初我认为这可能是因为我试图多次写入同一位置,但当然这不适用于此代码,因为全局调用 ID 对于每次迭代都是唯一的,对吧?
我觉得自己很蠢。它不起作用的原因是我的 for 循环看起来像这样:
for (int j = 0; j < i; i++)
i是之前for循环中的一个变量,现在已经不存在了,程序因此中断。