radv: fixup geometry clip emission since using the geom pass
authorDave Airlie <airlied@redhat.com>
Fri, 31 Mar 2017 20:56:46 +0000 (06:56 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 31 Mar 2017 21:14:38 +0000 (07:14 +1000)
Fixes: 2b35b60d: radv: move to using nir clip/cull merge pass.
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index d0cb411f7cd80a4fe3c1c3e06c3ef5884e5c7312..91e2a1afbb553dd541e999bcb0930c82e2c704c9 100644 (file)
@@ -4887,7 +4887,8 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
        ralloc_free(ctx.phis);
 
        if (nir->stage == MESA_SHADER_GEOMETRY) {
-               shader_info->gs.gsvs_vertex_size = util_bitcount64(ctx.output_mask) * 16;
+               unsigned addclip = ctx.num_output_clips + ctx.num_output_culls > 4;
+               shader_info->gs.gsvs_vertex_size = (util_bitcount64(ctx.output_mask) + addclip) * 16;
                shader_info->gs.max_gsvs_emit_size = shader_info->gs.gsvs_vertex_size *
                        nir->info->gs.vertices_out;
        }