Mesa (master): llvmpipe: align the array used for subdivived vertices

Zack Rusin zack at kemper.freedesktop.org
Mon Sep 23 22:34:12 UTC 2013


Module: Mesa
Branch: master
Commit: e5ec5aef2be4d667a1f28f0ee0105dd6dc204732
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e5ec5aef2be4d667a1f28f0ee0105dd6dc204732

Author: Zack Rusin <zackr at vmware.com>
Date:   Mon Sep 23 17:29:39 2013 -0400

llvmpipe: align the array used for subdivived vertices

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 at vmware.com>
Reviewed-by: Roland Scheidegger <sroland at vmware.com>

---

 src/gallium/drivers/llvmpipe/lp_setup_tri.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 8b0fcd0..cf67f29 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -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;




More information about the mesa-commit mailing list