# Unity Manual Instance Example Shader contains errors

The Unity Manual has a page on GPU instancing. One of the examples, titled "Adding instancing to vertex and fragment Shaders", causes the following errors to printed to the console when saved in a Shader file:

... unrecognized identifier 'UNITY_INSTANCING_BUFFER_START' at line ... (on d3d11)
... not enough actual parameters for macro 'UNITY_ACCESS_INSTANCED_PROP' at line ... (on d3d11)


This error message does not make any sense. The identifier is supposed to be created in the UnityInstancing.cginc file, if the render target is supported. This thing is, d3d11 is supported:

Line 211: #ifdef UNITY_INSTANCING_AOS
#define UNITY_INSTANCING_BUFFER_START(buf)
...
#define UNITY_INSTANCING_BUFFER_END(arr)
...
#endif

Line 41: #if defined(SHADER_API_D3D11) || ...
#define UNITY_INSTANCING_AOS
#endif


My question:

Why does Unity say that these operations are not supported on this platform?

• This sounds like an issue to report to the Unity engine development & documentation teams. Sep 21 '18 at 19:18

To solve this problem, I had a look at the copy of my (unaltered) UnityInstancing.cginc included with my own version of Unity. The UNITY_INSTANCING_BUFFER_START function does not exist in my copy, instead it is called UNITY_INSTANCING_CBUFFER_START. The UNITY_ACCESS_INSTANCED_PROP function also only takes one argument in my version.