summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-07-06 02:56:21 +0100
committerDave Airlie <[email protected]>2017-07-06 23:05:59 +0100
commit9d9f0513905af4c916bb01253b324218fccb4272 (patch)
tree9e84c9197535baf2cc99c2566c96feecc4388350 /src/amd/vulkan
parent076faf8764d3cd8038145286f7533d0a18e82476 (diff)
ac/radv: change api to create target machine
This just modifies the API to make it easier to add other flags to target machine creation. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r--src/amd/vulkan/radv_pipeline.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 061121b8245..71a5cce4e9c 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -460,12 +460,14 @@ static struct radv_shader_variant *radv_shader_variant_create(struct radv_device
options.key = *key;
struct ac_shader_binary binary;
-
+ enum ac_target_machine_options tm_options = 0;
options.unsafe_math = !!(device->debug_flags & RADV_DEBUG_UNSAFE_MATH);
options.family = chip_family;
options.chip_class = device->physical_device->rad_info.chip_class;
options.supports_spill = device->llvm_supports_spill;
- tm = ac_create_target_machine(chip_family, options.supports_spill);
+ if (options.supports_spill)
+ tm_options |= AC_TM_SUPPORTS_SPILL;
+ tm = ac_create_target_machine(chip_family, tm_options);
ac_compile_nir_shader(tm, &binary, &variant->config,
&variant->info, shader, &options, dump);
LLVMDisposeTargetMachine(tm);
@@ -501,10 +503,12 @@ radv_pipeline_create_gs_copy_shader(struct radv_pipeline *pipeline,
struct ac_nir_compiler_options options = {0};
struct ac_shader_binary binary;
+ enum ac_target_machine_options tm_options = 0;
options.family = chip_family;
options.chip_class = pipeline->device->physical_device->rad_info.chip_class;
- options.supports_spill = pipeline->device->llvm_supports_spill;
- tm = ac_create_target_machine(chip_family, options.supports_spill);
+ if (options.supports_spill)
+ tm_options |= AC_TM_SUPPORTS_SPILL;
+ tm = ac_create_target_machine(chip_family, tm_options);
ac_create_gs_copy_shader(tm, nir, &binary, &variant->config, &variant->info, &options, dump_shader);
LLVMDisposeTargetMachine(tm);