From 767737536e27b4340e3d1a08addca4cc9602363f Mon Sep 17 00:00:00 2001 From: Friedrich Vock Date: Sun, 7 Jan 2024 23:06:01 +0100 Subject: [PATCH] nir,vtn: Add return info to parameters Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir.h | 2 +- src/compiler/spirv/vtn_cfg.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 79906938d58..e507ec6aa8c 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -3580,7 +3580,7 @@ typedef struct { uint8_t num_components; uint8_t bit_size; - /* True if this paramater is actually the function return variable */ + /* True if this parameter is a deref used for returning values */ bool is_return; bool implicit_conversion_prohibited; diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 78043e2686c..987a195b27d 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -331,6 +331,8 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode, func->params[idx++] = (nir_parameter) { .num_components = nir_address_format_num_components(addr_format), .bit_size = nir_address_format_bit_size(addr_format), + .is_return = true, + .type = func_type->return_type->type, }; }