wined3d: Fix mapping of SV_VertexID to gl_VertexID.
Based on a patch by Andrew Wesie.
In Direct3D, SV_VertexID generally starts from zero. In OpenGL,
gl_VertexID starts from "first" parameter passed to glDrawArrays(), or
from "baseVertex" parameter for indexed draw calls. The
GL_ARB_shader_draw_parameters extension doesn't help us much because
gl_BaseVertexARB is zero for non-indexed draw calls [1]. If
gl_BaseVertexARB would be equal to "first" for non-indexed draw calls,
we could simply use gl_VertexID - gl_BaseVertexARB.
After this commit, SV_VertexID is still wrong for indirect draw calls
because we cannot easily access the "first" field from struct
DrawArraysIndirectCommand in a vertex shader.
[1] - The ARB_shader_draw_parameters spec says that "In the case where
the command has no <baseVertex> parameter, the value of
<gl_BaseVertexARB> is zero."
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Showing
Please
register
or
sign in
to comment