mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-common: Use vkd3d_atomic_increment_u32() in get_buffer().
This commit is contained in:
parent
03fbf4a3dc
commit
5fe3c624d5
Notes:
Alexandre Julliard
2024-01-18 23:21:43 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/576
@ -126,10 +126,10 @@ void vkd3d_dbg_set_log_callback(PFN_vkd3d_log callback)
|
|||||||
static char *get_buffer(void)
|
static char *get_buffer(void)
|
||||||
{
|
{
|
||||||
static char buffers[VKD3D_DEBUG_BUFFER_COUNT][VKD3D_DEBUG_BUFFER_SIZE];
|
static char buffers[VKD3D_DEBUG_BUFFER_COUNT][VKD3D_DEBUG_BUFFER_SIZE];
|
||||||
static LONG buffer_index;
|
static unsigned int buffer_index;
|
||||||
LONG current_index;
|
unsigned int current_index;
|
||||||
|
|
||||||
current_index = InterlockedIncrement(&buffer_index) % ARRAY_SIZE(buffers);
|
current_index = vkd3d_atomic_increment_u32(&buffer_index) % ARRAY_SIZE(buffers);
|
||||||
return buffers[current_index];
|
return buffers[current_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user