Crash in writing to AGP/Video mem

I do get a crash at the 4:th time I fill the video mem allocated by wglAllocateMemoryNV. The memory is allocated once and not freed. I do reuse the allocated memory and copy data from CPU mem to that AGP mem.

I have flushed the memory by using FlushVertexArrayRangeNV before I refill the data …

What’s wrong ?

I do get the crash when I do…

  1. s_fastBuffer=(unsigned char *)wglAllocateMemoryNV(1048560,0,1,1);

// result 0x0bb80000

  1. glVertexArrayRangeNV(1048560,s_fastBuffer);

  2. memcpy(s_fastBuffer, vecBuffer, 786420);

whats wrong ?? I do get access violation in the memcpy (3) in writing to the allocated mem

Am i wrong, or isn’t it supposed to be wglAllocateMemoryNV(1048560, 0, 0, 1) ?!

Using 0, 1, 1 doesn’t sound safe, IMO.

Y.

My Mistake !!

I modified the s_fastBuffer from another thread…

Sorry :wink: