[PATCH v2 1/2] winevulkan: Manually fixup struct alignment for VkPipelineCreationFeedback.

Zebediah Figura zfigura at codeweavers.com
Wed Feb 9 11:07:59 CST 2022


On 2/9/22 10:39, Georg Lehmann wrote:
> We can't reasonably auto generate this because it's output in an
> otherwise input pNext chain.

Aren't we going to need to do that anyway, though, for many other 
functions, for wow64 support?

It seems like it'd be more worthwhile to add infrastructure for 
automatically generating this, or at least some of it.

> +static void fixup_pipeline_feedback(VkPipelineCreationFeedback *feedback, uint32_t count)
> +{
> +#if defined(USE_STRUCT_CONVERSION)
> +    struct host_pipeline_feedback
> +    {
> +        VkPipelineCreationFeedbackFlags flags;
> +        uint64_t duration;
> +    } *host_feedback;
> +    int64_t i;
> +
> +    host_feedback = (void *) feedback;
> +
> +    for (i = count - 1; i >= 0; i--)
> +    {
> +        memmove(&feedback[i].duration, &host_feedback[i].duration, sizeof(uint64_t));

Do we need memmove() here?

> +        feedback[i].flags = host_feedback[i].flags;
> +    }
> +#else
> +    (void)feedback;
> +    (void)count;

This is unnecessary; we don't use -Wunused-parameter.



More information about the wine-devel mailing list