radeonsi/gfx9: declare LDS ESGS ring as an explicit symbol on LLVM >= 9
[mesa.git] / src / gallium / drivers / radeonsi / si_shader.h
index beda82beb05fa446038fb6ef0b65460835112907..f9a754d7f0b7c509ff688828f55319b32fccf979 100644 (file)
 
 #include <stdio.h>
 
+// Use LDS symbols when supported by LLVM. Can be disabled for testing the old
+// path on newer LLVM for now. Should be removed in the long term.
+#define USE_LDS_SYMBOLS (true)
+
 struct nir_shader;
 struct si_shader;
 struct si_context;
@@ -595,6 +599,14 @@ struct si_shader_binary {
        char *llvm_ir_string;
 };
 
+struct gfx9_gs_info {
+       unsigned es_verts_per_subgroup;
+       unsigned gs_prims_per_subgroup;
+       unsigned gs_inst_prims_in_subgroup;
+       unsigned max_prims_per_subgroup;
+       unsigned esgs_ring_size; /* in bytes */
+};
+
 struct si_shader {
        struct si_compiler_ctx_state    compiler_ctx_state;
 
@@ -629,6 +641,8 @@ struct si_shader {
        char                            *shader_log;
        size_t                          shader_log_size;
 
+       struct gfx9_gs_info gs_info;
+
        /* For save precompute context registers values. */
        union {
                struct {
@@ -718,6 +732,11 @@ void si_nir_scan_tess_ctrl(const struct nir_shader *nir,
 void si_lower_nir(struct si_shader_selector *sel);
 void si_nir_opts(struct nir_shader *nir);
 
+/* si_state_shaders.c */
+void gfx9_get_gs_info(struct si_shader_selector *es,
+                     struct si_shader_selector *gs,
+                     struct gfx9_gs_info *out);
+
 /* Inline helpers. */
 
 /* Return the pointer to the main shader part's pointer. */