- if (instance_count) + if (instance_count && instance_count != 1)
I.e., "if (instance_count > 1)", right? Is drawing a single instance completely equivalent to a non-instanced draw?
Err, yes, that condition can definitely be simplified.
Good point about the difference between the two. I guess in general that can make a difference for instanced vertex attributes, so probably this patch is no good.
I should probably explain what prompted this patch in the first place, which is d3d9's DrawPrimitive(). It calls wined3d_device_context_draw() with an instance count of 1 and it has a comment explicitly mentioning how instancing is not a thing for non-indexed draws. FWIW, instance count seems to be specified as 0 for non-indexed draws in all the other d3d versions.
That means that every DrawPrimitive() call in d3d9 potentially prints this FIXME(). Is that proper, or should d3d9 pass 0 as instance_count for non-indexed draws? I'm not sure if the tests check this case (FWIW the d3d9 tests still pass with 0 instance_count). I can look further into it and add an appropriate testcase if needed.