# spirv: generic global pointers · gitcafe/zig

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

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

Visibility: public

Requested revision: 3c7f93aa69e495820448a17869bd4663ed396ff2

Requested commit: 3c7f93aa69e495820448a17869bd4663ed396ff2

Commit: 3c7f93aa69e495820448a17869bd4663ed396ff2

Tree: 960fe85215ded196739493e83dc903905102ff61

Author: Robin Voetter

Committer: Robin Voetter

## Message

```
spirv: generic global pointers

Similar to function locals, taking the address of a global that does
not have an explicit address space assigned to it should result
in a generic pointer, not a global pointer. Also similar to function
locals, they cannot be generated into the generic storage class, and
so are generated into the global storage class and then cast to a
generic pointer, using OpSpecConstantOp. Note that using
OpSpecConstantOp results is only allowed by a hand full of other
OpSpecConstant instructions - which is why we generate constant
structs using OpSpecConstantComposite: These may use OpVariable
and OpSpecConstantOp results, while OpConstantComposite may not.

```

## Parents

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

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