[PATCH vkd3d v2 4/4] vkd3d: Move atomic descriptor operations behind a config option.

Henri Verbeet hverbeet at gmail.com
Wed Dec 15 12:17:55 CST 2021


On Wed, 8 Dec 2021 at 16:01, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
> Atomic descriptor writes and copies were implemented for Shadow of
> the Tomb Raider, which now has a Linux version. Since the bug
> resulted from a race condition in the game, it's probably not
> common and atomic ops can be made optional. Atomic ops are a
> significant drag on performance of games which copy large numbers
> of descriptors per frame, e.g. Control.
>
A couple of considerations:

  - Like for some of the other patches in this series, numbers would be helpful.

  - We generally try to default to the correct behaviour, and make
trading performance for correctness optional. I.e., if we were to have
this kind of option, it would default to being enabled.

  - Is the actual issue here the number of calls to
pthread_mutex_lock(), particularly when called from
d3d12_device_CopyDescriptors()? Or is something else going on here? In
case of the former, we could perhaps mitigate that by doing moving
those calls outside of the loops in d3d12_device_CopyDescriptors().

> @@ -1207,6 +1211,12 @@ struct d3d12_device
>      const struct vkd3d_format_compatibility_list *format_compatibility_lists;
>      struct vkd3d_null_resources null_resources;
>      struct vkd3d_uav_clear_state uav_clear_state;
> +
> +    void (*descriptor_copy)(struct d3d12_desc *dst, const struct d3d12_desc *src, struct d3d12_device *device);
> +    void (*descriptor_write)(struct d3d12_desc *dst, const struct d3d12_desc *src, struct d3d12_device *device);
> +    void (*descriptor_vk_heap_write)(struct d3d12_desc *dst, const struct d3d12_desc *src,
> +            struct d3d12_device *device);
> +    bool atomic_desc_ops;
>  };
>
The "descriptor_vk_heap_write" callback appears to be unused in this patch.



More information about the wine-devel mailing list