| McZonk December 10, 2004, 12:00 PM |
|
I try to use dynamic arrays in Cg, with the fp40 profile for Nvidia Geforce 6 cards. But if i compile the source program produce the following Simple Loop in Cg, just to test it. Should sum all lightcolors in lights[].
void main(
out float3 outcolor : COLOR,
uniform float3 lights[]
) {
for(int i = 0; i < lights.length; i++) {
outcolor += lights[i];
}
}
|
This is the output. There are no instructions left. But where is my loop? Where the cgc thinks the array has a length of 0.
!!ARBfp1.0
OPTION NV_fragment_program2;
# cgc version 1.3.0001, build date Aug 4 2004 10:01:10
# command line args: -profile fp40
# source file: mlight.cg
#vendor NVIDIA Corporation
#version 1.0.02
#profile fp40
#program main
#semantic main.lights
#var float3 outcolor : : : 0 : 0
PARAM c[1] = { program.local[0] };
TEMP RC;
TEMP HC;
# 0 instructions, 0 R-regs, 0 H-regs
|
I known I can use a constant array size, but this is not what i want.
|