summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-02-15 14:14:03 +0100
committerSamuel Pitoiset <[email protected]>2019-02-16 15:33:18 +0100
commit52bdb043af952691b560118ca99e341527560e13 (patch)
tree01641fc4dc5f14dfc1bbe655e7a30cb2c35c494f /src/amd
parent7188e2ba1577fb6e4cf3cb07b73e3fd15950d635 (diff)
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: 4b3549c0846 ("radv: reduce the number of loaded channels for vertex input fetches") reported-by: Philip Rebohle <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/radv_nir_to_llvm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index b4b09c9fed6..ec11f6e729e 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -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);
}