summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2012-06-15 14:02:31 +0100
committerJosé Fonseca <[email protected]>2012-06-18 12:06:23 +0100
commite48d26bf4065ed682f5d7bf81c368554aecebf43 (patch)
tree1fd41f0231c2e570d9a33ceea93d846863563b53 /src/gallium/auxiliary/draw
parent6e7756db14c362ede6fdc97454267a32b8eab1d4 (diff)
draw: Ensure that the vertex_header type size matches expectation.
This is failing sometimes, probably because TargetData keeps a structure layout cache, which can becomes bogus, ever since the InvalidateStructLayoutInfo API was removed in LLVM r135245. This change merely makes the problem easier to diagnose (an assertion failure instead of a random crash).
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 4058e1194b0..e1df2f1c267 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -305,6 +305,9 @@ create_jit_vertex_header(struct gallivm_state *gallivm, int data_elems)
target, vertex_header,
DRAW_JIT_VERTEX_DATA);
+ assert(LLVMABISizeOfType(target, vertex_header) ==
+ offsetof(struct vertex_header, data[data_elems]));
+
return vertex_header;
}