我正在尝试并行加载整数数组,但出现错误:
int[][] colors;
...
IntStream.range(0, colors.length).parallel().forEach(i -> {
GL15.glBufferSubData(GL43.GL_SHADER_STORAGE_BUFFER, pixelSIZE * i, colors[i]);
});
没有parallel()
工作正常的实施:
IntStream.range(0, colors.length).forEach(i -> {
GL15.glBufferSubData(GL43.GL_SHADER_STORAGE_BUFFER, pixelSIZE * i, colors[i]);
});
以及 for 循环:
for (int i = 0; i < colors.length; i++) {
GL15.glBufferSubData(GL43.GL_SHADER_STORAGE_BUFFER, pixelSIZE * i, colors[i]);
}
错误:
[thread 13608 also had an error][thread 19708 also had an error]
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff99ca48cd9, pid=15436, tid=0x0000000000004ce8
#
# JRE version: Java(TM) SE Runtime Environment (8.0_171-b11) (build 1.8.0_171-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C[thread 15904 also had an error]
[thread 1456 also had an error]
[thread 19652 also had an error]
[nvoglv64.dll+0x978cd9]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\Documents\NetBeansProjects\XRayInspector\hs_err_pid15436.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
C:\Users\Timur\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 19 seconds)
可以并行使用 glBufferSubData 吗?
我用 lwjgl 3