Added context lost optimization to Program3DResource as well