Select hard edges for mask


I am wondering if it’s possible to -more or less- autoselect the hard edges/verts of a static mesh and pipe this into a mask of sorts? I know about post-processing shaders but those aren’t going to fly for what we need.
Things have to happen before displacement and afaik that rules any post-processing operation out.
Any help -whether a 1 on 1 possibility or some kind of alternative- would be hugely appreciated!