Sign in to follow this  

[SlimDX] Failed to lock driver vertex buffer when loading models

Recommended Posts

I can't figure out why the app is having trouble locking the vertexbuffer. Here is my code snippet.

// is this necessary?
if (vertexBuffer != null)
if (!vertexBuffer.Disposed)
{ vertexBuffer.Dispose(); }

vertexBuffer = new VertexBuffer(Device, VertexPositionNormalTextureColorTangent.SizeInBytes * vertexCount, Usage.WriteOnly, SlimDX.Direct3D9.VertexFormat.None, Pool.Default);

[color="#FF0000"] DataStream dataStream = vertexBuffer.Lock(0, 0, LockFlags.None);[/color] // exception is raised while attempting to lock vertexbuffer
foreach (List<VertexPositionNormalTextureColor> vlist in verticesNmTxCollst)
foreach (VertexPositionNormalTextureColor vertex in vlist)


I have plenty of system memory available, this happens randomly when loading models. there are no d3d leaks or warnings showing.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this