On Wed Jun 15 11:56:53 2022 +0000, Piotr Caban wrote:
The helper will return array of structures in future (it's needed to e.g. support MipLevels). That's why I would prefer to do it in one of following ways. Return array of D3D10_SUBRESOURCE_DATA structures with data following the structures:
- can be freed with single free
- it would be possible to sometimes pass loaded data directly without
creating a copy (I was not planning to do that)
- it's harder to create
Return array of D3D10_SUBRESOURCE_DATA structures with each pSysMem fields allocated separately. Do you have any preference?
If I understand correctly, basically either (pseudocode): ``` struct texture_data { unsigned int subresource_count; D3D10_SUBRESOURCE_DATA subresource_data[]; BYTE data[]; }; ``` or ``` struct texture_data { unsigned int subresource_count; struct { D3D10_SUBRESOURCE_DATA subresource_data; } subresources[]; BYTE *data[]; }; ``` I think I very slightly prefer the first option if it doesn't turn out unreasonably complicated. Both are fine for sure.