amd/common: determine the ES type (VS or TES) for the GS on GFX9
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 9 Jan 2018 15:01:08 +0000 (16:01 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 10 Jan 2018 11:31:49 +0000 (12:31 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_nir_to_llvm.h

index 70876cfc69aecbc969f9bdb424f48473c7deda34..34ab0a4a36ef740e8527cbd0e8f8f8e455842229 100644 (file)
@@ -6984,6 +6984,14 @@ void ac_compile_nir_shader(LLVMTargetMachineRef tm,
        ac_compile_llvm_module(tm, llvm_module, binary, config, shader_info, nir[0]->info.stage, dump_shader, options->supports_spill);
        for (int i = 0; i < nir_count; ++i)
                ac_fill_shader_info(shader_info, nir[i], options);
+
+       /* Determine the ES type (VS or TES) for the GS on GFX9. */
+       if (options->chip_class == GFX9) {
+               if (nir_count == 2 &&
+                   nir[1]->info.stage == MESA_SHADER_GEOMETRY) {
+                       shader_info->gs.es_type = nir[0]->info.stage;
+               }
+       }
 }
 
 static void
index 6c59ab916cee378ac5d362a6d5a4172db95c57d4..b3ad0a09857562c5cf7145936de91583e9951d90 100644 (file)
@@ -191,6 +191,7 @@ struct ac_shader_variant_info {
                        unsigned invocations;
                        unsigned gsvs_vertex_size;
                        unsigned max_gsvs_emit_size;
+                       unsigned es_type; /* GFX9: VS or TES */
                } gs;
                struct {
                        unsigned tcs_vertices_out;