spirv: handle UniformConstant for OpenCL kernels
authorKarol Herbst <kherbst@redhat.com>
Thu, 5 Dec 2019 10:37:34 +0000 (11:37 +0100)
committerKarol Herbst <karolherbst@gmail.com>
Wed, 11 Dec 2019 23:54:39 +0000 (23:54 +0000)
commit2402232c90ef362a6cf14ff1cf5518e6c25bf9f9
tree88dc6eef0538c4e25883882365336f96571188be
parent123f90cf367d3feceea0dbea84b2bdd6be26a146
spirv: handle UniformConstant for OpenCL kernels

The caller is responsible for setting up the ubo_addr_format value as
contrary to shared and global, it's not controlled by the spirv.

Right now clovers implementation of CL constant memory uses a 24/8 bit format
to encode the buffer index and offset, but that code is dead as all backends
treat constants as global memory to workaround annoying issues within OpenCL.

Maybe that will change, maybe not. But just in case somebody wants to look at
it, add a toggle for this inside vtn.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/compiler/spirv/nir_spirv.h
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_variables.c