Page 1 of 1

Send array to shader program

Posted: Mon Jul 19, 2010 4:31 pm
by wing64
Hi
I confuse when send array data to shader program e.g.

Cpu pass ->

Code: Select all

float mBloomTexWeights[15][4];
services->setPixelShaderConstant("sampleWeights", mBloomTexWeights[0], 60);
Shader pass i used ->

Code: Select all

uniform float4 sampleWeights[15];
That's correct or not :?:

Best regards,

Posted: Mon Jul 19, 2010 9:52 pm
by hybrid
Hmm, should work. Not sure, if it's safe, though. Maybe BlindSide or Nadro can give a hint.

Posted: Tue Jul 20, 2010 2:52 am
by BlindSide
Are you using an AMD video card? I found some can't receive arrays in GLSL properly, not sure if that was fixed or not.

Posted: Tue Jul 20, 2010 3:22 am
by wing64
Thanks for reply both hybrid & BlindSide.
@BlindSide:
Yes i used AMD video card.