Closed
Bug 528023
Opened 16 years ago
Closed 15 years ago
[webgl] bufferSubData counts in elements instead of bytes
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: ilmari.heikkinen, Unassigned)
References
()
Details
Attachments
(2 files)
1.74 KB,
patch
|
Details | Diff | Splinter Review | |
1.29 KB,
patch
|
Details | Diff | Splinter Review |
The BufferSubData function uses canvasArrayObj->NativeCount and boundBuffer->Count instead of NativeSize and ByteCount, which seems to be broken, as the GLES bufferSubData counts offsets in bytes. Further, the BufferSubData function passes the offset param unchanged to GL (=treat offset as bytes), making the logic completely broken.
Plus if you use the element counts for error checking, you need to check that the bound buffer and array object element size are equal, which seems to be commented out with FIXME.
Attached patch to use byte sizes for counting.
Relevant tests:
http://cs.helsinki.fi/u/ilmarihe/c3d/functions/bufferSubData.html
http://cs.helsinki.fi/u/ilmarihe/c3d/functions/bufferSubDataBadArgs.html
Comment 1•16 years ago
|
||
Woops. Missed this when adding WebGLArrayBuffer. I'm surprised this worked with existing stuff. That patch won't work with mixed WebGLArrayBuffers though, because ByteCount uses ElementSize.
The Count/ByteCount naming is confusing and it should really just be bytes, with the members here and in the arrays fixed to have sane naming.
Short of that, this needs to just use the same definition of count as bytes everywhere.
Comment 2•16 years ago
|
||
Comment 3•15 years ago
|
||
Another 2 patches that were never reviewed, because they weren't tagged as needing review :( this stuff has since been fixed.
Please, please when you attach a patch, check review: '?' and enter :vlad or :bjacob so we can't forget to review your great patches :(
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Resolution: FIXED → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•