Mesa (master): spirv: get the correct type for function returns.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Nov 21 19:18:07 UTC 2019
Module: Mesa
Branch: master
Commit: 5375c302347396666aa325bf67fbf7b972f7aca2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5375c302347396666aa325bf67fbf7b972f7aca2
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Nov 20 08:33:10 2019 +1000
spirv: get the correct type for function returns.
This needs to be derived from the address format, not always 1/32.
Suggested by Jason
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
src/compiler/spirv/vtn_cfg.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index cf67893c6c8..67c3245126d 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -274,9 +274,12 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode,
unsigned idx = 0;
if (func_type->return_type->base_type != vtn_base_type_void) {
+ nir_address_format addr_format =
+ vtn_mode_to_address_format(b, vtn_variable_mode_function);
/* The return value is a regular pointer */
func->params[idx++] = (nir_parameter) {
- .num_components = 1, .bit_size = 32,
+ .num_components = nir_address_format_num_components(addr_format),
+ .bit_size = nir_address_format_bit_size(addr_format),
};
}
More information about the mesa-commit
mailing list