radv: Don't use vgpr indexing for outputs on GFX9.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 21 Oct 2017 22:56:09 +0000 (00:56 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 22 Oct 2017 00:36:37 +0000 (02:36 +0200)
Due to LLVM bugs. Fixes a bunch of dEQP-VK.glsl.indexing.*
tests.

Fixes: e38685cc62e 'Revert "radv: disable support for VEGA for now."'
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_shader.c

index e572f69..07e68d6 100644 (file)
@@ -264,6 +264,11 @@ radv_shader_compile_to_nir(struct radv_device *device,
             !llvm_has_working_vgpr_indexing)) {
                indirect_mask |= nir_var_shader_in;
        }
+       if (!llvm_has_working_vgpr_indexing &&
+           (nir->info.stage == MESA_SHADER_VERTEX ||
+            nir->info.stage == MESA_SHADER_TESS_EVAL ||
+            nir->info.stage == MESA_SHADER_FRAGMENT))
+               indirect_mask |= nir_var_shader_out;
 
        /* TODO: We shouldn't need to do this, however LLVM isn't currently
         * smart enough to handle indirects without causing excess spilling