Module: Mesa Branch: master Commit: b41e74ae4a7c8f67c47149b4415f715f8a4d2597 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b41e74ae4a7c8f67c47149b4415f715f8a4d2597
Author: Jason Ekstrand <[email protected]> Date: Thu Aug 13 11:48:02 2020 -0500 spirv: Add a MESA_SPIRV_FORCE_UNSTRUCTURED environment variable Reviewed-by: Karol Herbst <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401> --- src/compiler/spirv/vtn_cfg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 9dc2a842da6..074f61b331e 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -1329,6 +1329,12 @@ void vtn_function_emit(struct vtn_builder *b, struct vtn_function *func, vtn_instruction_handler instruction_handler) { + static int force_unstructured = -1; + if (force_unstructured < 0) { + force_unstructured = + env_var_as_boolean("MESA_SPIRV_FORCE_UNSTRUCTURED", false); + } + nir_builder_init(&b->nb, func->impl); b->func = func; b->nb.cursor = nir_after_cf_list(&func->impl->body); @@ -1336,7 +1342,7 @@ vtn_function_emit(struct vtn_builder *b, struct vtn_function *func, b->has_loop_continue = false; b->phi_table = _mesa_pointer_hash_table_create(b); - if (b->shader->info.stage == MESA_SHADER_KERNEL) { + if (b->shader->info.stage == MESA_SHADER_KERNEL || force_unstructured) { b->func->impl->structured = false; vtn_emit_cf_func_unstructured(b, func, instruction_handler); } else { _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
