Skip to main content
added 104 characters in body
Source Link
Krienie
  • 221
  • 1
  • 3

What you can do is use multiple vertex buffers for the chunks. When you call the map function, you deny gpu access to that resource, so the gpu must wait for you to be done with the buffer before it can use it again (see link). If you have multiple vertex buffers, say one for filling and one for rendering, the gpu does not have to wait and this might reduce your lag. Think it as the front- and back buffer approach most render systems use to render the result to the screen. One buffer is used for drawing and one is used for displaying, so you don't see the frame being drawn. I think the same approach could help you reduce or even remove the lag spike.

EDIT: my bad, I see now that you use the lock method instead.. You can still give it a try though...

What you can do is use multiple vertex buffers for the chunks. When you call the map function, you deny gpu access to that resource, so the gpu must wait for you to be done with the buffer before it can use it again (see link). If you have multiple vertex buffers, say one for filling and one for rendering, the gpu does not have to wait and this might reduce your lag. Think it as the front- and back buffer approach most render systems use to render the result to the screen. One buffer is used for drawing and one is used for displaying, so you don't see the frame being drawn. I think the same approach could help you reduce or even remove the lag spike.

What you can do is use multiple vertex buffers for the chunks. When you call the map function, you deny gpu access to that resource, so the gpu must wait for you to be done with the buffer before it can use it again (see link). If you have multiple vertex buffers, say one for filling and one for rendering, the gpu does not have to wait and this might reduce your lag. Think it as the front- and back buffer approach most render systems use to render the result to the screen. One buffer is used for drawing and one is used for displaying, so you don't see the frame being drawn. I think the same approach could help you reduce or even remove the lag spike.

EDIT: my bad, I see now that you use the lock method instead.. You can still give it a try though...

Source Link
Krienie
  • 221
  • 1
  • 3

What you can do is use multiple vertex buffers for the chunks. When you call the map function, you deny gpu access to that resource, so the gpu must wait for you to be done with the buffer before it can use it again (see link). If you have multiple vertex buffers, say one for filling and one for rendering, the gpu does not have to wait and this might reduce your lag. Think it as the front- and back buffer approach most render systems use to render the result to the screen. One buffer is used for drawing and one is used for displaying, so you don't see the frame being drawn. I think the same approach could help you reduce or even remove the lag spike.