radv: fix invalid element type when filling vertex input default values

The elements added into a vector should have the same type as the
first one, otherwise this hits an assertion in LLVM.

Fixes: 4b3549c084 ("radv: reduce the number of loaded channels for vertex input fetches")
reported-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Samuel Pitoiset
2019-02-15 14:14:03 +01:00
parent 7188e2ba15
commit 52bdb043af
+3 -1
View File
@@ -2089,8 +2089,10 @@ radv_fixup_vertex_input_fetches(struct radv_shader_context *ctx,
elemtype = LLVMTypeOf(value);
}
for (unsigned i = num_channels; i < 4; i++)
for (unsigned i = num_channels; i < 4; i++) {
chan[i] = i == 3 ? one : zero;
chan[i] = ac_to_float(&ctx->ac, chan[i]);
}
return ac_build_gather_values(&ctx->ac, chan, 4);
}