SSBO get block of data instead of iterating I have a mesh, each face (triangle) of the mesh needs to read some information out of a SSBO object.
Is there a way to read out a block (lets say 100 floats) at once? Or do I need to iterate over the 100 floats? The number of floats is not fixed. They vary for each triangle.
During this stage the 100 floats are not changing at all... So to iterate over them would make no change in the logic. But I think it takes to mush time to read them after each other.
I also have a second question:
when reading lets say 128 floats from SSBO iteratively does it takes longer than reading 32 vec4 iteratively? in principle both is the same (128 floats)
yes, and no. Loading the floats into the SSBO is loading them for the shader so yes you still have to iterate over them. And GPU's generally are good at latency hiding so whether or not you read floats or vec4's the GPU should be able to read them in just as fast. But processing them as vec4's instead of 1 float at a time will be faster since the code is taking advantage of the GPU's vector processing.