[PATCH] wined3d: Fix the size parameter of glVertexAttrib*Pointer().

Guillaume Charifi guillaume.charifi at sfr.fr
Tue Jul 12 19:48:21 CDT 2016


The mistake is obvious when looking at the GL 3.0 spec:
  p29:
    void VertexAttribPointer(uint index, int size, enum type, boolean normalized, sizei stride, const void *pointer);
    void VertexAttribIPointer(uint index, int size, enum type, sizei stride, const void *pointer);

  p30:
    Command               Sizes
    VertexAttribPointer   1, 2, 3, 4
    VertexAttribIPointer  1, 2, 3, 4

Signed-off-by: Guillaume Charifi <guillaume.charifi at sfr.fr>
---
 dlls/wined3d/state.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 98e78da..21dd4d0 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4022,12 +4022,12 @@ static void load_numbered_arrays(struct wined3d_context *context,
             if (vs && vs->reg_maps.shader_version.major >= 4
                     && (element->format->flags[WINED3D_GL_RES_TYPE_BUFFER] & WINED3DFMT_FLAG_INTEGER))
             {
-                GL_EXTCALL(glVertexAttribIPointer(i, element->format->gl_vtx_format, element->format->gl_vtx_type,
+                GL_EXTCALL(glVertexAttribIPointer(i, element->format->component_count, element->format->gl_vtx_type,
                         element->stride, element->data.addr + state->load_base_vertex_index * element->stride));
             }
             else
             {
-                GL_EXTCALL(glVertexAttribPointer(i, element->format->gl_vtx_format, element->format->gl_vtx_type,
+                GL_EXTCALL(glVertexAttribPointer(i, element->format->component_count, element->format->gl_vtx_type,
                         element->format->gl_normalized, element->stride,
                         element->data.addr + state->load_base_vertex_index * element->stride));
             }
-- 
2.7.4




More information about the wine-patches mailing list