c# - Counting an Array XNA HLSL -
wondering how count array in hsls? say, have array declared in our effect file:
float2 position[1];
and inside our source set parameter else instance:
effect.parameter["position"].setvalue(myvector2array);
under shadering function how count array? similar to:
float4 ps_function(float2 tex : texcoord0) : color0 { int size = position.count(); }
thanks in advance :]
the simple way declare constant define array size:
const static int max_positions = 1 float2 position[max_positions];
Comments
Post a Comment