Is there a fast array block copy functionality in glsl, or something similar?

Viewed 378

I have a very large SSBO unbounded array:

struct PStruct{
  vec2 P1;
  vec2 P2;
}
layout(std430) buffer MyList 
  {
    PStruct list[];
  }

In my shader code i need to copy chunks of this array say from start-end indexes 1000-2000 to start-end indexes 50000-51000. Is there any way i can do it fast instead of copying element by element in a for-loop?

1 Answers

The closest to what i want that i managed to find is actually OpenGL and not glsl command called glCopyBufferSubData. It will copy GPU memory from one place in same buffer to another as it allows for from and to buffers to be same.

Related