ac/nir: Add HS calling convention.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 16 Oct 2017 20:15:47 +0000 (22:15 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 19 Oct 2017 20:24:42 +0000 (22:24 +0200)
Needed for GFX9 merged shaders.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 3ba3ebf051e2bc7c82f22c71f8784fac10fb007b..1df97b59a2e2b1d62ce6cf7e252590b798bdb682 100644 (file)
@@ -39,6 +39,7 @@ enum radeon_llvm_calling_convention {
        RADEON_LLVM_AMDGPU_GS = 88,
        RADEON_LLVM_AMDGPU_PS = 89,
        RADEON_LLVM_AMDGPU_CS = 90,
+       RADEON_LLVM_AMDGPU_HS = 93,
 };
 
 #define CONST_ADDR_SPACE 2
@@ -223,13 +224,15 @@ static void set_llvm_calling_convention(LLVMValueRef func,
 
        switch (stage) {
        case MESA_SHADER_VERTEX:
-       case MESA_SHADER_TESS_CTRL:
        case MESA_SHADER_TESS_EVAL:
                calling_conv = RADEON_LLVM_AMDGPU_VS;
                break;
        case MESA_SHADER_GEOMETRY:
                calling_conv = RADEON_LLVM_AMDGPU_GS;
                break;
+       case MESA_SHADER_TESS_CTRL:
+               calling_conv = HAVE_LLVM >= 0x0500 ? RADEON_LLVM_AMDGPU_HS : RADEON_LLVM_AMDGPU_VS;
+               break;
        case MESA_SHADER_FRAGMENT:
                calling_conv = RADEON_LLVM_AMDGPU_PS;
                break;