yooyo
03-11-2010, 03:21 AM
I run into very strange issue on Intel integrated cards (on desktop and laptops), while using VBO. App crash because it writes data to VBO buffer.
- Create VBO and fill data
- bind and render -> OK
- bind and update data -> OK
- bind and render -> OK
- bind and update data -> crash in driver
It crashes no matter what I tried to do.. glBufferSubData or glMapBuffer + memcpy. glMapBuffer returns valid pointer and app crash even if I write only one byte to VBO memory. There is no buffer overrun.
ATM.. I disabled VBO when app run on Intel gfx and use good-old vertex arrays.
I found VBO examples on internet which correctly maps VBO's and update data and it work on Intel too.
Only difference between that sample and my app is that I use two VBO's.. texure coordinates and color in 1st VBO and position and normal in 2nd VBO (because of software skinning).
One more question... Is below code have same funcionality:
BindBufferARB(ARRAY_BUFFER_ARB, vbo1);
VertexPointer(4, FLOAT, 0, BUFFER_OFFSET(0));
BindBufferARB(ARRAY_BUFFER_ARB, vbo2);
ColorPointer(4, UNSIGNED_BYTE, 0, BUFFER_OFFSET(256));
// Enable arrays
EnableClientState(VERTEX_ARRAY);
EnableClientState(COLOR_ARRAY);
// draw code
and
BindBufferARB(ARRAY_BUFFER_ARB, vbo1);
VertexPointer(4, FLOAT, 0, BUFFER_OFFSET(0));
EnableClientState(VERTEX_ARRAY);
BindBufferARB(ARRAY_BUFFER_ARB, vbo2);
ColorPointer(4, UNSIGNED_BYTE, 0, BUFFER_OFFSET(256));
EnableClientState(COLOR_ARRAY);
// draw code
- Create VBO and fill data
- bind and render -> OK
- bind and update data -> OK
- bind and render -> OK
- bind and update data -> crash in driver
It crashes no matter what I tried to do.. glBufferSubData or glMapBuffer + memcpy. glMapBuffer returns valid pointer and app crash even if I write only one byte to VBO memory. There is no buffer overrun.
ATM.. I disabled VBO when app run on Intel gfx and use good-old vertex arrays.
I found VBO examples on internet which correctly maps VBO's and update data and it work on Intel too.
Only difference between that sample and my app is that I use two VBO's.. texure coordinates and color in 1st VBO and position and normal in 2nd VBO (because of software skinning).
One more question... Is below code have same funcionality:
BindBufferARB(ARRAY_BUFFER_ARB, vbo1);
VertexPointer(4, FLOAT, 0, BUFFER_OFFSET(0));
BindBufferARB(ARRAY_BUFFER_ARB, vbo2);
ColorPointer(4, UNSIGNED_BYTE, 0, BUFFER_OFFSET(256));
// Enable arrays
EnableClientState(VERTEX_ARRAY);
EnableClientState(COLOR_ARRAY);
// draw code
and
BindBufferARB(ARRAY_BUFFER_ARB, vbo1);
VertexPointer(4, FLOAT, 0, BUFFER_OFFSET(0));
EnableClientState(VERTEX_ARRAY);
BindBufferARB(ARRAY_BUFFER_ARB, vbo2);
ColorPointer(4, UNSIGNED_BYTE, 0, BUFFER_OFFSET(256));
EnableClientState(COLOR_ARRAY);
// draw code