OpenCL COP: Input default value not matching the output.

   282   2   2
User Avatar
Member
578 posts
Joined: 8月 2014
Offline
I'm currently delving into OpenCL (mainly for dealing with COPs).

Assuming that bg_normalhas an RGBA signature, why I am getting RGBA(0, 0.5, 0.5, 1.0) instead of RGBA(0.5, 0.5, 1.0, 1.0) as a result of running the code listed below?

#bind layer bg_normal? float4 val=set(0.5f,0.5f,1.0f,1.0f)
#bind layer fg_normal? float4 val=set(0.5f,0.5f,1.0f,1.0f)
#bind layer !&combined
@KERNEL
{
    @combined.set(@bg_normal);
}

Might the culprit be that I recently had to switch to nvidia-driver 565.x (which has all sorts of known problems), or is it that the declaration of vector4 optional input should look differently?
User Avatar
Member
123 posts
Joined: 12月 2019
Offline
I am actually surprised that it managed to output something here, because the syntaxe for valflag expects braces {}for vector values https://www.sidefx.com/docs/houdini/vex/ocl.html#target-flags [www.sidefx.com]

Using braces should output the expected RGBA(0.5, 0.5, 1.0, 1.0) value :

#bind layer bg_normal? float4 val={0.5,0.5,1,1}
#bind layer fg_normal? float4 val={0.5,0.5,1,1}
Houdini Pipeline Supervisor @ TAT Studio
User Avatar
Member
578 posts
Joined: 8月 2014
Offline
Gosh, I guess old habits die hard.
Thanks for pointing this error out. I too find it surprising that the compiler didn't detect it.
  • Quick Links