Restoring SDL's GL context after changing shaders

I’m switching between 2D graphics (using SDL) and 3D graphics (using WebGL) and back. The switching is done roughly as follows:

context2D = SDL_GL_GetCurrentContext();
context3D = SDL_GL_CreateContext(window);
// do the 3D work here
SDL_GL_MakeCurrent(window, context2D);

This usually works fine, but now I’m experimenting with using shaders and after switching back to SDL’s 2D context nothing is being rendered. My program is running (for example I can see window size changes) but the output is entirely black.

Evidently my shader reprogramming is interfering with SDL’s 2D rendering. What do I need to do, additional to saving and restoring SDL’s context, to make my output visible again?