[PATCH vkd3d 2/5] tests: Move the drawing and readback implementation to the d3d12 shader runner.

Henri Verbeet hverbeet at gmail.com
Fri Jan 14 11:11:07 CST 2022


On Tue, 11 Jan 2022 at 19:17, Zebediah Figura <zfigura at codeweavers.com> wrote:
> +struct texture
> +{
> +    unsigned int slot;
> +
> +    DXGI_FORMAT format;
> +    enum texture_data_type data_type;
> +    unsigned int texel_size;
> +    unsigned int width, height;
> +    uint8_t *data;
> +    size_t data_size, data_capacity;
> +
> +    void *private;
> +};
> +
We've used private pointers like that in the past in some cases, and
we've generally moved away from them because void pointers just aren't
great to work with. I'd much prefer a scheme like the following:

    struct texture
    {
        ...
    };

    struct d3d11_texture
    {
        struct texture t;
        ...
    };

    struct d3d12_texture
    {
        struct texture t;
        ...
    };

and then using CONTAINING_RECORD to get e.g. a struct d3d12_texture
pointer from a struct texture pointer, much like we do in various
other places.



More information about the wine-devel mailing list