ac/nir: to integer the args to bcsel.
authorDave Airlie <airlied@redhat.com>
Tue, 20 Feb 2018 00:15:18 +0000 (10:15 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 20 Feb 2018 23:15:18 +0000 (23:15 +0000)
dEQP-VK.tessellation.invariance.outer_edge_symmetry.triangles_equal_spacing_ccw
was hitting an llvm assert due to one value being an int and the
other a float.

This just casts both values to integer and fixes the test.

Fixes: dEQP-VK.tessellation.invariance.outer_edge_symmetry.triangles_equal_spacing_ccw
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 12f097e2b2633d5de1920f0b3cbbccff35e5e3ca..2185c53834c3c20cc15825b1840254e15468d2e5 100644 (file)
@@ -1314,7 +1314,8 @@ static LLVMValueRef emit_bcsel(struct ac_llvm_context *ctx,
 {
        LLVMValueRef v = LLVMBuildICmp(ctx->builder, LLVMIntNE, src0,
                                       ctx->i32_0, "");
-       return LLVMBuildSelect(ctx->builder, v, src1, src2, "");
+       return LLVMBuildSelect(ctx->builder, v, ac_to_integer(ctx, src1),
+                              ac_to_integer(ctx, src2), "");
 }
 
 static LLVMValueRef emit_minmax_int(struct ac_llvm_context *ctx,