glsl/nir: mark samplers inside a block as bindless

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13416>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2021-10-19 18:13:49 +02:00
parent e3a51a408f
commit c6e2c802c4

View File

@@ -745,13 +745,20 @@ update_uniforms_shader_info(struct gl_shader_program *prog,
if (glsl_type_is_sampler(type_no_array)) {
bool init_idx;
unsigned *next_index = state->current_var->data.bindless ?
/* ARB_bindless_texture spec says:
*
* "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."
*/
bool is_bindless = state->current_var->data.bindless || state->var_is_in_block;
unsigned *next_index = is_bindless ?
&state->next_bindless_sampler_index :
&state->next_sampler_index;
int sampler_index = get_next_index(state, uniform, next_index, &init_idx);
struct gl_linked_shader *sh = prog->_LinkedShaders[stage];
if (state->current_var->data.bindless) {
if (is_bindless) {
if (init_idx) {
sh->Program->sh.BindlessSamplers =
rerzalloc(sh->Program, sh->Program->sh.BindlessSamplers,