# spirv: change direct vector child repr to direct · gitcafe/zig

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

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

Visibility: public

Requested revision: 4bd9d9b7e0d769dd8d7701b73e54ae249ac7f1da

Requested commit: 4bd9d9b7e0d769dd8d7701b73e54ae249ac7f1da

Commit: 4bd9d9b7e0d769dd8d7701b73e54ae249ac7f1da

Tree: ff9124805c74888ba8d08df4ae406caba37ff4ba

Author: Robin Voetter

Committer: Robin Voetter

## Message

```
spirv: change direct vector child repr to direct

Previously the child type of a vector was always in indirect representation.
Concretely, this meant that vectors of bools are represented by vectors
of u8.

This was undesirable because it introduced a difference between vectorizable
operations with a scalar bool and a vector of bool. This commit changes the
representation to be the same for vectors and scalars everywhere.

Some issues arised with constructing vectors: it seems the previous temporary-
and-pointer approach does not work properly with vectors of bool. To work around
this, simply use OpCompositeConstruct. This is the proper instruction for this,
but it was previously not used because of a now-solved limitation in the
SPIRV-LLVM-Translator. It was not yet applied to Zig because the Intel OpenCL
CPU runtime does not have a recent enough version of the translator yet, but
to solve that we just switch to testing with POCL instead.

```

## Parents

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

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