glsl: mark structs containing images as bindless
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 21 Jul 2023 03:59:35 +0000 (13:59 +1000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 9 Aug 2023 01:27:58 +0000 (01:27 +0000)
commit92c5460253f9c647be96a373ded616b16961017f
tree27b3720cddf3136ae026f8136a6153f77425fb90
parent8dd26910204ab638d756179de7d42b522df2879e
glsl: mark structs containing images as bindless

Structs are not allowed to contain an image in regular glsl. The only time
they are intended to be allowed to be declared in a struct is when
they are bindless.

Unfortunately the bindless spec does not meantion this behaviour
explicitly so there is no spec quote to reference but you can see in
the original commit to allow them in mesa that spec clarification was
provided 48b7882200c5

The spec also states that certain uses are implicitly bindless as per
the following spec quote:

   "When used as shader inputs, outputs, uniform block members,
   or temporaries, the value of the sampler is a 64-bit unsigned
   integer handle and never refers to a texture image unit."

Given images are not allowed in regular glsl for the above types
similair to being forbidden in structs, we can also assume
declarations in structs are implicitly bindless.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24269>
src/compiler/glsl/ast_to_hir.cpp
src/gallium/drivers/zink/ci/zink-radv-navi10-fails.txt
src/gallium/drivers/zink/ci/zink-radv-vangogh-fails.txt