Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031477Open CASCADE[OCCT] OCCT:Visualizationpublic2020-04-01 11:042020-04-01 11:10
Assigned Tokgv 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0031477: Visualization, TKOpenGl - fetch/wrap getBufferSubData() function from WebGL 2.0
DescriptionFetching VBO data back is not fun:

1. OpenGL 1.5+
   - glGetBufferSubData(): YES
   - glMapBufferRange(): YES
2. OpenGL ES 2.0
   - glGetBufferSubData(): NO
   - glMapBufferRange(): NO
3. OpenGL ES 3.0+
   - glGetBufferSubData(): NO
   - glMapBufferRange(): YES
4. WebGL 1.0
   - glGetBufferSubData(): NO
   - glMapBufferRange(): NO
5. WebGL 2.0
   - glGetBufferSubData(): YES
   - glMapBufferRange(): NO

So that:
- Desktop OpenGL gives maximum flexibility
- OpenGL ES 2.0 and WebGL 1.0 give no chance to retrieve data back
- OpenGL ES 3.0+ gives only mapping buffer.
- WebGL 2.0 gives only getBufferSubData().

The reason for WebGL not having glMapBufferRange() is that it was considered difficult implementing different protection levels of mapped buffer on JavaScript level, so that getBufferSubData() just copying data to specified buffer was considered simpler and straightforward. The consequence is, however, is inconsistency between WebGL 2.0 / OpenGL ES 3.0, which are considered close to each other in most other aspects.

It should be checked if Emscripten will be able finding glGetBufferSubData() within WebGL 2.0 or to wrap it manually via EM_ASM_.
void myGetBufferSubData (GLenum theTarget, GLintptr theOffset, GLsizeiptr theSize, void* theData)
#ifdef __EMSCRIPTEN__
    Module.ctx.getBufferSubData($0, $1, HEAPU8.subarray($2, $2 + $3));
  }, theTarget, theOffset, theSize, theData);
  core20fwd->glGetBufferSubData (theTarget, theOffset, theSize, theData);
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2020-04-01 11:04 kgv New Issue
2020-04-01 11:04 kgv Assigned To => kgv
2020-04-01 11:10 kgv Relationship added child of 0031070

Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker