[PATCH 2/2] wined3d: Pass a wined3d_device pointer to wined3d_from_cs().
Zebediah Figura (she/her)
zfigura at codeweavers.com
Fri Jul 2 10:55:50 CDT 2021
On 7/2/21 8:48 AM, Henri Verbeet wrote:
> On Fri, 2 Jul 2021 at 00:35, Zebediah Figura <z.figura12 at gmail.com> wrote:
>> static BOOL wined3d_cs_queue_is_empty(const struct wined3d_cs *cs, const struct wined3d_cs_queue *queue)
>> {
>> - wined3d_from_cs(cs);
>> + wined3d_from_cs(cs->c.device);
>> return *(volatile LONG *)&queue->head == queue->tail;
>> }
> This introduces a race though. If wined3d_cs_run() gets to
> wined3d_cs_queue_is_empty() before wined3d_device_init() gets to the
> "device->cs" assignment, wined3d_from_cs() will dereference a NULL
> "device->cs".
>
Indeed. Maybe this assertion should just be removed; it's a little
aggressive for a function that's only called from directly inside
wined3d_cs_run()...
More information about the wine-devel
mailing list