Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


GPU Crashes with DrawIndexedPrimitives


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 LemonBiscuit   Members   -  Reputation: 147

Like
0Likes
Like

Posted 08 February 2014 - 12:25 PM

Hello,

 

I'm drawing a terrain in my game using DrawIndexedPrimitives with 262144 (512*512) vertices.

 

Here's the line:

GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, nVertices, 0, nIndices / 3);

The terrain draws well, but I tried to change the startIndex parameter, but my GPU starts to have problem at the rank 6139:

GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, nVertices, 6139, nIndices / 3);

Under 6139, everything is fine. At 6139 and above, I got some weird problems, I got messages saying the kernel of my GPU has crashed, etc.

 

I have an nVidia 9800GTX+.

 

I can't find a link between 6139 and any other variables in my code. Where could be the problem from?

 

Thank you!


Edited by LemonBiscuit, 08 February 2014 - 12:26 PM.


Sponsor:

#2 unbird   Crossbones+   -  Reputation: 5460

Like
0Likes
Like

Posted 08 February 2014 - 12:40 PM

You can't use a startIndex > 0 and use the same primitiveCount. If the index buffer isn't big enough I'm not surprised you get a crash (the driver probably now tries to read beyond allocated memory). This MSDN entry explains the underlying D3D9 logic for DrawIndexedPrimitive, especially have a look at scenario 3. So you need to decrease primitiveCount accordingly.

#3 LemonBiscuit   Members   -  Reputation: 147

Like
0Likes
Like

Posted 08 February 2014 - 01:17 PM

Thank you!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS