Hey there,
What does UNITY_INITIALIZE_OUTPUT() do? I need the exact source for it. Thanks. ![]()
-Steve
Hey there,
What does UNITY_INITIALIZE_OUTPUT() do? I need the exact source for it. Thanks. ![]()
-Steve
From HLSLSupport.cginc (found in [Unity Install Folder]/Data/CGIncludes) :
#if defined(UNITY_COMPILER_HLSL)
#define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0;
#else
#define UNITY_INITIALIZE_OUTPUT(type,name)
#endif
So, it does nothing unless the HLSL compiler is compiling.
In that case it sets its value to a typecasted zero. That way the compiler wonโt complain about uninitialized output values.
Ah, thanks.
Now I know, hopefully this will be useful to someone else too.
The general resource is the built-in shaders, which are available at the top of the forum. Since 4.1 or so, the CGIncludes are in there as well, so you donโt have to fish them out of your Unity install.