# spirv: improve linking globals · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/8bbfbfc956af163434c734e196d5c2a77e77ff07)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 8bbfbfc956af163434c734e196d5c2a77e77ff07

Requested commit: 8bbfbfc956af163434c734e196d5c2a77e77ff07

Commit: 8bbfbfc956af163434c734e196d5c2a77e77ff07

Tree: 8ed95f240d2736a4d82e915ecc9269f15ba834e2

Author: Robin Voetter

Committer: Robin Voetter

## Message

```
spirv: improve linking globals

SPIR-V globals must be emitted in order, so that any
declaration precedes usage. Zig, however, generates globals in
random order. To this end we keep for each global a list of
dependencies and perform a topological sort when flushing the
module.

```

## Parents

- [80b84355692606ac840584baa62aaafdd8ecd425](https://git.cafe/gitcafe/zig/commit/80b84355692606ac840584baa62aaafdd8ecd425?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/8bbfbfc956af163434c734e196d5c2a77e77ff07?format=markdown)
