On Thu Jul 18 17:41:30 2024 +0000, Matteo Bruni wrote:
I'm a bit torn by this swapping of the layer and level loops. With this we "fight" how the data is actually stored in DDS files, instead of just copying data out sequentially. We do get to avoid a bunch of otherwise redundant `GetLevelDesc()` + `SetRect()` calls though. How would this look for d3dx10/11?
Well, in a way we already have to fight it a bit due to the potential for skipping mip levels, which is possible in d3dx10/11 as well.
In theory I guess we could get the address of the first mip level for each layer, then do the dimension calculations/image pointer offsetting ourselves in the loop. For d3dx10/11 we do have to calculate the mip level sizes ourselves since d3d10/d3d11 has no equivalent to `GetLevelDesc()`.
I feel like the way it is now is visually cleaner, but probably less performant. If you'd prefer it to be closer to the way we'll end up doing it in d3dx10/d3dx11 I can do that.