summaryrefslogtreecommitdiffstats
path: root/src/opengl/meson.build
blob: 59ba9213a4cca539ca57f96279ea9c3d5b02ae07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
opengl_build = get_option('opengl')
opengl_link = get_option('gl-proc-addr')

if host_machine.system() == 'windows' or host_machine.system().endswith('bsd') or \
   host_machine.system() == 'dragonfly'
    libdl = declare_dependency()
else
    libdl = cc.find_library('dl', required : opengl_link)
endif
opengl_link = opengl_link.require(libdl.found())
components.set('opengl', opengl_build.allowed())
components.set('gl-proc-addr', opengl_link.allowed())

if opengl_build.allowed()
  sources += [
    'opengl/context.c',
    'opengl/formats.c',
    'opengl/loader_gl.c',
    'opengl/loader_egl.c',
    'opengl/gpu.c',
    'opengl/gpu_tex.c',
    'opengl/gpu_pass.c',
    'opengl/swapchain.c',
    'opengl/utils.c',
  ]

  if opengl_link.allowed()
    build_deps += libdl
    tests += 'opengl_surfaceless.c'
  endif

  gl_extensions = [
    'GL_AMD_pinned_memory',
    'GL_ARB_buffer_storage',
    'GL_ARB_compute_shader',
    'GL_ARB_framebuffer_object',
    'GL_ARB_get_program_binary',
    'GL_ARB_invalidate_subdata',
    'GL_ARB_pixel_buffer_object',
    'GL_ARB_program_interface_query',
    'GL_ARB_shader_image_load_store',
    'GL_ARB_shader_storage_buffer_object',
    'GL_ARB_sync',
    'GL_ARB_texture_float',
    'GL_ARB_texture_gather',
    'GL_ARB_texture_rg',
    'GL_ARB_timer_query',
    'GL_ARB_uniform_buffer_object',
    'GL_ARB_vertex_array_object',
    'GL_EXT_EGL_image_storage',
    'GL_EXT_color_buffer_float',
    'GL_EXT_color_buffer_half_float',
    'GL_EXT_texture3D',
    'GL_EXT_texture_format_BGRA8888',
    'GL_EXT_texture_integer',
    'GL_EXT_texture_norm16',
    'GL_EXT_texture_rg',
    'GL_EXT_unpack_subimage',
    'GL_KHR_debug',
    'GL_OES_EGL_image',
    'GL_OES_EGL_image_external',
    'EGL_EXT_image_dma_buf_import',
    'EGL_EXT_image_dma_buf_import_modifiers',
    'EGL_EXT_platform_base',
    'EGL_KHR_debug',
    'EGL_KHR_image_base',
    'EGL_MESA_image_dma_buf_export',
    'EGL_MESA_platform_surfaceless',
  ]

  # Generate GL loader
  subdir('include/glad')
else
  glad_dep = []
  sources += 'opengl/stubs.c'
endif