Commit 4d345a78 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Implement zero step rate for instanced attributes.

parent 1eff85d2
......@@ -238,16 +238,17 @@ void wined3d_stream_info_from_declaration(struct wined3d_stream_info *stream_inf
if (stream->flags & WINED3DSTREAMSOURCE_INSTANCEDATA)
{
stream_info->elements[idx].divisor = 1;
stream_info->elements[idx].instanced = true;
}
else if (element->input_slot_class == WINED3D_INPUT_PER_INSTANCE_DATA)
{
stream_info->elements[idx].divisor = element->instance_data_step_rate;
if (!element->instance_data_step_rate)
FIXME("Instance step rate 0 not implemented.\n");
stream_info->elements[idx].instanced = true;
}
else
{
stream_info->elements[idx].divisor = 0;
stream_info->elements[idx].instanced = false;
}
if (!d3d_info->vertex_bgra && element->format->id == WINED3DFMT_B8G8R8A8_UNORM)
......
......@@ -5378,7 +5378,11 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c
if (gl_info->supported[ARB_INSTANCED_ARRAYS])
{
GL_EXTCALL(glVertexAttribDivisor(i, element->divisor));
unsigned int divisor = 0;
if (element->instanced)
divisor = element->divisor ? element->divisor : UINT_MAX;
GL_EXTCALL(glVertexAttribDivisor(i, divisor));
}
else if (element->divisor)
{
......
......@@ -2061,9 +2061,9 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
b = &key->bindings[binding_count++];
b->binding = binding;
b->stride = e->stride;
b->inputRate = e->divisor ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX;
b->inputRate = e->instanced ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX;
if (e->divisor > 1)
if (e->instanced)
{
d = &key->divisors[divisor_count++];
d->binding = binding;
......
......@@ -1665,6 +1665,7 @@ struct wined3d_stream_info_element
GLsizei stride;
unsigned int stream_idx;
unsigned int divisor;
bool instanced;
};
struct wined3d_stream_info
......
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