radeonsi/gfx9: fix bad LLVM params in monolithic LS+HS
authorMarek Olšák <marek.olsak@amd.com>
Mon, 2 Apr 2018 19:06:42 +0000 (15:06 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 3 Apr 2018 15:07:28 +0000 (11:07 -0400)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index dd2969aa755c2240c416db563c9c8efb8c424953..60ca150c21171023801bf008a59159d941ff6da6 100644 (file)
@@ -6846,7 +6846,7 @@ int si_compile_tgsi_shader(struct si_screen *sscreen,
 
                        si_build_wrapper_function(&ctx,
                                                  parts + !vs_needs_prolog,
-                                                 4 - !vs_needs_prolog, 0,
+                                                 4 - !vs_needs_prolog, vs_needs_prolog,
                                                  vs_needs_prolog ? 2 : 1);
                } else {
                        LLVMValueRef parts[2];
@@ -6969,6 +6969,10 @@ int si_compile_tgsi_shader(struct si_screen *sscreen,
                        ac_count_scratch_private_memory(ctx.main_fn);
        }
 
+       /* Make sure the input is a pointer and not integer followed by inttoptr. */
+       assert(LLVMGetTypeKind(LLVMTypeOf(LLVMGetParam(ctx.main_fn, 0))) ==
+              LLVMPointerTypeKind);
+
        /* Compile to bytecode. */
        r = si_compile_llvm(sscreen, &shader->binary, &shader->config, tm,
                            ctx.gallivm.module, debug, ctx.type, "TGSI shader");