radv: make use of has_ls_vgpr_init_bug
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 23 Aug 2019 06:55:53 +0000 (08:55 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 27 Aug 2019 06:04:51 +0000 (08:04 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_nir_to_llvm.c
src/amd/vulkan/radv_shader.c
src/amd/vulkan/radv_shader.h

index d58cc9613f8a9e691f3112a56efabe6be6084862..fbfe12da562826fbcd8c48b6cd07198c308a5302 100644 (file)
@@ -4366,8 +4366,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm,
        if (shader_count >= 2 || is_ngg)
                ac_init_exec_full_mask(&ctx.ac);
 
-       if ((ctx.ac.family == CHIP_VEGA10 ||
-            ctx.ac.family == CHIP_RAVEN) &&
+       if (options->has_ls_vgpr_init_bug &&
            shaders[shader_count - 1]->info.stage == MESA_SHADER_TESS_CTRL)
                ac_nir_fixup_ls_hs_input_vgprs(&ctx);
 
index c0e122a6ba7902fbbc80e9ebc66f1ee0109f7f5e..5166ecc15abe2b90ff679ae977820e75e1d122e3 100644 (file)
@@ -1146,6 +1146,7 @@ shader_variant_compile(struct radv_device *device,
        options->check_ir = device->instance->debug_flags & RADV_DEBUG_CHECKIR;
        options->tess_offchip_block_dw_size = device->tess_offchip_block_dw_size;
        options->address32_hi = device->physical_device->rad_info.address32_hi;
+       options->has_ls_vgpr_init_bug = device->physical_device->rad_info.has_ls_vgpr_init_bug;
 
        if ((stage == MESA_SHADER_GEOMETRY && !options->key.vs_common_out.as_ngg) ||
            gs_copy_shader)
index 3eb65cb831b151687f0dbe32c93a1f5518fa7abf..6c9e0bd239f85b74014de987f6c7196295d4955c 100644 (file)
@@ -125,6 +125,7 @@ struct radv_nir_compiler_options {
        bool dump_preoptir;
        bool record_llvm_ir;
        bool check_ir;
+       bool has_ls_vgpr_init_bug;
        enum radeon_family family;
        enum chip_class chip_class;
        uint32_t tess_offchip_block_dw_size;