• 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
..
Makefile.in Loading commit data...
adapter_gl.c Loading commit data...
arb_program_shader.c Loading commit data...
ati_fragment_shader.c Loading commit data...
buffer.c Loading commit data...
context.c Loading commit data...
cs.c Loading commit data...
device.c Loading commit data...
directx.c Loading commit data...
gl_compat.c Loading commit data...
glsl_shader.c Loading commit data...
nvidia_texture_shader.c Loading commit data...
palette.c Loading commit data...
query.c Loading commit data...
resource.c Loading commit data...
sampler.c Loading commit data...
shader.c Loading commit data...
shader_sm1.c Loading commit data...
shader_sm4.c Loading commit data...
state.c Loading commit data...
stateblock.c Loading commit data...
surface.c Loading commit data...
swapchain.c Loading commit data...
texture.c Loading commit data...
utils.c Loading commit data...
version.rc Loading commit data...
vertexdeclaration.c Loading commit data...
view.c Loading commit data...
wined3d.spec Loading commit data...
wined3d_gl.h Loading commit data...
wined3d_main.c Loading commit data...
wined3d_private.h Loading commit data...