Mesa (master): amd/common: determine the ES type (VS or TES) for the GS on GFX9

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Wed Jan 10 11:33:31 UTC 2018


Module: Mesa
Branch: master
Commit: 9e2395faf5470bf6b613ca9a8f04a470c92bbfde
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e2395faf5470bf6b613ca9a8f04a470c92bbfde

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Tue Jan  9 16:01:08 2018 +0100

amd/common: determine the ES type (VS or TES) for the GS on GFX9

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/common/ac_nir_to_llvm.c | 8 ++++++++
 src/amd/common/ac_nir_to_llvm.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 70876cfc69..34ab0a4a36 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -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
diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h
index 6c59ab916c..b3ad0a0985 100644
--- a/src/amd/common/ac_nir_to_llvm.h
+++ b/src/amd/common/ac_nir_to_llvm.h
@@ -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;




More information about the mesa-commit mailing list