Max number of instances?

Is there a maximum number of instances allowed in a draw call? I am trying to draw 32768 instances of a box, but I would estimate only about 2000 are appearing onscreen. The matrix data is stored in storage buffers, so there should be no problem with that. I get the same result with both these commands:

  • glDrawElementsInstancedBaseVertexBaseInstance
  • glMultiDrawElementsIndirect

When I set the object position procedurally in the vertex shader everything looks correct, so there is no problem.