I found the cause - it seems it doesn't like a zero count of elements in the indirect draw structs for some reason? If I remove said null elements its all fine. But that's a bit worrying if I want to eventually generate those draws on the GPU instead of CPU...
Also if I use:
glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, 0, 0, 0);
It draws something not _nothing_ but doesn't hang my system any more.
So I think that's a driver bug?
Just to be clear, it sounds like you're seeing two problems here. First is that if you have a single draw in the indirect buffer with a count of zero indices, then the GPU hangs. The second is that if you call glMultiDrawElementsIndirect with a draw count of zero, then you see corruption or hangs. Is that correct?
The first sounds like a known issue that we resolved many months - actually well over a year ago, so it is surprising if it came back, We'll have to investigate.
The second also sounds like a separate bug.
Do you have an indirect parameter buffer bound, or are you trying to use client memory for this? It looks from your code snippet it looks like you're using a buffer, but I want to confirm that.
Yes it appears that I encountered two problems. The main one is the indirect draw buffer with a count of zero (but not all elements were zero which I think is ok), and yes the second a glMultiDrawElementsIndirect() with a draw count of zero. However I had to discover the second (and guard around it to stop the system hang) to discover the indirect draw buffer problem. I am not sure if they were actually directly related in cause.
I had persistently mapped buffers for the indirect draw and the instance vertex stream (which consisted of 4 GL_INTs - one being used for the instanceID, and connected to vertex attribute 2). The index and vertex buffers used were allocated with buffer storage and mapped per frame (The vertex format from here had a position and texture coordinates that were a compressed 8 bytes in size, 16 bit indices).
I posted some additional info in the related question top opengl.org here: https://www.opengl.org/discussion_boards/showthread.php/186128-glMultiDrawElementsIndirect%28%29-problems?p=1265880#post1265880
Since then I have moved a few things around as I am transitioning things to more modern OpenGL but I believe the problem is still happening - as all I have changed currently is using a persistent staging buffer to upload index/vertex data which is then copied to GPU only accessible buffers used for rendering (draw indirect and instance data still coming from a persistently mapped CPU accessible buffers).
Also it would be good to know while I am here if it is recommended against to use the same persistent staging buffer for both index and vertex data at the same time? - I am writing a mix of index and vertex data in the stream together currently that then get copied out to their respective GPU side index/vertex buffers.
Thanks for your response!