Original Post
Hi guys, got a question again :). The title can be a bit confusing, so I'll explain what I'm trying to do. I've got one VB, which I use as two different ones. The first is for rendering normal primitives, and the other is for the alphablended ones. Now, What I do, is lock the first half of the buffer (D3DLOCK_DISCARD|D3DLOCK_NOOVERWRITE, of course), memcpy, and then render the whole thing. Next, supposedly while the GPU is still rendering, I lock the second half (again, D3DLOCK_DISCARD|D3DLOCK_NOOVERWRITE), memcpy and then render. Now, From what I know, if I'm using the two flags, I'm not causing a GPU stall, so I do the memcpy while the GPU is doing the actual drawing of the first batch. This all seems logical and efficient, but like I said, I need to change a renderstate. Now, IIRC, that does cause a GPU stall. So, in reality, I end up waiting for the GPU to finish drawing anyways. I also don't know when to call the renderstate. Heres my current sequence, looking for ideas :): 1) Lock first half. 2) Render first half. 3) SetRenderState. 4) Lock second half. 5) Render second half. I intend to profile the whole thing once my codebase is stable enough (too many factors now), but is the SetRenderState going to be a problem? any ways around it? Thanks a bunch.