--- old/modules/graphics/src/main/native-prism-d3d/D3DMesh.cc 2013-11-12 20:09:19.201171800 +0400 +++ new/modules/graphics/src/main/native-prism-d3d/D3DMesh.cc 2013-11-12 20:09:18.773437500 +0400 @@ -105,14 +105,15 @@ // << ", indexBufferSize = " << ibSize << endl; IDirect3DDevice9 *device = context->Get3DDevice(); - UINT size = vbSize * sizeof (float); + UINT size = vbSize * sizeof (float); // in bytes + UINT vbCount = size / PRIMITIVE_VERTEX_SIZE; // in vertices HRESULT result = D3D_OK; - if (numVertices != vbSize) { + if (numVertices != vbCount) { releaseVertexBuffer(); result = device->CreateVertexBuffer(size, D3DUSAGE_WRITEONLY, fvf, D3DPOOL_DEFAULT, &vertexBuffer, NULL); - numVertices = vbSize; + numVertices = vbCount; } if (SUCCEEDED(result) && (vertexBuffer != NULL)) { @@ -151,14 +152,15 @@ // << ", indexBufferSize = " << ibSize << endl; IDirect3DDevice9 *device = context->Get3DDevice(); - UINT size = vbSize * sizeof (float); + UINT size = vbSize * sizeof (float); // in bytes + UINT vbCount = size / PRIMITIVE_VERTEX_SIZE; // in vertices HRESULT result = D3D_OK; - if (numVertices != vbSize) { + if (numVertices != vbCount) { releaseVertexBuffer(); result = device->CreateVertexBuffer(size, D3DUSAGE_WRITEONLY, fvf, D3DPOOL_DEFAULT, &vertexBuffer, NULL); - numVertices = vbSize; + numVertices = vbCount; } if (SUCCEEDED(result) && (vertexBuffer != NULL)) {