class_docstr: A class holding OpenGL machinery used by MeshRasterizerOpenGL.
class_docstr_tok: ["A","class","holding","OpenGL","machinery","used","by","MeshRasterizerOpenGL","."]
docstr: Compile the vertex, geometry, and fragment shaders and link them into an OpenGL
  program. The shader sources are strongly inspired by https://github.com/tensorflow/
  graphics/blob/master/tensorflow_graphics/rendering/opengl/rasterization_backend.py.
  
  Returns:
      An OpenGL program for mesh rasterization.
docstr_tok: ["Compile","the","vertex",",","geometry",",","and","fragment","shaders","and","link","them","into","an","OpenGL","program",".","The","shader","sources","are","strongly","inspired","by","https",":","\/\/github.com\/tensorflow\/","graphics\/blob\/master\/tensorflow_graphics\/rendering\/opengl\/rasterization_backend.py",".","Returns",":","An","OpenGL","program","for","mesh","rasterization","."]
code: def _compile_and_link_gl_program():
      """
      Compile the vertex, geometry, and fragment shaders and link them into an OpenGL
      program. The shader sources are strongly inspired by https://github.com/tensorflow/
      graphics/blob/master/tensorflow_graphics/rendering/opengl/rasterization_backend.py.
  
      Returns:
          An OpenGL program for mesh rasterization.
      """
      program = gl.glCreateProgram()
      shader_objects = []
  
      for shader_string, shader_type in zip(
          [vertex_shader, geometry_shader, fragment_shader],
          [
              gl.GL_VERTEX_SHADER,
              gl.GL_GEOMETRY_SHADER,
              gl.GL_FRAGMENT_SHADER,
          ],
      ):
          shader_objects.append(gl.glCreateShader(shader_type))
          gl.glShaderSource(shader_objects[-1], shader_string)
  
          gl.glCompileShader(shader_objects[-1])
          status = gl.glGetShaderiv(
              shader_objects[-1], gl.GL_COMPILE_STATUS
          )
          if status == gl.GL_FALSE:
              gl.glDeleteShader(shader_objects[-1])
              gl.glDeleteProgram(program)
              error_msg = gl.glGetShaderInfoLog(
                  shader_objects[-1]
              ).decode("utf-8")
              raise RuntimeError(f"Compilation failure:\n {error_msg}")
  
          gl.glAttachShader(program, shader_objects[-1])
          gl.glDeleteShader(shader_objects[-1])
  
      gl.glLinkProgram(program)
      status = gl.glGetProgramiv(program, gl.GL_LINK_STATUS)
  
      if status == gl.GL_FALSE:
          gl.glDeleteProgram(program)
          error_msg = gl.glGetProgramInfoLog(program)
          raise RuntimeError(f"Link failure:\n {error_msg}")
  
      return program
  
imports: import warnings
  from typing import Optional, Tuple, Union
  import numpy
  import OpenGL.GL
  import pycuda.gl
  import torch
  import torch.nn
  from pytorch3d.structures.meshes import Meshes
  from ..cameras import FoVOrthographicCameras, FoVPerspectiveCameras
  from ..mesh.rasterizer import Fragments, RasterizationSettings
  from ..utils import parse_image_size
  from .opengl_utils import _torch_to_opengl, global_device_context_store
label_desc: Use image node_id 7 for calling the _OpenGLMachinery obj's underlying member method code with example usage: obj._compile_and_link_gl_program() and returns: program