Reputation: 284
My program crashes when I add this line of code:
uniform short colors[262144][3];
How many things am I doing wrong here?
I am trying to pass in an array like this into the per pixel fragment shader, but for now I am just seeing if this line will work and my program crashes.
Upvotes: 0
Views: 192
Reputation: 2322
You cannot use multidimensional arrays in GLSL and you cannot use shorts either.
You could mimic the functionality of a multidimensional array like this though:
uniform float colors[50*3];
// Then access it like this
float t = colors[row * 50 + column];
I would imagine you are trying to send too much data as well, I would personally pass that much data using a texture or a buffer instead.
This is a great answer which explains these methods https://stackoverflow.com/a/7958008/139927
Upvotes: 2