Jump to content
  • Advertisement
Sign in to follow this  
kloffy

SSBOs - Interleaved vs Separate Buffer Objects

This topic is 1010 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!