mesa/src/compiler/spirv
Jason Ekstrand c11833ab24 nir,spirv: Rework function calls
This commit completely reworks function calls in NIR.  Instead of having
a set of variables for the parameters and return value, nir_call_instr
now has simply has a number of sources which get mapped to load_param
intrinsics inside the functions.  It's up to the client API to build an
ABI on top of that.  In SPIR-V, out parameters are handled by passing
the result of a deref through as an SSA value and storing to it.

This virtue of this approach can be seen by how much it allows us to
delete from core NIR.  In particular, nir_inline_functions gets halved
and goes from a fairly difficult pass to understand in detail to almost
trivial.  It also simplifies spirv_to_nir somewhat because NIR functions
never were a good fit for SPIR-V.

Unfortunately, there is no good way to do this without a mega-commit.
Core NIR and SPIR-V have to be changed at the same time.  This also
requires changes to anv and radv because nir_inline_functions couldn't
handle deref instructions before this change and can't work without them
after this change.

Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2018-06-22 20:15:58 -07:00
..
.gitignore .gitignore: Ignore new generated files 2018-01-08 21:11:11 -08:00
gl_spirv.c nir/spirv: add gl_spirv_validation method 2018-03-30 09:14:56 +02:00
GLSL.ext.AMD.h spirv: import AMD extensions header from glslang 2018-03-07 23:09:58 +01:00
GLSL.std.450.h
meson.build spirv: Move SPIR-V building to Makefile.spirv.am and spirv/meson.build 2018-03-29 14:16:01 -07:00
nir_spirv.h nir/spirv: add gl_spirv_validation method 2018-03-30 09:14:56 +02:00
spirv.core.grammar.json spirv: Update spirv.h to 12f8de9f04327336b699b1b80aa390ae7f9ddbf4 2018-04-18 22:56:54 +02:00
spirv.h spirv: Update spirv.h to 12f8de9f04327336b699b1b80aa390ae7f9ddbf4 2018-04-18 22:56:54 +02:00
spirv2nir.c
spirv_info.h spirv/info: Add spirv_op_to_string 2018-01-08 14:57:44 -08:00
spirv_info_c.py spirv/info: Add spirv_op_to_string 2018-01-08 14:57:44 -08:00
spirv_to_nir.c nir,spirv: Rework function calls 2018-06-22 20:15:58 -07:00
vtn_alu.c compiler/spirv: implement 16-bit bitcasts 2018-05-03 11:40:26 +02:00
vtn_amd.c nir/spirv: s/uint32_t/SpvOp/ in various functions 2018-03-30 14:33:33 -06:00
vtn_cfg.c nir,spirv: Rework function calls 2018-06-22 20:15:58 -07:00
vtn_gather_types_c.py
vtn_glsl450.c spirv: Use deref instructions for most variables 2018-06-22 20:15:57 -07:00
vtn_private.h nir,spirv: Rework function calls 2018-06-22 20:15:58 -07:00
vtn_subgroup.c nir/spirv: Fix warning and add missing breaks. 2018-04-14 00:52:22 +02:00
vtn_variables.c nir,spirv: Rework function calls 2018-06-22 20:15:58 -07:00