nir/spirv: handle kernel function parameters
authorKarol Herbst <kherbst@redhat.com>
Tue, 6 Nov 2018 11:06:08 +0000 (12:06 +0100)
committerKarol Herbst <karolherbst@gmail.com>
Tue, 19 Mar 2019 04:08:07 +0000 (04:08 +0000)
commitc95afe56a8033a87dca71cc93191d448c2981cf7
tree84c5379abbcbdfb5fd520e0500726b4c205e3cfa
parent0ccdf23a57ed8f2a8763f4187b440720fa912937
nir/spirv: handle kernel function parameters

the idea here is to generate an entry point stub function wrapping around the
actual kernel function and turn all parameters into shader inputs with byte
addressing instead of vec4.

This gives us several advantages:
1. calling kernel functions doesn't differ from calling any other function
2. CL inputs match uniforms in most ways and we can just take advantage of most
   of nir_lower_io

v2: move code into a seperate function
v3: verify the entry point got a name
    fix minor typo
v4: make vtn_emit_kernel_entry_point_wrapper take the old entry point as an arg

Signed-off-by: Karol Herbst <kherbst@redhat.com>
src/compiler/spirv/spirv_to_nir.c