On Wed Feb 7 15:12:32 2024 +0000, Matteo Bruni wrote:
I don't want to get in the way... but I think this not the way to go. Mostly because using WIC to load generic DDS files is not what native does, or what our d3dx9 does. So instead of doubling down on our current questionable design, we might want to take the occasion to fix it. Ideally we should probably reuse code from d3dx9_36/surface.c:load_surface_from_dds() / D3DXLoadSurfaceFromMemory() (e.g. via PARENTSRC) and eventually phase out d3dx10 WIC DDS loading code. One problem is that these functions are currently tied to d3d[x]9 types (IDirect3DSurface9 most notably) so they can't really be used from d3dx10 in their current form. I'd move the meat of D3DXLoadSurfaceFromMemory() to a helper function (which is probably not a terrible idea regardless), eschewing d3d9-isms from it, and call this new helper from d3dx10. I haven't explored this idea thoroughly, so there might certainly be issues I'm overlooking. Hopefully I'll be able to have a better look soon and at least sketch something, if you don't feel like taking it head-on (which would be a perfectly reasonable reaction :slight_smile:)
That's fair, I had read a comment somewhere where you had mentioned wanting to get away from using WIC which is why I didn't fully flesh this out.
I will explore the idea you're describing and see what I can do, thanks for the feedback. :)