radv: fix radv_fixup_vertex_input_fetches()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 14 Feb 2019 08:43:36 +0000 (09:43 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 14 Feb 2019 08:44:35 +0000 (09:44 +0100)
We should check that num_channels is 4, otherwise that breaks
the world. Sorry for the short breakage.

Fixes: 4b3549c0846 ("radv: reduce the number of loaded channels for vertex input fetches")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_nir_to_llvm.c

index 08ab64971ab775abb39bf1c519dd6314095e4b21..f1fc392292ada103cf7aad2b91797d85a3a78f34 100644 (file)
@@ -2072,7 +2072,7 @@ radv_fixup_vertex_input_fetches(struct radv_shader_context *ctx,
        if (LLVMGetTypeKind(LLVMTypeOf(value)) == LLVMVectorTypeKind) {
                unsigned vec_size = LLVMGetVectorSize(LLVMTypeOf(value));
 
-               if (num_channels == vec_size)
+               if (num_channels == 4 && num_channels == vec_size)
                        return value;
 
                num_channels = MIN2(num_channels, vec_size);