diff options
author | Pekka Paalanen <[email protected]> | 2008-11-09 00:58:19 +0200 |
---|---|---|
committer | Pekka Paalanen <[email protected]> | 2008-11-09 00:58:19 +0200 |
commit | 72ae2bd85624ae994709c0c4b5e0933002c61854 (patch) | |
tree | efeb3786426d7a8285c3950e092bbf250d3755a0 | |
parent | 903ae9d04eb7d0066c4ba1e30acb44630ca129f4 (diff) |
Nouveau: fix nv20_vertex_layout()
The function should update nv20->vertex_info, and not just a
local struct that's thrown away immediately.
Fixes a SIGFPE due to vbuf->vertex_size = 0 in vbuf_alloc_vertices().
Signed-off-by: Pekka Paalanen <[email protected]>
-rw-r--r-- | src/gallium/drivers/nv20/nv20_state_emit.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/nv20/nv20_state_emit.c b/src/gallium/drivers/nv20/nv20_state_emit.c index 23029433f3f..e8dd22925c4 100644 --- a/src/gallium/drivers/nv20/nv20_state_emit.c +++ b/src/gallium/drivers/nv20/nv20_state_emit.c @@ -168,28 +168,28 @@ static void nv20_vertex_layout(struct nv20_context *nv20) struct nv20_fragment_program *fp = nv20->fragprog.current; uint32_t src = 0; int i; - struct vertex_info vinfo; + struct vertex_info *vinfo = &nv20->vertex_info; - memset(&vinfo, 0, sizeof(vinfo)); + memset(vinfo, 0, sizeof(*vinfo)); for (i = 0; i < fp->info.num_inputs; i++) { switch (fp->info.input_semantic_name[i]) { case TGSI_SEMANTIC_POSITION: - draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_LINEAR, src++); + draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_LINEAR, src++); break; case TGSI_SEMANTIC_COLOR: - draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_LINEAR, src++); + draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_LINEAR, src++); break; default: case TGSI_SEMANTIC_GENERIC: - draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE, src++); + draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, src++); break; case TGSI_SEMANTIC_FOG: - draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE, src++); + draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, src++); break; } } - draw_compute_vertex_size(&vinfo); + draw_compute_vertex_size(vinfo); } void |