uint32_t tcs_num_inputs;
uint32_t tcs_num_patches;
- uint32_t max_gsvs_emit_size;
- uint32_t gsvs_vertex_size;
LLVMValueRef vertexptr; /* GFX10 only */
};
LLVMBuildStore(builder, out_val, ptr);
}
}
- assert(out_idx * 4 <= ctx->gsvs_vertex_size);
+ assert(out_idx * 4 <= ctx->shader_info->gs.gsvs_vertex_size);
/* Determine and store whether this vertex completed a primitive. */
const LLVMValueRef curverts = LLVMBuildLoad(builder, ctx->gs_curprim_verts[stream], "");
nir_foreach_variable(variable, &shaders[i]->outputs)
scan_shader_output_decl(&ctx, variable, shaders[i], shaders[i]->info.stage);
- if (shaders[i]->info.stage == MESA_SHADER_GEOMETRY) {
- unsigned addclip = shaders[i]->info.clip_distance_array_size +
- shaders[i]->info.cull_distance_array_size > 4;
- ctx.gsvs_vertex_size = (util_bitcount64(ctx.output_mask) + addclip) * 16;
- ctx.max_gsvs_emit_size = ctx.gsvs_vertex_size *
- shaders[i]->info.gs.vertices_out;
- }
-
ac_setup_rings(&ctx);
LLVMBasicBlockRef merge_block;
gfx10_ngg_gs_emit_epilogue_2(&ctx);
}
- if (shaders[i]->info.stage == MESA_SHADER_GEOMETRY) {
- shader_info->gs.gsvs_vertex_size = ctx.gsvs_vertex_size;
- shader_info->gs.max_gsvs_emit_size = ctx.max_gsvs_emit_size;
- } else if (shaders[i]->info.stage == MESA_SHADER_TESS_CTRL) {
+ if (shaders[i]->info.stage == MESA_SHADER_TESS_CTRL) {
shader_info->tcs.num_patches = ctx.tcs_num_patches;
shader_info->tcs.lds_size = calculate_tess_lds_size(&ctx);
}
default:
break;
}
+
+ if (nir->info.stage == MESA_SHADER_GEOMETRY) {
+ unsigned add_clip = nir->info.clip_distance_array_size +
+ nir->info.cull_distance_array_size > 4;
+ info->gs.gsvs_vertex_size =
+ (util_bitcount64(nir->info.outputs_written) + add_clip) * 16;
+ info->gs.max_gsvs_emit_size =
+ info->gs.gsvs_vertex_size * nir->info.gs.vertices_out;
+ }
}