on-internet
← Community

Vulkan unpack uvec4 from integer

Stack Overflow ·

I've observed some strange behavior. I have an array of unsigned 32bit integers. I use one integer to encode 4 values, each one byte in size. I'd like to then pass such buffer to vertex shader layout (location = 0) in uvec4 coords; In order to achieve this, I use VkVertexInputAttributeDescription with format set to VK_FORMAT_R8G8B8A8_UINT. I have defined such handy struct struct PackedUVec4{ unsigned char x; unsigned char y; unsigned char z; unsigned char w; }; Then I build my buffer as PackedUVec4[] and such buffer is then sent to GPU. However, what I have observed, is that the order of bytes

Comments

Sign in or sign up to comment and upvote.

No comments yet.