Sign in to follow this  
kloffy

SSBOs - Interleaved vs Separate Buffer Objects

Recommended Posts

I was wondering what the recommended way of using SSBOs is, e.g. if you want to share vertex data on the GPU between compute and regular shaders. Would you typically use one interleaved buffer, i.e.:
 
[source=c]struct Vertex
{
vec4 position;
vec2 tex_coord;
vec4 color;
};

layout(binding = 0) buffer VertexDataIn {
Vertex vertex[];
} cs_in;[/source]
 
Or use separate buffers, i.e.:
 
[source=c]layout(binding = 0) buffer PositionDataIn { vec4 position[]; } cs_position_in;
layout(binding = 1) buffer TexCoordDataIn { vec2 tex_coord[]; } cs_tex_coord_in;
layout(binding = 2) buffer ColorDataIn { vec4 color[]; } cs_color_in;[/source]

In my shaders, I tended towards using separate VBOs, mainly because they can be updated independently. However, with SSBOs the latter usage seems a bit awkward. Any experiences/recommendataions? Edited by kloffy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this