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

Popular posts from this blog

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -