[09/23] wined3d: Fix mapping of SV_VertexID to gl_VertexID.
Matteo Bruni
matteo.mystral at gmail.com
Sun Nov 13 16:41:08 CST 2016
2016-11-13 12:35 GMT-06:00 Andrew Wesie <awesie at gmail.com>:
> SV_VertexID does not have base vertex index applied, but gl_VertexID
> does. Fix the vertex ID by subtracting a uniform that is set to the
> base vertex index before each draw.
>
> Signed-off-by: Andrew Wesie <awesie at gmail.com>
> ---
> dlls/wined3d/cs.c | 2 +-
> dlls/wined3d/device.c | 6 +++++-
> dlls/wined3d/glsl_shader.c | 13 ++++++++++++-
> dlls/wined3d/state.c | 7 ++++++-
> dlls/wined3d/wined3d_private.h | 1 +
> 5 files changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
> index 7af0b81..e71c873 100644
> --- a/dlls/wined3d/cs.c
> +++ b/dlls/wined3d/cs.c
> @@ -481,7 +481,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
>
> op = cs->ops->require_space(cs, sizeof(*op));
> op->opcode = WINED3D_CS_OP_DRAW;
> - op->base_vertex_idx = base_vertex_idx;
> + op->base_vertex_idx = indexed ? base_vertex_idx : 0;
> op->start_idx = start_idx;
> op->index_count = index_count;
> op->start_instance = start_instance;
This should probably be a separate patch.
Otherwise it seems good to me.
More information about the wine-devel
mailing list