• Józef Kucia's avatar
    wined3d: Fix mapping of SV_VertexID to gl_VertexID. · 60d9211f
    Józef Kucia authored
    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: 's avatarJózef Kucia <jkucia@codeweavers.com>
    Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com>
    Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
    60d9211f
Name
Last commit
Last update
dlls Loading commit data...
documentation Loading commit data...
fonts Loading commit data...
include Loading commit data...
libs Loading commit data...
loader Loading commit data...
po Loading commit data...
programs Loading commit data...
server Loading commit data...
tools Loading commit data...
.mailmap Loading commit data...
ANNOUNCE Loading commit data...
AUTHORS Loading commit data...
COPYING.LIB Loading commit data...
LICENSE Loading commit data...
LICENSE.OLD Loading commit data...
MAINTAINERS Loading commit data...
Makefile.in Loading commit data...
README Loading commit data...
VERSION Loading commit data...
aclocal.m4 Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...