radeonsi: move tessellation shader code into si_shader_llvm_tess.c
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3399>
This commit is contained in:
parent
d7c86b106c
commit
194449a405
6 changed files with 1343 additions and 1290 deletions
|
|
@ -38,6 +38,7 @@ C_SOURCES := \
|
|||
si_shader_llvm.c \
|
||||
si_shader_llvm_build.c \
|
||||
si_shader_llvm_ps.c \
|
||||
si_shader_llvm_tess.c \
|
||||
si_shader_nir.c \
|
||||
si_shaderlib_tgsi.c \
|
||||
si_state.c \
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ files_libradeonsi = files(
|
|||
'si_shader_llvm.c',
|
||||
'si_shader_llvm_build.c',
|
||||
'si_shader_llvm_ps.c',
|
||||
'si_shader_llvm_tess.c',
|
||||
'si_shader_nir.c',
|
||||
'si_shaderlib_tgsi.c',
|
||||
'si_state.c',
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -256,6 +256,10 @@ LLVMValueRef si_buffer_load_const(struct si_shader_context *ctx,
|
|||
LLVMValueRef resource, LLVMValueRef offset);
|
||||
void si_llvm_build_ret(struct si_shader_context *ctx, LLVMValueRef ret);
|
||||
LLVMValueRef si_prolog_get_rw_buffers(struct si_shader_context *ctx);
|
||||
LLVMValueRef si_build_gather_64bit(struct si_shader_context *ctx,
|
||||
LLVMTypeRef type, LLVMValueRef val1,
|
||||
LLVMValueRef val2);
|
||||
void si_llvm_emit_barrier(struct si_shader_context *ctx);
|
||||
void si_declare_compute_memory(struct si_shader_context *ctx);
|
||||
LLVMValueRef si_get_primitive_id(struct si_shader_context *ctx,
|
||||
unsigned swizzle);
|
||||
|
|
@ -311,6 +315,15 @@ void gfx10_ngg_gs_emit_prologue(struct si_shader_context *ctx);
|
|||
void gfx10_ngg_gs_emit_epilogue(struct si_shader_context *ctx);
|
||||
void gfx10_ngg_calculate_subgroup_info(struct si_shader *shader);
|
||||
|
||||
/* si_shader_llvm_tess.c */
|
||||
void si_llvm_preload_tes_rings(struct si_shader_context *ctx);
|
||||
void si_llvm_emit_ls_epilogue(struct ac_shader_abi *abi, unsigned max_outputs,
|
||||
LLVMValueRef *addrs);
|
||||
void si_llvm_build_tcs_epilog(struct si_shader_context *ctx,
|
||||
union si_shader_part_key *key);
|
||||
void si_llvm_init_tcs_callbacks(struct si_shader_context *ctx);
|
||||
void si_llvm_init_tes_callbacks(struct si_shader_context *ctx);
|
||||
|
||||
/* si_shader_llvm_ps.c */
|
||||
void si_llvm_build_ps_prolog(struct si_shader_context *ctx,
|
||||
union si_shader_part_key *key);
|
||||
|
|
@ -320,4 +333,14 @@ void si_llvm_build_monolithic_ps(struct si_shader_context *ctx,
|
|||
struct si_shader *shader);
|
||||
void si_llvm_init_ps_callbacks(struct si_shader_context *ctx);
|
||||
|
||||
/* TODO: remove */
|
||||
static inline bool llvm_type_is_64bit(struct si_shader_context *ctx,
|
||||
LLVMTypeRef type)
|
||||
{
|
||||
if (type == ctx->ac.i64 || type == ctx->ac.f64)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -215,3 +215,30 @@ LLVMValueRef si_prolog_get_rw_buffers(struct si_shader_context *ctx)
|
|||
ac_array_in_const32_addr_space(ctx->v4i32), "");
|
||||
return list;
|
||||
}
|
||||
|
||||
LLVMValueRef si_build_gather_64bit(struct si_shader_context *ctx,
|
||||
LLVMTypeRef type, LLVMValueRef val1,
|
||||
LLVMValueRef val2)
|
||||
{
|
||||
LLVMValueRef values[2] = {
|
||||
ac_to_integer(&ctx->ac, val1),
|
||||
ac_to_integer(&ctx->ac, val2),
|
||||
};
|
||||
LLVMValueRef result = ac_build_gather_values(&ctx->ac, values, 2);
|
||||
return LLVMBuildBitCast(ctx->ac.builder, result, type, "");
|
||||
}
|
||||
|
||||
void si_llvm_emit_barrier(struct si_shader_context *ctx)
|
||||
{
|
||||
/* GFX6 only (thanks to a hw bug workaround):
|
||||
* The real barrier instruction isn’t needed, because an entire patch
|
||||
* always fits into a single wave.
|
||||
*/
|
||||
if (ctx->screen->info.chip_class == GFX6 &&
|
||||
ctx->type == PIPE_SHADER_TESS_CTRL) {
|
||||
ac_build_waitcnt(&ctx->ac, AC_WAIT_LGKM | AC_WAIT_VLOAD | AC_WAIT_VSTORE);
|
||||
return;
|
||||
}
|
||||
|
||||
ac_build_s_barrier(&ctx->ac);
|
||||
}
|
||||
|
|
|
|||
1284
src/gallium/drivers/radeonsi/si_shader_llvm_tess.c
Normal file
1284
src/gallium/drivers/radeonsi/si_shader_llvm_tess.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue