4

I just ran in a small issue with WebGL today, while doing a project on point set visualisation. I understand there is a index limit in drawElements, due to the indexes being 16-bit integers. According to this post, however, there isn't for drawArrays, which I confirmed by being able to send some 400k points to the GPU.

The thing is, once I tried with 400k, I wanted to explore the possibilities of WebGL, and I tried with a 3M vertices model. Bang! Nothing gets displayed, and the WebGL inspector shows no drawArrays call.

Are you aware of some kind of limit for direct drawArray calls?

Community
  • 1
  • 1
F.X.
  • 6,809
  • 3
  • 49
  • 71
  • I've been mucking through the Chromium source to try and see if I can find anything in there for you. The `drawArrays()` function calls `gles2::DrawArrays()`... and I'm still trying to track that one down. – Nathan Osman Jun 29 '11 at 23:36
  • [This](http://src.chromium.org/svn/trunk/src/gpu/command_buffer/client/gles2_implementation.cc) file contains the code for `drawArrays()` and it in turn calls `helper_->DrawArrays(...)` which in turn leads to the `DrawArrays()` function in [this](http://src.chromium.org/svn/trunk/src/gpu/command_buffer/client/gles2_cmd_helper_autogen.h) file. Hmmm... – Nathan Osman Jun 29 '11 at 23:40
  • I'm guessing it somehow leads to [this](http://src.chromium.org/svn/trunk/src/ppapi/lib/gl/gles2/gles2.c) file and the `glDrawArrays()` function there. – Nathan Osman Jun 29 '11 at 23:41
  • What I thought was, it could be a hardware limitation. But I couldn't find anything about it on the spec. And 3M vertices don't seem like it's a lot for current graphic cards... – F.X. Jun 30 '11 at 09:00

2 Answers2

2

It looks like the same question is already discussed/answered here: Is there a limit of vertices in WebGL?. In that thread, the post by brainjam says that he discovered that drawArrays was not limited to 65k.

Community
  • 1
  • 1
jfriend00
  • 683,504
  • 96
  • 985
  • 979
  • I already saw and quoted this post. It doesn't say anything about drawArrays practical limitations, only that for drawElements you can't index more than 65k elements. – F.X. Jun 30 '11 at 08:57
  • Maybe I don't know exactly what you're looking for, but I thought drawArrays and it's limits was specifically discussed in this answer: http://stackoverflow.com/questions/4998278/is-there-a-limit-of-vertices-in-webgl/5843868#5843868. – jfriend00 Jun 30 '11 at 09:20
2

It sounds like you've got an outdated driver. The definition of drawArrays():

void drawArrays(enum mode, int first, long count)

The count elements is a long integer, that would mean at least 2^32 Elements in 32-bit architectures and 2^64 on 64-bit archs.

Remember that, unlike what anyone could presume, both Chrome/Chromium and Firefox use Direct3D as the underlying technology for WebGL on windows.

Chiguireitor
  • 3,186
  • 1
  • 20
  • 26
  • I'm using Chromium on Linux, so I guess this isn't a Direct3D issue. I'm going to look deeper into the _hardware_ specs, that's probably here... But I'm puzzled, this should be clearly stated somewhere! – F.X. Jul 01 '11 at 09:02