glMapBufferRange always returns 0
I'm using an Nvidia 260(vista 64 driver version 182.47) which is supposed to support this function(and it does find the extention & link correctly), but whenever I call it it returns null. glGetError returns 1281(invalid value?), I've tried pretty much every possible value in the bitfield, but it is always the same results...
Using GLee 5.4, which seems kinda buggy since it originally thought glMapBufferRange returned a void instead of a void*, I made the necessary changes so it should work..
I bind the buffer, check glGetError, it returns 0,call glMapBufferRange(returns 0),check glGetError, it returns 1281...
I dropped the MapBufferRange call into a location where a glMapBuffer call used to be, and it is functionally performing the exact same thing, so I know the surrounding code works.
Here is what I'm doing:
if(m_nMaxVerts < nVerts)
m_ChunkVerts.SetData(BufferMode::VERTICES, (nVerts*sizeof(march::ChunkVertex)),vertData,Buffe rUsage:YNAMIC_DRAW);
m_nMaxVerts = nVerts;
//void* verts = m_ChunkVerts.MapDiscard( BufferMode::VERTICES,
// BufferAccess::WRITE,nVerts*sizeof(march::ChunkVert ex),BufferUsage:YNAMIC_DRAW);
void* verts = m_ChunkVerts.MapRange(BufferMode::VERTICES,
0,nVerts*sizeof(march::ChunkVertex),GL_MAP_UNSYNCH RONIZED_BIT |GL_MAP_WRITE_BIT|GL_MAP_INVALIDATE_RANGE_BIT );
Internally MapRange just does this:
return glMapBufferRange(mode,OffsetInBytes,nBytes,access_ bitField);
Anyone have any ideas? Or is there something wrong with Nvidia's implementation on this driver?