### Godot version
v4.2.dev.custom_build [eca6f0eb5]
### System information…
Windows 10, Forward+, NVIDIA GeForce GTX 1050 Ti (31.0.15.3623)
### Issue description
Compute shaders with storage buffers with vec3 variables seem to treat the storage buffer as a vec4.
-
If the input is a PackedVector3Array converted to bytes, the shader will access it as if each entry was a vector 4, so that it will skip every forth value in the buffer. This causes the input bytes to be too small to contain the entire buffer; so the output will also be truncated after having gone through the compute shader.
---
For example, if your input is 4 vector 3s in sequence. (here converted to bytes, and then back to float32)
`[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]`
If the shader for example wanted to set its global invocation index x to the x component of the vec3, we would expect to see the following output, for a total of 3 vectors.
`[0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0]`
However, since the shader seems to treat the storage buffer as a vec4, the following is the output we see
`[0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0]`
The storage buffer is treated as a vec4 by the shader, so it will truncate the data that we wanted to write to it.
---
This appears to be unique to vec3, as scalars, vec2 and vec4 seems to produce the correct output based on those inputs.
### Steps to reproduce
### PackedVector3Array:
- Make a glsl shader with a vec3 storage buffer
- Dispatch the shader with input from a PackedVector3Array
- Observe that the output is truncated, and resemble vec4 data
### PackedColorVector :
- Dispatch the shader with input from a PackedColorVector (vec4)
- Observe that the output is no longer truncated now that it is vec4 data
### Minimal reproduction project
This is a MRP with a shader with a vec3 storage buffer
[MRP-GlslStorageBuffer.zip](https://github.com/godotengine/godot/files/12568245/MRP-GlslStorageBuffer.zip)
It dispatches this shader once with input from a PackedVector3Array, and once with a PackedColorArray.
The shader:
- 4 invocations
- Sets the x component of the vec3 to its global invocation index x, which for 4 invocations will be 0, 1, 2, 3
- Sets the y component of the vec3 to 8 to uniquely distinguish the position
- Sets the z component of the vec3 to 9 for the same reason
The input and output is as follows:
| Type | to_byte_array().to_float32_array() |
|-|-|
| input PackedVector3Array | [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
| output PackedVector3Array | [0, 8, 9, 0, 1, 8, 9, 0, 2, 8, 9, 0] |
| input PackedColorArray | [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
| output PackedColorArray | [0, 8, 9, 0, 1, 8, 9, 0, 2, 8, 9, 0, 3, 8, 9, 0] |
As can be seen from the above table; only the PackedColorArray dispatch has all 4 invocation index x's in its output (0, 1, 2, 3).