Skip to main content
GameDev.net gamedev.net
🔒 Locked

IndexBuffer AccessViolationException

Started by _Flecko Mar 20, 2005 at 12:24 AM 0 replies 800+ views
Original Post
_Flecko
_Flecko
I'm testing a C# game on an older machine, and it keeps running into an AccessViolationException during calls to Device.DrawIndexedPrimitives(). It's inconsistent about it: sometimes it will work, other times it will fail with the same data. It seems to fail more often with larger sets of data. The code is nothing fancy - I'd post a snippet, but I tried to create the bug in a clean project on the same system and couldn't, so the ultimate source of the problem is somewhere in this massive project and I have no clue where. I know that's not much help, but if anybody has run into this before or knows common reasons why this might happen, I'd appreciate whatever help I could get. (I should note, I've already checked a few standard things: that the device is set to the right vertex format, that I'm using 16-bit indices, that I've provided all the right vertex, index, and primitive counts to the buffers and draw method). Thanks
--------------Trans2D - 2D library for C# / Managed DirectX
rKallmeyer
rKallmeyer
Obviously not positive, but it sounds like an incorrect number of vertices being passed to draw index primitive.

I had the same problem a while ago, and it was driving me crazy because it didn't always happen. Because I had sometimes rendered large amounts of vertices before the call to DrawIndexedPrimitive(), I wasn't always getting an access violation because there was data left over from a previous call.

Hope that helps.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.