draw_handler on top of Rendered shading mode I'm using bpy.types.SpaceView3D.draw_handler_add and the gpu/bgl/blf library to draw some labels in the 3D view. The handler is created like this:

self._handle = bpy.types.SpaceView3D.draw_handler_add(self.draw_callback,
                                                      (context,),
                                                      'WINDOW',
                                                      'POST_PIXEL')


This draws everything fine when in Solid, Wireframe or LookDev shading mode, but shows nothing when in Rendered shading mode - for both Cycles and Eevee.





Is it possible to draw on top of the rendered shading mode in python? Maybe using the new Overlays system?
Ok, I'm an idiot.

For future googlers, if you're using POST_PIXEL it should draw on top of all shading modes no problem.

The reason it wasn't working for me was because, hiding in my code, I had:

if context.space_data.shading.type == 'RENDERED':
    return


i.e. at some point in the past I deliberately prevented it from drawing on top of rendered shading mode, probably to be consistent with other overlays in Blender 2.7.