I've been trying to use the following code to do a global list of bindless texture handles, sent to the GPU using a UBO.
struct Material
{
sampler2D diff;
sampler2D spec;
sampler2D norm;
};
layout(std140, binding = 2) uniform Materials
{
Material materials[64];
};
However, I think I am filling in the buffer wrong in c++, not taking into account the correct offsets etc. I can't seem to find anything on how the std140 layout handles sampler2D. How should I be doing this? What offsets do I need to take into account?