radv: pass some necessary gs info back to state handling.
authorDave Airlie <airlied@redhat.com>
Thu, 19 Jan 2017 03:43:26 +0000 (13:43 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 30 Jan 2017 23:29:30 +0000 (09:29 +1000)
We need this info to program some registers.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_nir_to_llvm.h

index 844938af462541f2140faf3ba6f7567bebb3d72e..19952b3a3107edc88c15beecadfaf68ac678afb1 100644 (file)
@@ -4620,6 +4620,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;
 }
 
index 783331160e556b35f80d2e9f90375bd98aa03b0a..589a9a9e08e5db5359192ed5a814e12e6e7a0004 100644 (file)
@@ -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;
        };
 };