Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

GPU Crashes with DrawIndexedPrimitives

4: Adsense

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   

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.


#2 unbird   Members   

8307
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   

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.