Well, there’s a solution for post - you can use object ID channel from render elemetns (assign this ID by selecting object and right clicking, then object properties->G-buffer object ID). As the result - you will have color masks of objects. Or use material ID instead…
P.S. Don’t forget to check “use filtering” (if you don’t use feather in post)