Am Donnerstag, 20. März 2008 15:26:07 schrieb H. Verbeet:
On 20/03/2008, Stefan Dösinger stefan@codeweavers.com wrote:
On IRC I think you once mentioned making the shader backend an object, and since we don't have a C++ compiler anyway I concluded COM. (That was a
In essence an object is just a call table with some data, you don't really need a C++ compiler for that. (And that specific discussion was about moving the private data of the shader backend out of the device and into the backend itself). COM would add a lot of stuff that we don't really need.
Agreed. However, I'd rather use COM and have a few simple IUnknown methods hanging around that are not used instead of inventing yet another way to implement object to keep the code more readable. COM is a well-known scheme, so it will keep the code more understandable.
If we use COM and make the state table a per-shader-backend property I'd shadow the pointer in the device though, to avoid an extra function call in each MarkStateDirty call.