[Mesa-dev] [PATCH 12/29] radv: pass some necessary gs info back to state handling.

Dave Airlie airlied at gmail.com
Mon Jan 30 06:02:46 UTC 2017


From: Dave Airlie <airlied at redhat.com>

We need this info to program some registers.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/common/ac_nir_to_llvm.c | 5 +++++
 src/amd/common/ac_nir_to_llvm.h | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 08ef5eb..3e922b0 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -4611,6 +4611,11 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
 	ralloc_free(ctx.defs);
 	ralloc_free(ctx.phis);
 
+	if (nir->stage == MESA_SHADER_GEOMETRY) {
+		shader_info->gs.gsvs_vertex_size = util_bitcount64(ctx.output_mask) * 16;
+		shader_info->gs.max_gsvs_emit_size = shader_info->gs.gsvs_vertex_size *
+			nir->info->gs.vertices_out;
+	}
 	return ctx.module;
 }
 
diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h
index 7833311..589a9a9 100644
--- a/src/amd/common/ac_nir_to_llvm.h
+++ b/src/amd/common/ac_nir_to_llvm.h
@@ -127,6 +127,8 @@ struct ac_shader_variant_info {
 			unsigned vertices_out;
 			unsigned output_prim;
 			unsigned invocations;
+			unsigned gsvs_vertex_size;
+			unsigned max_gsvs_emit_size;
 		} gs;
 	};
 };
-- 
2.9.3



More information about the mesa-dev mailing list