OSDN Git Service

spirv: Make push constants an offset-based pointer
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 22 Mar 2018 15:50:34 +0000 (08:50 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 23 Jun 2018 03:15:57 +0000 (20:15 -0700)
commit7dfa440922f562ae41d0671219ace8ef2217804a
tree09fdb7d098e0732a4f0c472348e153989f9776f6
parentb0c643d8f579a3e1e45a08f6d9de099f2c45898b
spirv: Make push constants an offset-based pointer

Push constants have been a weird edge-case for a while in that they have
explitic offsets but we've been internally building access chains for
them.  This mostly works but it means that passing pointers to push
constants through as function arguments is broken.  The easy thing to do
for now is to just treat them like UBOs or SSBOs only without a block
index.  This does loose a bit of information since we no longer have an
accurate access range and any indirect access will look like it could
read the whole block.  Unfortunately, there's not much we can do about
that.  Once NIR derefs get a bit more powerful, we can plumb these
through as derefs and be able to reason about them again.

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>
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_variables.c