I've spent the past few days struggling to gracefully remove the legacy refresh code without disrupting things too much, but without success I'm afraid. In the end I had to fairly brutally gut the thing, and I'm now in the process of bringing it back up.
It's looking as though the multi-threaded path is going to have to go. I haven't dug too far into this yet, but it seems as though there is a wild pointer bug being thrown up by it, and I'm getting a 50/50 chance of a hard crash every time I start DirectQ. I'll probably put it down for future investigation in more detail; as I had noted in my original post it was a bit unexpected that it happened as soon as it did.
Things have collapsed to quite a rough and ready state as a result of all this, but I'm finally satisfied that at least the basic structure is moving in the right direction now and that I'll be able to pull it together more easily with the legacy stuff gone. I do need to sort out my data storage though as right now I'm pushing surfaces through a lot of intermediate buffers. Something like doing a batch allocation of all vertexes in a brushmodel pre-sorted by texture and lightmap, then storing indexes in the surf itself sounds about right.
One good thing did happen which was that I successfully reintegrated two separate alias model renderers I had built up - one for batches and the other for individual models. It's nice to have a single path for both types here.
I've also ripped out a lot of my legacy matrix code, and hope to be able to completely drop my matrix classes before too long. They were fine when things were set up the old way, but getting them to integrate with the new way was proving troublesome.
Whoever designed the D3D matrix API must have done so in the same crack den that Carmack came up with the idea for instanced brush models in (although he at least backed away from it afterwards), and probably deserves a good slap in the face for it. The fact that there are no matrix handling API calls in basic D3D at all is quite shocking. D3DX has them, but it uses it's own variant of the matrix struct and you can't mix the two seamlessly (although the data does line up). I'm just going to put them into a union and see what happens.
Thursday, January 7, 2010
1.8 Latest Update
Posted by
mhquake
at
1:50 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment