ac_llvm_context_init(struct ac_llvm_context *ctx,
struct ac_llvm_compiler *compiler,
enum chip_class chip_class, enum radeon_family family,
- unsigned wave_size)
+ enum ac_float_mode float_mode, unsigned wave_size)
{
LLVMValueRef args[1];
ctx->module = ac_create_module(wave_size == 32 ? compiler->tm_wave32
: compiler->tm,
ctx->context);
- ctx->builder = NULL;
+ ctx->builder = ac_create_builder(ctx->context, float_mode);
ctx->voidt = LLVMVoidTypeInContext(ctx->context);
ctx->i1 = LLVMInt1TypeInContext(ctx->context);
struct ac_llvm_flow;
struct ac_llvm_compiler;
+enum ac_float_mode;
struct ac_llvm_context {
LLVMContextRef context;
ac_llvm_context_init(struct ac_llvm_context *ctx,
struct ac_llvm_compiler *compiler,
enum chip_class chip_class, enum radeon_family family,
- unsigned wave_size);
+ enum ac_float_mode float_mode, unsigned wave_size);
void
ac_llvm_context_dispose(struct ac_llvm_context *ctx);
ctx.options = options;
ctx.shader_info = shader_info;
- ac_llvm_context_init(&ctx.ac, ac_llvm, options->chip_class, options->family, 64);
- ctx.context = ctx.ac.context;
-
enum ac_float_mode float_mode =
options->unsafe_math ? AC_FLOAT_MODE_UNSAFE_FP_MATH :
AC_FLOAT_MODE_DEFAULT;
- ctx.ac.builder = ac_create_builder(ctx.context, float_mode);
+ ac_llvm_context_init(&ctx.ac, ac_llvm, options->chip_class,
+ options->family, float_mode, 64);
+ ctx.context = ctx.ac.context;
radv_nir_shader_info_init(&shader_info->info);
ctx.options = options;
ctx.shader_info = shader_info;
- ac_llvm_context_init(&ctx.ac, ac_llvm, options->chip_class, options->family, 64);
- ctx.context = ctx.ac.context;
-
- ctx.is_gs_copy_shader = true;
-
enum ac_float_mode float_mode =
options->unsafe_math ? AC_FLOAT_MODE_UNSAFE_FP_MATH :
AC_FLOAT_MODE_DEFAULT;
- ctx.ac.builder = ac_create_builder(ctx.context, float_mode);
+ ac_llvm_context_init(&ctx.ac, ac_llvm, options->chip_class,
+ options->family, float_mode, 64);
+ ctx.context = ctx.ac.context;
+
+ ctx.is_gs_copy_shader = true;
ctx.stage = MESA_SHADER_VERTEX;
radv_nir_shader_info_pass(geom_shader, options, &shader_info->info);
ctx->screen = sscreen;
ctx->compiler = compiler;
- ac_llvm_context_init(&ctx->ac, compiler, sscreen->info.chip_class,
- sscreen->info.family, 64);
-
enum ac_float_mode float_mode =
sscreen->debug_flags & DBG(UNSAFE_MATH) ?
AC_FLOAT_MODE_UNSAFE_FP_MATH :
AC_FLOAT_MODE_NO_SIGNED_ZEROS_FP_MATH;
- ctx->ac.builder = ac_create_builder(ctx->ac.context, float_mode);
+
+ ac_llvm_context_init(&ctx->ac, compiler, sscreen->info.chip_class,
+ sscreen->info.family, float_mode, 64);
ctx->gallivm.context = ctx->ac.context;
ctx->gallivm.module = ctx->ac.module;