llvmpipe: align the array used for subdivived vertices
authorZack Rusin <zackr@vmware.com>
Mon, 23 Sep 2013 21:29:39 +0000 (17:29 -0400)
committerZack Rusin <zackr@vmware.com>
Mon, 23 Sep 2013 22:10:51 +0000 (18:10 -0400)
When subdiving a triangle we're using a temporary array to store
the new coordinates for the subdivided triangles. Unfortunately
the array used for that was not aligned properly causing
random crashes in the llvm jit code which was trying to load
vectors from it.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/drivers/llvmpipe/lp_setup_tri.c

index 8b0fcd09e5aaebc4a39dc5c84992ecefe0d79616..cf67f29f0e34bebe8685e4a52f394f507eb14dc6 100644 (file)
@@ -909,7 +909,7 @@ subdiv_tri(struct lp_setup_context *setup,
    unsigned n = setup->fs.current.variant->shader->info.base.num_inputs + 1;
    const struct lp_shader_input *inputs =
       setup->fs.current.variant->shader->inputs;
-   float vmid[PIPE_MAX_ATTRIBS][4];
+   PIPE_ALIGN_VAR(LP_MIN_VECTOR_ALIGN) float vmid[PIPE_MAX_ATTRIBS][4];
    const float (*vm)[4] = (const float (*)[4]) vmid;
    unsigned i;
    float w0, w1, wm;