cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

spectral
Adept II
Adept II

Bug in SDK 2.4 : "if"

Hi,

I use the following code, it display 'rayType', the printed value is always RAYTYPE_DIFFUSE. 

        printf("%d\n", nextEventPath.rayType);

        if (nextEventPath.rayType == RAYTYPE_DIFFUSE) {....}



Like this the application DOES NOT ENTER into the IF !

If I do this :

        printf("%d\n", nextEventPath.rayType);

        nextEventPath.rayType = RAYTYPE_DIFFUSE;

        if (nextEventPath.rayType == RAYTYPE_DIFFUSE) {....}



It works !

 

So, I don't know why, it 'print' that the value is DISPLAY_VALUE but it sounds that there is a problem with the IF.

I work on the CPU !

0 Kudos
Reply
3 Replies
Jawed
Adept II
Adept II

Bug in SDK 2.4 : "if"

What happens if the printf is set to print some other variable?

0 Kudos
Reply
himanshu_gautam
Grandmaster
Grandmaster

Bug in SDK 2.4 : "if"

Can you check if it is a problem with printf or with if condition. Does tha same happen if you remove printf statement.

0 Kudos
Reply
gat3way
Journeyman III
Journeyman III

Bug in SDK 2.4 : "if"

You've got to try to place the printf() inside the if { ... } block, results are interesting with all SDK versions, including 2.4, hehe :)

I think I reported that a while ago but it's not fixed in 2.4...

0 Kudos
Reply