Immediate mode drawing in AfterPostProcess step is cut off if HDRP dynamic resolution scaling is in use
If I draw something in immediate mode in the AfterPostProcess step and I'm using HDRP's dynamic resolution scaling, the resulting shapes will be clipped to the bottom corner of the screen. If the scale is at 50%, for example, then only the bottom left quadrant of the screen gets anything rendered to it.
There should be a small solid hexagon on the floor. The center of the viewport is near the top right corner of this image; note how the small hexagon's right side has been cut off there.
I originally figured this was a Unity bug, since I'd seen similar behavior from other custom passes run in that step. This Unity forum thread describes some of the issues, although I think the bug described in the OP got fixed a while ago. Note how I got varying forms of the problem in this post: one shader was clipped and scaled, whilst another was only scaled. Neither were only clipped!
This makes me wonder if the bug is in the shader or how the Shapes custom passes work, rather than being a Unity bug.
Also, since it's a bit of a nuisance to set all of this up (it took me an embarrassing number of tries to get dynamic resolution to work in a new project...), I can submit a project demonstrating the bug if desired!