It will always say “Material property is found in another cbuffer than UnityPerMaterial”, no matter the keyword is enabled or not. It does not make any sense to me.
I am using 2019.4.17f1. I am encounter a performance issue.
I have two version of shader. One is a normal shader(A), the other one(B) have UnityPerMaterial and UnityPerDraw declared. In the scenaro of srp batcher disabled. The renderthread of using A is faster of using B.
From the renderdoc, I can see that A is updating unity_objectToWorld by glUniform4fv. However, B is updating unity_objectToWorld by glBufferSubData. I feel refresh the all buffer to just update one unity_objectToWorld is the reason why B is slower than A.
I don’t know is there any good way to deal with this problem. CB generation is totally determined by shader. That is, if I declare a CBUFFER_START in the shader, I must use the CB ways to update the value. There is no way for me to use glUniform4fv.
The problem is some of target devices can support srp batcher but some of can not. I am trying to determine enable/disable srp batcher at runtime(Easy), and, for the part of devices disable srp, the performance is same as using shader which CBUFFER declarations are removed(Seems not possible now).