spirv: Count variables *after* unused ones are removed

Previous code was counting more variables than those used by the entry
point.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8456>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2021-01-12 10:25:58 -08:00
committed by Marge Bot
parent cc98ba2eaf
commit e3abbe7a24
2 changed files with 16 additions and 6 deletions

View File

@@ -1767,7 +1767,6 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
case vtn_variable_mode_ubo:
/* There's no other way to get vtn_variable_mode_ubo */
vtn_assert(without_array->block);
b->shader->info.num_ubos++;
break;
case vtn_variable_mode_ssbo:
if (storage_class == SpvStorageClassStorageBuffer &&
@@ -1785,11 +1784,6 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
"have a struct type with the Block decoration");
}
}
b->shader->info.num_ssbos++;
break;
case vtn_variable_mode_push_constant:
b->shader->num_uniforms =
glsl_get_explicit_size(without_array->type, false);
break;
case vtn_variable_mode_generic: