Only instancing constant buffers can have struct variables

I have a custom shader that spits out a error and I can’t really figure out why.

Fragment program ‘Fragment’: struct variable ‘UnityPerMaterial’ is ignored. only instancing constant buffers can have struct variables.

In build the depth and shadow passes seem to render but not the regular pass. So objects with the shaders cast shadows and render into the depth pass (get AO from them) but nothing more.

Including the shader.

8682084–1170534–My TCP2 Shader.shader (22.8 KB)

Hi, I’ve encounterd a similar issue whereas a CBuffer is recognized as a struct variable by Unity’s shader compiler. Have you figured out the cause & solution?