wjc272008 / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

VertexBuffer.updateData() does not update vertex/triangle count (undefined OGL behavior may result) #487

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Change the Position VertexBuffer on a mesh, ensure the new buffer is larger 
than the previous. Use the VertexBuffer.updateData() method for this purpose. 
You can also update the index buffer in the same way to point to the new 
vertices.

What is the expected output? What do you see instead?
The newly added vertices are not displayed. Even worse, its possible for a 
crash to happen at this point for GPUs with undefined behavior when a vertex 
index is specified that is greater than the vertex count. 
Proposed solution: Deprecate VertexBuffer.updateData(), or only allow it to set 
a buffer with the same number of elements. Next, add a new method, 
Mesh.updateBuffer(), that will do the same thing updateData() does but also 
call updateCounts() at the end.

Original issue reported on code.google.com by ShadowIs...@gmail.com on 4 Apr 2012 at 7:37

GoogleCodeExporter commented 9 years ago

Original comment by ShadowIs...@gmail.com on 6 Sep 2012 at 6:11