summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2016-10-12 00:00:28 +0200
committerRoland Scheidegger <[email protected]>2016-10-12 15:05:44 +0200
commit7e86b2ddae32fc86fc684a0dcf32a87a0d795267 (patch)
tree23f168ff04f5b73cb925bae80a075139498e4568
parentcfbf956dfd0ea093135cd4864bf3b5b7508a54b6 (diff)
draw: initialize shader inputs
This should make the code more robust if a shader tries to use inputs which aren't defined by the vertex element layout (which usually shouldn't happen). No piglit change. Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 87951fa165d..4270a8fb7a8 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -1705,6 +1705,13 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
lp_build_printf(gallivm, " --- io %d = %p, loop counter %d\n",
io_itr, io, lp_loop.counter);
#endif
+
+ for (j = draw->pt.nr_vertex_elements; j < PIPE_MAX_SHADER_INPUTS; j++) {
+ for (i = 0; i < TGSI_NUM_CHANNELS; i++) {
+ inputs[j][i] = lp_build_zero(gallivm, vs_type);
+ }
+ }
+
for (i = 0; i < vector_length; ++i) {
LLVMValueRef vert_index =
LLVMBuildAdd(builder,