PDA

View Full Version : How to get 'buffer' array data from one fragment shader to a second one



JasonRay
11-08-2015, 01:36 PM
Hi. I have two fragment shaders.
I want to fill the 'buffer LinkedList' in the first shader,
and read LinkedList's data in the second fragment shader.

Excerpt from the first fragment shader:


// (copied out of an incomplete code sample found in the Internet)
struct LinkedListEntry
{
vec4 color;
uint depth;
uint next;
uint dummy;
};

layout (std430, binding = 1) buffer LinkedList
{
LinkedListEntry linkedList[];
};

void main()
{
LinkedList[index] = ...
}


What is the easiest way to get the data of LinkedList from the first fragment shader to the
second one?

I'm a beginner in what concerns OpenGL Shading Language, so please excuse eventual 'stupid questions' :)