Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3959634
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:45:15+00:00 2026-05-20T02:45:15+00:00

using opengl 3.3, radeon 3870HD, c++.. I got question about interleaved arrays of data.

  • 0

using opengl 3.3, radeon 3870HD, c++..

I got question about interleaved arrays of data. I got in my application structure in vector, which is send as data to buffer object. Something like this:

struct data{
  int a;
  int b;
  int c;
};

std::vector<data> datVec;
...
glBufferData(GL_ARRAY_BUFFER, sizeof(data)*datVec.size(), &datVec[0], GL_DYNAMIC_DRAW);

this is ok I use this thing very often. But what I create is interleaved array so data are like:

a1,b1,c1,a2,b2,c2,a3,b3,c3

Now I send this thing down for processing in GPU and with transform feedback I read back into buffer for example b variables. So it looks like:

bU1, bU2, bU3

I’d like to copy updated values into interleaved buffer, can this be done with some single command like glCopyBufferSubData? This one isn’t suitable as it only takes offset and size not stride (probably it’s something like memcpy in c++)… The result should look like:

a1, bU1, c1, a2, bU2, c2, a3, bU3, c3

If not is there better approach than these 2 mine?

  1. map updated buffer, copy values into temp storage in app, unmap updated, map data buffer and itterating through it set new values

  2. separate buffers on constant buffer and variable buffer. constant will stay same over time but using glCopyBufferSubData the variable one can be updated in single call..

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T02:45:16+00:00Added an answer on May 20, 2026 at 2:45 am

    I would separate the dynamic part with a static one (your point 2).

    If you still want to keep them interleaved into a single buffer, and you have some spare video memory, you can do the following:

    1. Copy the original interleaved array into a backup one. This requires memory for all components rather than only dynamic ones, how it was originally.
    2. Transform Feedback into the original interleaved, carrying the static values unchanged.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using OpenGL in C++ Visual Studio 2008 Forms application and I want a
I'm using OpenGL to render a game view in my android application. The game
I'm using OpenGL ES in my iPhone application and sometimes during startup the screen
I am using OpenGL ES in JNI to draw the frame (RGB data) returned
I'm currently using OpenGL on Android to draw set width lines, which work great
When using OpenGL VBOs you can interleave your data You can even interleave vertex
I'm thinking about using OpenGL for part of my app, speciffically tile based London
In relation to this question on Using OpenGL extensions , what's the purpose of
Using OpenGL ES I am rendering a simple cube class that draws it at
I am using OpenGL 2.0 on the android platform (Samsung Galaxy S2). When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.