cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

rahulgarg
Adept II

dcl_input ?

can somebody explain this instruction?

I am having a hard time wrapping my head around dcl_input.
Can somebody explain what it does and why its required?
Secondly can someone explain the registers vWinCoord0 and v0,v1 etc?
They appear to be special registers.

Note that I am not from a graphics background so please avoid graphics related explainations.
0 Likes
3 Replies
rahulgarg
Adept II

Also, vWinCoord0 seems to be the position or id of the thread within the domain.
Is this correct?
0 Likes

Rahul,
dcl_input is the method of declaring to the compiler that you will be using a position coordinate register. vWinCoord0 gives the current id of the running thread in a euclidean space, i.e. it's x,y coordinates. This value is in the range that you specify using the CALdomain structure for calCtxRunProgram function. There are two methods of getting this information however. vWinCoord0 is the default method of getting the position of the thread in the domain. The other method is by setting up interpolated coordinates over a specific range and using an extension to the CAL api to do this. The dcl in the kernel lets the compiler and the runtime known which method you plan on using. This is what brook does and uses the v0, v1, etc... which are just multiple interpolated input values in the euclidean space. Most users won't need to worry about v0, v1, but if you want to learn how it is setup, you would need to dig into the brook+ source code in the runtime layer.

0 Likes

Thanks for the info. I am also doing some experiments by copying vWinCoord0 to the output to see just what is contained in the register.
0 Likes