Closed Bug 528023 Opened 16 years ago Closed 15 years ago

[webgl] bufferSubData counts in elements instead of bytes

Categories

(Core :: Graphics: CanvasWebGL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: ilmari.heikkinen, Unassigned)

References

()

Details

Attachments

(2 files)

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
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.
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
Resolution: FIXED → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: