radv: keep track of whether NGG is used for GS on GFX10
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 9 Jul 2019 06:43:57 +0000 (08:43 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 9 Jul 2019 07:54:19 +0000 (09:54 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_nir_to_llvm.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader.h

index 67630c4ee923f62e8b2b057ccbe8381e3378ff4f..1b89518a383b32d64ec03c6d7d0d82e54fd55387 100644 (file)
@@ -3972,6 +3972,7 @@ ac_fill_shader_info(struct radv_shader_variant_info *shader_info, struct nir_sha
                 shader_info->gs.vertices_out = nir->info.gs.vertices_out;
                 shader_info->gs.output_prim = nir->info.gs.output_primitive;
                 shader_info->gs.invocations = nir->info.gs.invocations;
+                shader_info->is_ngg = options->key.gs.as_ngg;
                 break;
         case MESA_SHADER_TESS_EVAL:
                 shader_info->tes.primitive_mode = nir->info.tess.primitive_mode;
index 23aefc5ffd0184bf4ba4b2edaae05b9b24526162..419263c63b6f792100675475dbd44674fce28964 100644 (file)
@@ -2254,7 +2254,9 @@ radv_fill_shader_keys(struct radv_device *device,
        }
 
        if (device->physical_device->rad_info.chip_class >= GFX10) {
-               if (nir[MESA_SHADER_TESS_CTRL]) {
+               if (nir[MESA_SHADER_GEOMETRY]) {
+                       keys[MESA_SHADER_GEOMETRY].gs.as_ngg = true;
+               } else if (nir[MESA_SHADER_TESS_CTRL]) {
                        keys[MESA_SHADER_TESS_EVAL].tes.out.as_ngg = true;
                } else {
                        keys[MESA_SHADER_VERTEX].vs.out.as_ngg = true;
index f8933614bd702cdd263c67a6e1f816e4d7674667..b4f833d7570b4d48d6e065b8773e54d64e130719 100644 (file)
@@ -112,12 +112,18 @@ struct radv_fs_variant_key {
        uint32_t is_int10;
 };
 
+
+struct radv_gs_variant_key {
+       uint32_t as_ngg:1;
+};
+
 struct radv_shader_variant_key {
        union {
                struct radv_vs_variant_key vs;
                struct radv_fs_variant_key fs;
                struct radv_tes_variant_key tes;
                struct radv_tcs_variant_key tcs;
+               struct radv_gs_variant_key gs;
        };
        bool has_multiview_view_index;
 };