hello,
recently forked blender because life is short. been experimenting with small changes, fun times.
right now im trying to use transform feedback to run some computations on the gpu. my code works so to speak, the console is printing out the right values and doesnt spit out errors. i am however getting many, many crashes.
this method right here is the culprit,
std::vector<mt::vec3_packed> deformTest(int totvert) {
glUseProgram(program); // crashes here
glBindVertexArray(vertArray);
glEnable(GL_RASTERIZER_DISCARD);
glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER,
0, vertBuffers[POSITION_OUTPUT]);
glBeginTransformFeedback(GL_POINTS);
glDrawArrays(GL_POINTS, 0, totvert);
glBindVertexArray(0)
glEndTransformFeedback();
glDisable(GL_RASTERIZER_DISCARD);
glFlush();
std::vector<mt::vec3_packed> feedback(totvert);
glGetBufferSubData(GL_TRANSFORM_FEEDBACK_BUFFER,
0, vertSize, &feedback[0]);
return feedback;
}
the ctd isnt immediate, it only happens after a few seconds (ten or so) of this running every frame. after doing some reading, i suspect this is a matter of either
A) opengl calls outside of gpu module are illegal
or
B) the cpu-gpu sync is brutal and im actually running out of memory, thus the segfault.
can anyone tell me which one?