amd/common: fix loading InstanceID for tess on < GFX9
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 11 Jan 2018 13:56:07 +0000 (14:56 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 15 Jan 2018 10:59:16 +0000 (11:59 +0100)
InstanceID is in VGPR2, not 1.

One more failure that CTS didn't catch up...

Reported-by: Alex Smith <asmith@feralinteractive.com>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index cf7035edf1c3426a77376a3946290978410567ca..d4c24342d7b7b73cdfc73699b116ae8a6ac0faea 100644 (file)
@@ -6743,8 +6743,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
                        ctx.abi.load_patch_vertices_in = load_patch_vertices_in;
                } else if (shaders[i]->info.stage == MESA_SHADER_VERTEX) {
                        if (shader_info->info.vs.needs_instance_id) {
-                               if (ctx.ac.chip_class == GFX9 &&
-                                   shaders[shader_count - 1]->info.stage == MESA_SHADER_TESS_CTRL) {
+                               if (ctx.options->key.vs.as_ls) {
                                        ctx.shader_info->vs.vgpr_comp_cnt =
                                                MAX2(2, ctx.shader_info->vs.vgpr_comp_cnt);
                                } else {