*max_gsprims = MIN2(*max_gsprims, 1 + max_reuse);
}
+unsigned gfx10_ngg_get_scratch_dw_size(struct si_shader *shader)
+{
+ const struct si_shader_selector *sel = shader->selector;
+
+ if (sel->type == PIPE_SHADER_GEOMETRY && sel->so.num_outputs)
+ return 44;
+
+ return 8;
+}
+
/**
* Determine subgroup information like maximum number of vertices and prims.
*
ctx->gs_generated_prims[i] = ac_build_alloca(&ctx->ac, ctx->ac.i32, "");
}
- unsigned scratch_size = 8;
- if (sel->so.num_outputs)
- scratch_size = 44;
-
assert(!ctx->gs_ngg_scratch);
- LLVMTypeRef ai32 = LLVMArrayType(ctx->ac.i32, scratch_size);
+ LLVMTypeRef ai32 = LLVMArrayType(ctx->ac.i32, gfx10_ngg_get_scratch_dw_size(shader));
ctx->gs_ngg_scratch =
LLVMAddGlobalInAddressSpace(ctx->ac.module, ai32, "ngg_scratch", AC_ADDR_SPACE_LDS);
LLVMSetInitializer(ctx->gs_ngg_scratch, LLVMGetUndef(ai32));
* compaction is enabled.
*/
if (!ctx->gs_ngg_scratch && (sel->so.num_outputs || shader->key.opt.ngg_culling)) {
- LLVMTypeRef asi32 = LLVMArrayType(ctx->ac.i32, 8);
+ LLVMTypeRef asi32 = LLVMArrayType(ctx->ac.i32, gfx10_ngg_get_scratch_dw_size(shader));
ctx->gs_ngg_scratch =
LLVMAddGlobalInAddressSpace(ctx->ac.module, asi32, "ngg_scratch", AC_ADDR_SPACE_LDS);
LLVMSetInitializer(ctx->gs_ngg_scratch, LLVMGetUndef(asi32));
void gfx10_ngg_gs_emit_vertex(struct si_shader_context *ctx, unsigned stream, LLVMValueRef *addrs);
void gfx10_ngg_gs_emit_prologue(struct si_shader_context *ctx);
void gfx10_ngg_gs_emit_epilogue(struct si_shader_context *ctx);
+unsigned gfx10_ngg_get_scratch_dw_size(struct si_shader *shader);
bool gfx10_ngg_calculate_subgroup_info(struct si_shader *shader);
/* si_shader_llvm.c */