diff options
author | Rohan Garg <rohan.garg@intel.com> | 2023-05-17 14:00:37 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-05-17 13:26:41 +0000 |
commit | b2e733a8ed85f6c10a192a97c102c75287b6e735 (patch) | |
tree | cd44155ceb3e5687044886f6129623a7014ba16b | |
parent | 08279f4b17a3b4a2ed9e54464b1cea6d2cac7412 (diff) | |
download | mesa-b2e733a8ed85f6c10a192a97c102c75287b6e735.tar.gz |
anv: use the common vulkan runtime to do the heavy lifting
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23075>
-rw-r--r-- | src/intel/vulkan/anv_generated_indirect_draws.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/intel/vulkan/anv_generated_indirect_draws.c b/src/intel/vulkan/anv_generated_indirect_draws.c index 003dbc88c09..16cefaf6a9a 100644 --- a/src/intel/vulkan/anv_generated_indirect_draws.c +++ b/src/intel/vulkan/anv_generated_indirect_draws.c @@ -23,6 +23,8 @@ #include "anv_private.h" +#include "vk_nir.h" + #include "compiler/brw_compiler.h" #include "compiler/brw_nir.h" #include "compiler/spirv/nir_spirv.h" @@ -166,27 +168,15 @@ compile_upload_spirv(struct anv_device *device, device->physical->compiler->nir_options[MESA_SHADER_FRAGMENT]; nir_shader* nir = - spirv_to_nir(spirv_source, spirv_source_size, - NULL, 0, MESA_SHADER_FRAGMENT, "main", - &spirv_options, nir_options); + vk_spirv_to_nir(&device->vk, spirv_source, spirv_source_size * 4, + MESA_SHADER_FRAGMENT, "main", 0, NULL, &spirv_options, + nir_options, NULL); assert(nir != NULL); nir->info.internal = true; - nir_validate_shader(nir, "after spirv_to_nir"); - nir_validate_ssa_dominance(nir, "after spirv_to_nir"); - - NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp); - NIR_PASS_V(nir, nir_lower_returns); - NIR_PASS_V(nir, nir_inline_functions); - NIR_PASS_V(nir, nir_opt_deref); - - /* Pick off the single entrypoint that we want */ - nir_remove_non_entrypoints(nir); - NIR_PASS_V(nir, nir_lower_vars_to_ssa); - NIR_PASS_V(nir, nir_copy_prop); NIR_PASS_V(nir, nir_opt_dce); NIR_PASS_V(nir, nir_opt_cse); NIR_PASS_V(nir, nir_opt_gcm, true); |