Commit 4a2cebad authored by Davide Beatrici's avatar Davide Beatrici Committed by Alexandre Julliard

wined3d: Fix uninitialized variable warning.

dlls/wined3d/context_vk.c:2377:42: warning: ‘null_binding’ may be used uninitialized in this function [-Wmaybe-uninitialized] 2377 | *null_buffer_binding = b->binding = null_binding; | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
parent 9ffeb262
......@@ -244,6 +244,22 @@ static VkStencilOp vk_stencil_op_from_wined3d(enum wined3d_stencil_op op)
}
}
static bool wined3d_get_unused_stream_index(const struct wined3d_state *state, uint32_t *index)
{
uint32_t i;
for (i = 0; i < ARRAY_SIZE(state->streams); ++i)
{
if (!state->streams[i].buffer)
{
*index = i;
return true;
}
}
return false;
}
static void wined3d_allocator_chunk_vk_lock(struct wined3d_allocator_chunk_vk *chunk_vk)
{
wined3d_device_vk_allocator_lock(wined3d_device_vk_from_allocator(chunk_vk->c.allocator));
......@@ -2339,16 +2355,7 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
struct wined3d_shader_signature *signature;
uint32_t null_binding, location;
for (i = 0; i < ARRAY_SIZE(state->streams); ++i)
{
if (!state->streams[i].buffer)
{
null_binding = i;
break;
}
}
if (i == ARRAY_SIZE(state->streams))
if (!wined3d_get_unused_stream_index(state, &null_binding))
{
ERR("No streams left for a null buffer binding.\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment