GLSL |
[Oct. 22nd, 2009|11:05 pm] |
Vobšem uz ATI kartes šitais strādā, bet uz NVIDIA nē:
float i = 1.0;
while (i < 256.0) {
i *= 2.0;
}
Vot nez kāpēc, lai strādātu uz NVIDIA vajag kaut kā tā:
float i = 1.0;
float j = 1.0;
while (j < 8.0) {
i *= 2.0;
j += 1.0;
}
Kāpēc tas tā? |
|
|
Comments: |
Incanti. A tu paskaties, kā tas nokompilējas asemblerā - droši vien tām videokartēm priekš lūpošanās ir specifiski reģistri un instrukcijas, kam varētu būt savi ierobežojumi. Atradu gūglē: "LOOP/ENDLOOP and REP/ENDREP blocks involve a loop counter that indicates the number of times the instructions between the LOOP/REP and ENDLOOP/ENDREP are executed. Looping blocks have a number of significant imitations. First, the loop counter can not be computed at run time; it must be specified as a program parameter. Second, the number of loop iterations is limited to the value MAX_PROGRAM_LOOP_COUNT_NV, which must be at least 255. Third, only a limited amount of nesting is supported -- a fragment program will fail to load if a LOOP or REP instruction is nested inside MAX_PROGRAM_LOOP_DEPTH_NV or more LOOP/ENDLOOP or REP/ENDREP blocks."
| From: | snauts |
Date: | October 23rd, 2009 - 12:21 am |
---|
| | | (Link) |
|
Paldies! Ko konkrēti tu gūglēji?
Šķiet iegūglēju "nvidia multiply loop counter". "nvidia loop count" arī dod interesantu infu. | |