/Engine/Source/Runtime/Engine/Public/MaterialShared.h
Returns the number of samplers used in this material, or -1 if the material does not have a valid shader map (compile error or still compiling).
int32 GetSamplerUsage() const