I am rendering 3 identical grids, 65*65 size, computing the Z ( my vertical axis ) value in a vertex shader. To offset each grid, I am creating an array with 3 vec2 elements, sent in the vertex shader as an attribute that shifts an entire grid, thereby expecting 3 identical grids at different positions on the screen. For this, I am using glVertexAttribDivisor to specify the offsetting attribute of each grid as "per instance" instead of "per vertex".

glVertexAttribDivisor(m_nglA_offset, 1);

Both renderings use glDrawElementsInstanced.

First, I am creating a single triangle strips, with degenerate strips at line ends, then call glDrawElementsInstanced and the 3 grids are rendered just fine.

Second, I am creating a new array of indices, with 64 primitive restarts ( using restart index (~0)) and call the same code. The code crash in glDrawElementsInstanced, after setting

glEnable(GL_PRIMITIVE_RESTART); glPrimitiveRestartIndex(~0).

The vertex buffer is a VBO object and the 3-elements offset array is in main memory.

I tried to specify a big advancement for glVertexAttribDivisor, but the crash remains.

Is this normal functionality or a bug in the driver?