Exalia

05-27-2015, 11:16 AM

Hi there everyone,

I'm fairly new to OpenGLES3.1 and I'm attempting to utilise compute shaders in attempt to parallelise a conventionally serial algorithm.

I was wondering if anyone could offer any advice on the subject of SSBOs and potentially two dimensional SSBOs.

I would like my shader to take two input buffers of structs :

struct Vector2f

{

float x;

float y;

};

struct Node

{

Vector2f id;

float f;

float h;

float g;

};

layout(std140, binding = 0) buffer destBuffer

{

nodes Node[];

} outBuffer;

The first buffer would consist of a few select nodes which correspond to a node in the second buffer.

I would like to take this initial node (first buffer), find its corresponding node (second buffer) and then find its adjacent nodes in the second buffer.

Once the adjacent nodes have been found I would then like to fill up a 3rd SSBO with these adjacent nodes.

1847

That's about it for now;

My first question would be is this at all possible?

If yes would it be possible with 2D SSBOs?

If yes how do I go about creating two dimensional SSBOs?

If not possible with 2D SSBOs what are my other options? (A 1D SSBO with an Array of Arrays perhaps?)

I hope I have explained this in enough detail, any comments would be greatly appreciated :)

Thanks in advance.

I'm fairly new to OpenGLES3.1 and I'm attempting to utilise compute shaders in attempt to parallelise a conventionally serial algorithm.

I was wondering if anyone could offer any advice on the subject of SSBOs and potentially two dimensional SSBOs.

I would like my shader to take two input buffers of structs :

struct Vector2f

{

float x;

float y;

};

struct Node

{

Vector2f id;

float f;

float h;

float g;

};

layout(std140, binding = 0) buffer destBuffer

{

nodes Node[];

} outBuffer;

The first buffer would consist of a few select nodes which correspond to a node in the second buffer.

I would like to take this initial node (first buffer), find its corresponding node (second buffer) and then find its adjacent nodes in the second buffer.

Once the adjacent nodes have been found I would then like to fill up a 3rd SSBO with these adjacent nodes.

1847

That's about it for now;

My first question would be is this at all possible?

If yes would it be possible with 2D SSBOs?

If yes how do I go about creating two dimensional SSBOs?

If not possible with 2D SSBOs what are my other options? (A 1D SSBO with an Array of Arrays perhaps?)

I hope I have explained this in enough detail, any comments would be greatly appreciated :)

Thanks in advance.