[PATCH v3 0/6] MR228: d3dx: improvements to texture creation functions

Matteo Bruni (@Mystral) wine at gitlab.winehq.org
Wed Jun 15 09:04:22 CDT 2022


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.

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/228#note_2109



More information about the wine-devel mailing list