From e8e4dd195f6079bc11116197142347a583a60081 Mon Sep 17 00:00:00 2001 From: Romain Beguet Date: Sun, 6 Mar 2022 18:58:17 +0100 Subject: [PATCH] Add initial support for compute shaders. --- opengl/src/generated/gl-api.ads | 516 +++++++++--------- .../generated/gl-load_function_pointers.adb | 273 ++++----- opengl/src/implementation/gl-compute.adb | 48 ++ opengl/src/implementation/gl-enums-getter.ads | 6 + opengl/src/implementation/gl-memory.adb | 24 + opengl/src/interface/gl-compute.ads | 23 + opengl/src/interface/gl-memory.ads | 58 ++ opengl/src/interface/gl-objects-shaders.ads | 6 +- opengl/src/specs/gl-api.spec | 24 + tests/opengl-test.gpr | 2 +- tests/src/gl/gl_test-compute-shader.glsl | 10 + tests/src/gl/gl_test-compute.adb | 139 +++++ 12 files changed, 740 insertions(+), 389 deletions(-) create mode 100644 opengl/src/implementation/gl-compute.adb create mode 100644 opengl/src/implementation/gl-memory.adb create mode 100644 opengl/src/interface/gl-compute.ads create mode 100644 opengl/src/interface/gl-memory.ads create mode 100644 tests/src/gl/gl_test-compute-shader.glsl create mode 100644 tests/src/gl/gl_test-compute.adb diff --git a/opengl/src/generated/gl-api.ads b/opengl/src/generated/gl-api.ads index 434405d8..f6ca4a88 100644 --- a/opengl/src/generated/gl-api.ads +++ b/opengl/src/generated/gl-api.ads @@ -185,246 +185,252 @@ private package GL.API is pragma Convention (StdCall, T73); type T74 is access procedure (P1 : Debug_Proc; P2 : System.Address); pragma Convention (StdCall, T74); - type T75 is access function (P1 : Enums.Getter.String_Parameter; P2 : UInt) return C.Strings.chars_ptr; + type T75 is access procedure (P1 : Enums.Getter.Parameter; P2 : UInt; P3 : access Int); pragma Convention (StdCall, T75); - type T76 is access procedure (P1 : Colors.Color); + type T76 is access function (P1 : Enums.Getter.String_Parameter; P2 : UInt) return C.Strings.chars_ptr; pragma Convention (StdCall, T76); - type T77 is access procedure (P1 : Double); + type T77 is access procedure (P1 : Colors.Color); pragma Convention (StdCall, T77); - type T78 is access procedure (P1 : Connection_Mode; P2 : Size; P3 : Size; P4 : Size); + type T78 is access procedure (P1 : Double); pragma Convention (StdCall, T78); - type T79 is access procedure (P1 : Connection_Mode; P2 : Size; P3 : Unsigned_Numeric_Type; P4 : Low_Level.IntPtr; P5 : Size); + type T79 is access procedure (P1 : Connection_Mode; P2 : Size; P3 : Size; P4 : Size); pragma Convention (StdCall, T79); - type T80 is access procedure (P1 : Connection_Mode; P2 : UInt; P3 : Unsigned_Numeric_Type; P4 : UInt; P5 : Int); + type T80 is access procedure (P1 : Connection_Mode; P2 : Size; P3 : Unsigned_Numeric_Type; P4 : Low_Level.IntPtr; P5 : Size); pragma Convention (StdCall, T80); - type T81 is access procedure (P1 : Connection_Mode; P2 : UInt); + type T81 is access procedure (P1 : Connection_Mode; P2 : UInt; P3 : Unsigned_Numeric_Type; P4 : UInt; P5 : Int); pragma Convention (StdCall, T81); - type T82 is access procedure (P1 : Connection_Mode; P2 : UInt; P3 : UInt); + type T82 is access procedure (P1 : Connection_Mode; P2 : UInt); pragma Convention (StdCall, T82); - type T83 is access procedure (P1 : UInt); + type T83 is access procedure (P1 : Connection_Mode; P2 : UInt; P3 : UInt); pragma Convention (StdCall, T83); - type T84 is access procedure (P1 : GL.Attributes.Attribute; P2 : UInt); + type T84 is access procedure (P1 : UInt); pragma Convention (StdCall, T84); - type T85 is access procedure (P1 : Buffers.Draw_Buffer_Index; P2, P3 : Blending.Blend_Factor); + type T85 is access procedure (P1 : GL.Attributes.Attribute; P2 : UInt); pragma Convention (StdCall, T85); - type T86 is access procedure (P1, P2, P3, P4 : Blending.Blend_Factor); + type T86 is access procedure (P1 : Buffers.Draw_Buffer_Index; P2, P3 : Blending.Blend_Factor); pragma Convention (StdCall, T86); - type T87 is access procedure (P1 : Buffers.Draw_Buffer_Index; P2, P3, P4, P5 : Blending.Blend_Factor); + type T87 is access procedure (P1, P2, P3, P4 : Blending.Blend_Factor); pragma Convention (StdCall, T87); - type T88 is access procedure (P1, P2, P3, P4 : Colors.Component); + type T88 is access procedure (P1 : Buffers.Draw_Buffer_Index; P2, P3, P4, P5 : Blending.Blend_Factor); pragma Convention (StdCall, T88); - type T89 is access procedure (P1 : Blending.Equation); + type T89 is access procedure (P1, P2, P3, P4 : Colors.Component); pragma Convention (StdCall, T89); - type T90 is access procedure (P1 : Buffers.Draw_Buffer_Index; P2 : Blending.Equation); + type T90 is access procedure (P1 : Blending.Equation); pragma Convention (StdCall, T90); - type T91 is access procedure (P1, P2 : Blending.Equation); + type T91 is access procedure (P1 : Buffers.Draw_Buffer_Index; P2 : Blending.Equation); pragma Convention (StdCall, T91); - type T92 is access procedure (P1 : Buffers.Draw_Buffer_Index; P2, P3 : Blending.Equation); + type T92 is access procedure (P1, P2 : Blending.Equation); pragma Convention (StdCall, T92); - type T93 is access procedure (P1 : Enums.Point_Param; P2 : Single); + type T93 is access procedure (P1 : Buffers.Draw_Buffer_Index; P2, P3 : Blending.Equation); pragma Convention (StdCall, T93); - type T94 is access procedure (P1 : UInt; P2 : Buffers.Explicit_Color_Buffer_List); + type T94 is access procedure (P1 : Enums.Point_Param; P2 : Single); pragma Convention (StdCall, T94); - type T95 is access procedure (P1 : Buffers.Color_Buffer_Selector; P2 : Low_Level.Zero; P3 : Colors.Color); + type T95 is access procedure (P1 : UInt; P2 : Buffers.Explicit_Color_Buffer_List); pragma Convention (StdCall, T95); - type T96 is access procedure (P1 : Low_Level.Enums.Only_Color_Buffer; P2 : Buffers.Draw_Buffer_Index; P3 : Colors.Color); + type T96 is access procedure (P1 : Buffers.Color_Buffer_Selector; P2 : Low_Level.Zero; P3 : Colors.Color); pragma Convention (StdCall, T96); - type T97 is access procedure (P1 : Low_Level.Enums.Only_Depth_Buffer; P2 : Low_Level.Zero; P3 : access constant Buffers.Depth); + type T97 is access procedure (P1 : Low_Level.Enums.Only_Color_Buffer; P2 : Buffers.Draw_Buffer_Index; P3 : Colors.Color); pragma Convention (StdCall, T97); - type T98 is access procedure (P1 : Low_Level.Enums.Only_Stencil_Buffer; P2 : Low_Level.Zero; P3 : access constant Buffers.Stencil_Index); + type T98 is access procedure (P1 : Low_Level.Enums.Only_Depth_Buffer; P2 : Low_Level.Zero; P3 : access constant Buffers.Depth); pragma Convention (StdCall, T98); - type T99 is access procedure (P1 : Low_Level.Enums.Only_Depth_Stencil_Buffer; P2 : Low_Level.Zero; P3 : Buffers.Depth; P4 : Buffers.Stencil_Index); + type T99 is access procedure (P1 : Low_Level.Enums.Only_Stencil_Buffer; P2 : Low_Level.Zero; P3 : access constant Buffers.Stencil_Index); pragma Convention (StdCall, T99); - type T100 is access procedure (P1 : Culling.Face_Selector; P2 : Compare_Function; P3 : Int; P4 : UInt); + type T100 is access procedure (P1 : Low_Level.Enums.Only_Depth_Stencil_Buffer; P2 : Low_Level.Zero; P3 : Buffers.Depth; P4 : Buffers.Stencil_Index); pragma Convention (StdCall, T100); - type T101 is access procedure (P1 : Culling.Face_Selector; P2, P3, P4 : Buffers.Stencil_Action); + type T101 is access procedure (P1 : Culling.Face_Selector; P2 : Compare_Function; P3 : Int; P4 : UInt); pragma Convention (StdCall, T101); - type T102 is access procedure (P1 : Culling.Face_Selector; P2 : UInt); + type T102 is access procedure (P1 : Culling.Face_Selector; P2, P3, P4 : Buffers.Stencil_Action); pragma Convention (StdCall, T102); - type T103 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4 : Size; P5 : Low_Level.Zero; P6 : Size; P7 : Objects.Textures.Image_Source); + type T103 is access procedure (P1 : Culling.Face_Selector; P2 : UInt); pragma Convention (StdCall, T103); - type T104 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3, P4 : Int; P5, P6 : Size; P7 : Pixels.Data_Format; P8 : Pixels.Data_Type; P9 : Objects.Textures.Image_Source); + type T104 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4 : Size; P5 : Low_Level.Zero; P6 : Size; P7 : Objects.Textures.Image_Source); pragma Convention (StdCall, T104); - type T105 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4 : Size); + type T105 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3, P4 : Int; P5, P6 : Size; P7 : Pixels.Data_Format; P8 : Pixels.Data_Type; P9 : Objects.Textures.Image_Source); pragma Convention (StdCall, T105); - type T106 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5 : Size; P6 : Low_Level.Zero; P7 : Size; P8 : Objects.Textures.Image_Source); + type T106 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4 : Size); pragma Convention (StdCall, T106); - type T107 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5 : Size); + type T107 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5 : Size; P6 : Low_Level.Zero; P7 : Size; P8 : Objects.Textures.Image_Source); pragma Convention (StdCall, T107); - type T108 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5, P6 : Size; P7 : Low_Level.Zero; P8 : Pixels.Data_Format; P9 : Pixels.Data_Type; P10 : Objects.Textures.Image_Source); + type T108 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5 : Size); pragma Convention (StdCall, T108); - type T109 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5, P6 : Size; P7 : Low_Level.Zero; P8 : Size; P9 : Objects.Textures.Image_Source); + type T109 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5, P6 : Size; P7 : Low_Level.Zero; P8 : Pixels.Data_Format; P9 : Pixels.Data_Type; P10 : Objects.Textures.Image_Source); pragma Convention (StdCall, T109); - type T110 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5, P6 : Size); + type T110 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5, P6 : Size; P7 : Low_Level.Zero; P8 : Size; P9 : Objects.Textures.Image_Source); pragma Convention (StdCall, T110); - type T111 is access procedure (P1 : Int); + type T111 is access procedure (P1 : Low_Level.Enums.Texture_Kind; P2 : Objects.Textures.Mipmap_Level; P3 : Pixels.Internal_Format; P4, P5, P6 : Size); pragma Convention (StdCall, T111); - type T112 is access procedure (P1 : Low_Level.Enums.Texture_Kind); + type T112 is access procedure (P1 : Int); pragma Convention (StdCall, T112); - type T113 is access procedure (P1 : UInt; P2 : Objects.Textures.Mipmap_Level); + type T113 is access procedure (P1 : Low_Level.Enums.Texture_Kind); pragma Convention (StdCall, T113); - type T114 is access procedure (P1 : UInt; P2 : Objects.Textures.Mipmap_Level; P3, P4, P5 : Int; P6, P7, P8 : Size); + type T114 is access procedure (P1 : UInt; P2 : Objects.Textures.Mipmap_Level); pragma Convention (StdCall, T114); - type T115 is access procedure (P1 : Size; P2 : out UInt); + type T115 is access procedure (P1 : UInt; P2 : Objects.Textures.Mipmap_Level; P3, P4, P5 : Int; P6, P7, P8 : Size); pragma Convention (StdCall, T115); - type T116 is access procedure (P1 : Size; P2 : UInt_Array); + type T116 is access procedure (P1 : Size; P2 : out UInt); pragma Convention (StdCall, T116); - type T117 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : UInt); + type T117 is access procedure (P1 : Size; P2 : UInt_Array); pragma Convention (StdCall, T117); - type T118 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : UInt; P3 : UInt); + type T118 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : UInt); pragma Convention (StdCall, T118); - type T119 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Low_Level.SizeIPtr; P3 : System.Address; P4 : Objects.Buffers.Buffer_Usage); + type T119 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : UInt; P3 : UInt); pragma Convention (StdCall, T119); - type T120 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Pixels.Internal_Format; P3 : UInt); + type T120 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Low_Level.SizeIPtr; P3 : System.Address; P4 : Objects.Buffers.Buffer_Usage); pragma Convention (StdCall, T120); - type T121 is access function (P1 : Low_Level.Enums.Buffer_Kind; P2 : Objects.Access_Kind) return System.Address; + type T121 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Pixels.Internal_Format; P3 : UInt); pragma Convention (StdCall, T121); - type T122 is access function (P1 : Low_Level.Enums.Buffer_Kind; P2 : Low_Level.IntPtr; P3 : Low_Level.SizeIPtr; P4 : Low_Level.Bitfield) return System.Address; + type T122 is access function (P1 : Low_Level.Enums.Buffer_Kind; P2 : Objects.Access_Kind) return System.Address; pragma Convention (StdCall, T122); - type T123 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Pointer_Param; P3 : out System.Address); + type T123 is access function (P1 : Low_Level.Enums.Buffer_Kind; P2 : Low_Level.IntPtr; P3 : Low_Level.SizeIPtr; P4 : Low_Level.Bitfield) return System.Address; pragma Convention (StdCall, T123); - type T124 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Low_Level.IntPtr; P3 : Low_Level.SizeIPtr; P4 : System.Address); + type T124 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Pointer_Param; P3 : out System.Address); pragma Convention (StdCall, T124); - type T125 is access procedure (P1 : Low_Level.Enums.Buffer_Kind); + type T125 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Low_Level.IntPtr; P3 : Low_Level.SizeIPtr; P4 : System.Address); pragma Convention (StdCall, T125); - type T126 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Param; P3 : out Objects.Access_Kind); + type T126 is access procedure (P1 : Low_Level.Enums.Buffer_Kind); pragma Convention (StdCall, T126); - type T127 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Param; P3 : out Low_Level.Bool); + type T127 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Param; P3 : out Objects.Access_Kind); pragma Convention (StdCall, T127); - type T128 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Param; P3 : out Size); + type T128 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Param; P3 : out Low_Level.Bool); pragma Convention (StdCall, T128); - type T129 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Param; P3 : out Objects.Buffers.Buffer_Usage); + type T129 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Param; P3 : out Size); pragma Convention (StdCall, T129); - type T130 is access procedure (P1 : UInt); + type T130 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Enums.Buffer_Param; P3 : out Objects.Buffers.Buffer_Usage); pragma Convention (StdCall, T130); - type T131 is access procedure (P1 : UInt; P2 : Low_Level.IntPtr; P3 : Low_Level.SizeIPtr); + type T131 is access procedure (P1 : UInt); pragma Convention (StdCall, T131); - type T132 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Low_Level.IntPtr; P3 : Low_Level.SizeIPtr); + type T132 is access procedure (P1 : UInt; P2 : Low_Level.IntPtr; P3 : Low_Level.SizeIPtr); pragma Convention (StdCall, T132); - type T133 is access procedure (P1 : Size; P2 : out UInt); + type T133 is access procedure (P1 : Low_Level.Enums.Buffer_Kind; P2 : Low_Level.IntPtr; P3 : Low_Level.SizeIPtr); pragma Convention (StdCall, T133); - type T134 is access procedure (P1 : Size; P2 : UInt_Array); + type T134 is access procedure (P1 : Size; P2 : out UInt); pragma Convention (StdCall, T134); - type T135 is access procedure (P1 : UInt); + type T135 is access procedure (P1 : Size; P2 : UInt_Array); pragma Convention (StdCall, T135); - type T136 is access procedure (P1 : Size; P2 : out UInt); + type T136 is access procedure (P1 : UInt); pragma Convention (StdCall, T136); - type T137 is access procedure (P1 : Size; P2 : UInt_Array); + type T137 is access procedure (P1 : Size; P2 : out UInt); pragma Convention (StdCall, T137); - type T138 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : Pixels.Internal_Format; P3, P4 : Size); + type T138 is access procedure (P1 : Size; P2 : UInt_Array); pragma Convention (StdCall, T138); - type T139 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : Size; P3 : Pixels.Internal_Format; P4, P5 : Size); + type T139 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : Pixels.Internal_Format; P3, P4 : Size); pragma Convention (StdCall, T139); - type T140 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : UInt); + type T140 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : Size; P3 : Pixels.Internal_Format; P4, P5 : Size); pragma Convention (StdCall, T140); - type T141 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : Enums.Getter.Renderbuffer_Parameter; P3 : out Int); + type T141 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : UInt); pragma Convention (StdCall, T141); - type T142 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : Enums.Getter.Renderbuffer_Parameter; P3 : out Pixels.Internal_Format); + type T142 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : Enums.Getter.Renderbuffer_Parameter; P3 : out Int); pragma Convention (StdCall, T142); - type T143 is access procedure (P1 : Enums.Clamp_Color_Param; P2 : Low_Level.Bool); + type T143 is access procedure (P1 : Low_Level.Enums.Renderbuffer_Kind; P2 : Enums.Getter.Renderbuffer_Parameter; P3 : out Pixels.Internal_Format); pragma Convention (StdCall, T143); - type T144 is access procedure (P1 : Size; P2 : out UInt); + type T144 is access procedure (P1 : Enums.Clamp_Color_Param; P2 : Low_Level.Bool); pragma Convention (StdCall, T144); - type T145 is access procedure (P1 : Size; P2 : UInt_Array); + type T145 is access procedure (P1 : Size; P2 : out UInt); pragma Convention (StdCall, T145); - type T146 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : UInt); + type T146 is access procedure (P1 : Size; P2 : UInt_Array); pragma Convention (StdCall, T146); - type T147 is access function (P1 : Low_Level.Enums.Framebuffer_Kind) return Objects.Framebuffers.Framebuffer_Status; + type T147 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : UInt); pragma Convention (StdCall, T147); - type T148 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Objects.Framebuffers.Attachment_Point; P3 : Low_Level.Enums.Renderbuffer_Kind; P4 : UInt); + type T148 is access function (P1 : Low_Level.Enums.Framebuffer_Kind) return Objects.Framebuffers.Framebuffer_Status; pragma Convention (StdCall, T148); - type T149 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Objects.Framebuffers.Attachment_Point; P3 : UInt; P4 : Objects.Textures.Mipmap_Level); + type T149 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Objects.Framebuffers.Attachment_Point; P3 : Low_Level.Enums.Renderbuffer_Kind; P4 : UInt); pragma Convention (StdCall, T149); - type T150 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Objects.Framebuffers.Attachment_Point; P3 : UInt; P4 : Objects.Textures.Mipmap_Level; P5 : Int); + type T150 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Objects.Framebuffers.Attachment_Point; P3 : UInt; P4 : Objects.Textures.Mipmap_Level); pragma Convention (StdCall, T150); - type T151 is access procedure (P1, P2, P3, P4, P5, P6, P7, P8 : Int; P9 : Low_Level.Bitfield; P10 : Objects.Textures.Magnifying_Function); + type T151 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Objects.Framebuffers.Attachment_Point; P3 : UInt; P4 : Objects.Textures.Mipmap_Level; P5 : Int); pragma Convention (StdCall, T151); - type T152 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Size; P3 : Objects.Framebuffers.Attachment_List); + type T152 is access procedure (P1, P2, P3, P4, P5, P6, P7, P8 : Int; P9 : Low_Level.Bitfield; P10 : Objects.Textures.Magnifying_Function); pragma Convention (StdCall, T152); - type T153 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Size; P3 : Objects.Framebuffers.Attachment_List; P4, P5 : Int; P6, P7 : Size); + type T153 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Size; P3 : Objects.Framebuffers.Attachment_List); pragma Convention (StdCall, T153); - type T154 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Enums.Framebuffer_Param; P3 : Size); + type T154 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Size; P3 : Objects.Framebuffers.Attachment_List; P4, P5 : Int; P6, P7 : Size); pragma Convention (StdCall, T154); - type T155 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Enums.Framebuffer_Param; P3 : Low_Level.Bool); + type T155 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Enums.Framebuffer_Param; P3 : Size); pragma Convention (StdCall, T155); - type T156 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Enums.Framebuffer_Param; P3 : out Size); + type T156 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Enums.Framebuffer_Param; P3 : Low_Level.Bool); pragma Convention (StdCall, T156); - type T157 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Enums.Framebuffer_Param; P3 : out Low_Level.Bool); + type T157 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Enums.Framebuffer_Param; P3 : out Size); pragma Convention (StdCall, T157); - type T158 is access procedure (P1 : Size; P2 : out UInt); + type T158 is access procedure (P1 : Low_Level.Enums.Framebuffer_Kind; P2 : Enums.Framebuffer_Param; P3 : out Low_Level.Bool); pragma Convention (StdCall, T158); - type T159 is access procedure (P1 : Size; P2 : UInt_Array); + type T159 is access procedure (P1 : Size; P2 : out UInt); pragma Convention (StdCall, T159); - type T160 is access function (P1 : UInt) return Boolean; + type T160 is access procedure (P1 : Size; P2 : UInt_Array); pragma Convention (StdCall, T160); - type T161 is access procedure (P1 : UInt; P2 : Low_Level.Enums.Query_Results; P3 : out UInt); + type T161 is access function (P1 : UInt) return Boolean; pragma Convention (StdCall, T161); - type T162 is access procedure (P1 : Low_Level.Enums.Query_Param; P2 : UInt); + type T162 is access procedure (P1 : UInt; P2 : Low_Level.Enums.Query_Results; P3 : out UInt); pragma Convention (StdCall, T162); - type T163 is access procedure (P1 : Low_Level.Enums.Query_Param); + type T163 is access procedure (P1 : Low_Level.Enums.Query_Param; P2 : UInt); pragma Convention (StdCall, T163); - type T164 is access procedure (P1 : Low_Level.Enums.Query_Param; P2, P3 : UInt); + type T164 is access procedure (P1 : Low_Level.Enums.Query_Param); pragma Convention (StdCall, T164); - type T165 is access procedure (P1 : Low_Level.Enums.Query_Param; P2 : UInt); + type T165 is access procedure (P1 : Low_Level.Enums.Query_Param; P2, P3 : UInt); pragma Convention (StdCall, T165); - type T166 is access procedure (P1 : UInt; P2 : Low_Level.Enums.Query_Param); + type T166 is access procedure (P1 : Low_Level.Enums.Query_Param; P2 : UInt); pragma Convention (StdCall, T166); - type T167 is access procedure (P1 : UInt; P2 : Enums.Shader_Param; P3 : out Int); + type T167 is access procedure (P1 : UInt; P2 : Low_Level.Enums.Query_Param); pragma Convention (StdCall, T167); - type T168 is access procedure (P1 : UInt; P2 : Enums.Shader_Param; P3 : out Objects.Shaders.Shader_Type); + type T168 is access procedure (P1 : UInt; P2 : Enums.Shader_Param; P3 : out Int); pragma Convention (StdCall, T168); - type T169 is access function (P1 : Objects.Shaders.Shader_Type) return UInt; + type T169 is access procedure (P1 : UInt; P2 : Enums.Shader_Param; P3 : out Objects.Shaders.Shader_Type); pragma Convention (StdCall, T169); - type T170 is access procedure (P1 : UInt); + type T170 is access function (P1 : Objects.Shaders.Shader_Type) return UInt; pragma Convention (StdCall, T170); - type T171 is access procedure (P1 : UInt; P2 : Size; P3 : Low_Level.Char_Access_Array; P4 : Int_Array); + type T171 is access procedure (P1 : UInt); pragma Convention (StdCall, T171); - type T172 is access procedure (P1 : UInt; P2 : Size; P3 : out Size; P4 : in out String); + type T172 is access procedure (P1 : UInt; P2 : Size; P3 : Low_Level.Char_Access_Array; P4 : Int_Array); pragma Convention (StdCall, T172); - type T173 is access function return UInt; + type T173 is access procedure (P1 : UInt; P2 : Size; P3 : out Size; P4 : in out String); pragma Convention (StdCall, T173); - type T174 is access procedure (P1 : UInt); + type T174 is access function return UInt; pragma Convention (StdCall, T174); - type T175 is access procedure (P1 : UInt; P2 : Enums.Program_Param; P3 : out Int); + type T175 is access procedure (P1 : UInt); pragma Convention (StdCall, T175); - type T176 is access procedure (P1, P2 : UInt); + type T176 is access procedure (P1 : UInt; P2 : Enums.Program_Param; P3 : out Int); pragma Convention (StdCall, T176); - type T177 is access procedure (P1 : UInt; P2 : Size; P3 : out Size; P4 : in out String); + type T177 is access procedure (P1, P2 : UInt); pragma Convention (StdCall, T177); - type T178 is access procedure (P1 : UInt; P2 : Objects.Shaders.Shader_Type; P3 : Enums.Program_Stage_Param; P4 : out Size); + type T178 is access procedure (P1 : UInt; P2 : Size; P3 : out Size; P4 : in out String); pragma Convention (StdCall, T178); - type T179 is access function (P1 : UInt; P2 : Objects.Shaders.Shader_Type; P3 : Interfaces.C.char_array) return Objects.Programs.Subroutine_Index_Type; + type T179 is access procedure (P1 : UInt; P2 : Objects.Shaders.Shader_Type; P3 : Enums.Program_Stage_Param; P4 : out Size); pragma Convention (StdCall, T179); - type T180 is access function (P1 : UInt; P2 : Objects.Shaders.Shader_Type; P3 : Interfaces.C.char_array) return Objects.Programs.Uniform_Location_Type; + type T180 is access function (P1 : UInt; P2 : Objects.Shaders.Shader_Type; P3 : Interfaces.C.char_array) return Objects.Programs.Subroutine_Index_Type; pragma Convention (StdCall, T180); - type T181 is access function (P1 : UInt; P2 : C.char_array) return Uniforms.Uniform; + type T181 is access function (P1 : UInt; P2 : Objects.Shaders.Shader_Type; P3 : Interfaces.C.char_array) return Objects.Programs.Uniform_Location_Type; pragma Convention (StdCall, T181); - type T182 is access procedure (P1 : UInt; P2 : Attributes.Attribute; P3 : C.char_array); + type T182 is access function (P1 : UInt; P2 : C.char_array) return Uniforms.Uniform; pragma Convention (StdCall, T182); - type T183 is access function (P1 : UInt; P2 : C.char_array) return Attributes.Attribute; + type T183 is access procedure (P1 : UInt; P2 : Attributes.Attribute; P3 : C.char_array); pragma Convention (StdCall, T183); - type T184 is access procedure (P1 : Attributes.Attribute; P2 : Component_Count; P3 : Numeric_Type; P4 : Low_Level.Bool; P5 : Size; P6 : Int); + type T184 is access function (P1 : UInt; P2 : C.char_array) return Attributes.Attribute; pragma Convention (StdCall, T184); - type T185 is access procedure (P1 : Attributes.Attribute; P2 : Component_Count; P3 : Numeric_Type; P4 : Size; P5 : Int); + type T185 is access procedure (P1 : Attributes.Attribute; P2 : Component_Count; P3 : Numeric_Type; P4 : Low_Level.Bool; P5 : Size; P6 : Int); pragma Convention (StdCall, T185); - type T186 is access procedure (P1 : Attributes.Attribute); + type T186 is access procedure (P1 : Attributes.Attribute; P2 : Component_Count; P3 : Numeric_Type; P4 : Size; P5 : Int); pragma Convention (StdCall, T186); - type T187 is access procedure (P1 : UInt; P2 : Size; P3 : out Size; P4 : in out UInt_Array); + type T187 is access procedure (P1 : Attributes.Attribute); pragma Convention (StdCall, T187); - type T188 is access procedure (P1 : UInt; P2 : Buffers.Draw_Buffer_Index; P3 : Interfaces.C.char_array); + type T188 is access procedure (P1 : UInt; P2 : Size; P3 : out Size; P4 : in out UInt_Array); pragma Convention (StdCall, T188); - type T189 is access function (P1 : UInt; P2 : Interfaces.C.char_array) return Int; + type T189 is access procedure (P1 : UInt; P2 : Buffers.Draw_Buffer_Index; P3 : Interfaces.C.char_array); pragma Convention (StdCall, T189); - type T190 is access procedure (P1 : Connection_Mode); + type T190 is access function (P1 : UInt; P2 : Interfaces.C.char_array) return Int; pragma Convention (StdCall, T190); - type T191 is access procedure (P1 : UInt; P2 : Int; P3 : Size; P4 : out Size; P5 : out Size; P6 : out GL.Objects.Programs.Active_Attribute; P7 : in out Interfaces.C.char_array); + type T191 is access procedure (P1 : Connection_Mode); pragma Convention (StdCall, T191); - type T192 is access procedure (P1 : UInt; P2 : Size; P3 : Low_Level.Char_Access_Array; P4 : GL.Objects.Programs.Buffer_Mode); + type T192 is access procedure (P1 : UInt; P2 : Int; P3 : Size; P4 : out Size; P5 : out Size; P6 : out GL.Objects.Programs.Active_Attribute; P7 : in out Interfaces.C.char_array); pragma Convention (StdCall, T192); - type T193 is access procedure (P1 : Enums.Patch_Parameter_Int; P2 : Int); + type T193 is access procedure (P1 : UInt; P2 : Size; P3 : Low_Level.Char_Access_Array; P4 : GL.Objects.Programs.Buffer_Mode); pragma Convention (StdCall, T193); - type T194 is access procedure (P1 : Enums.Patch_Parameter_Float_Array; P2 : Single_Array); + type T194 is access procedure (P1 : Enums.Patch_Parameter_Int; P2 : Int); pragma Convention (StdCall, T194); + type T195 is access procedure (P1 : Enums.Patch_Parameter_Float_Array; P2 : Single_Array); + pragma Convention (StdCall, T195); + type T196 is access procedure (P1, P2, P3 : UInt); + pragma Convention (StdCall, T196); + type T197 is access procedure (P1 : Low_Level.Bitfield); + pragma Convention (StdCall, T197); procedure Flush; pragma Import (StdCall, Flush, "glFlush"); procedure Finish; @@ -451,6 +457,7 @@ private package GL.API is pragma Import (StdCall, Get_Color, "glGetFloatv"); procedure Get_Integer (Name : Enums.Getter.Parameter; Target : access Int); pragma Import (StdCall, Get_Integer, "glGetIntegerv"); + Get_Integer_Indexed : T75; procedure Get_Int_Vec4 (Name : Enums.Getter.Parameter; Target : in out Ints.Vector4); pragma Import (StdCall, Get_Int_Vec4, "glGetIntegerv"); procedure Get_Unsigned_Integer (Name : Enums.Getter.Parameter; Target : access UInt); @@ -485,7 +492,7 @@ private package GL.API is pragma Import (StdCall, Get_Light_Color, "glGetLightfv"); function Get_String (Name : Enums.Getter.String_Parameter) return C.Strings.chars_ptr; pragma Import (StdCall, Get_String, "glGetString"); - Get_String_I : T75; + Get_String_I : T76; procedure Enable (Subject : Toggles.Toggle); pragma Import (StdCall, Enable, "glEnable"); procedure Disable (Subject : Toggles.Toggle); @@ -524,8 +531,8 @@ private package GL.API is pragma Import (StdCall, GL_End, "glEnd"); procedure Color (Value : Colors.Color); pragma Import (StdCall, Color, "glColor4fv"); - Secondary_Color : T76; - Fog_Coord : T77; + Secondary_Color : T77; + Fog_Coord : T78; procedure Vertex_Pointer (Count : Int; Data_Type : Signed_Numeric_Type; Stride : Size; Pointer : Int); pragma Import (StdCall, Vertex_Pointer, "glVertexPointer"); procedure Index_Pointer (Data_Type : Signed_Numeric_Type; Stride : Size; Pointer : Int); @@ -538,15 +545,15 @@ private package GL.API is pragma Import (StdCall, Disable_Client_State, "glDisableClientState"); procedure Draw_Arrays (Mode : Connection_Mode; First : Int; Count : Size); pragma Import (StdCall, Draw_Arrays, "glDrawArrays"); - Draw_Arrays_Instanced : T78; + Draw_Arrays_Instanced : T79; procedure Draw_Elements (Mode : Connection_Mode; Count : Size; Index_Type : Unsigned_Numeric_Type; Indices : Low_Level.IntPtr); pragma Import (StdCall, Draw_Elements, "glDrawElements"); - Draw_Elements_Instanced : T79; - Draw_Elements_Base_Vertex : T80; - Draw_Transform_Feedback : T81; - Draw_Transform_Feedback_Stream : T82; - Primitive_Restart_Index : T83; - Vertex_Attrib_Divisor : T84; + Draw_Elements_Instanced : T80; + Draw_Elements_Base_Vertex : T81; + Draw_Transform_Feedback : T82; + Draw_Transform_Feedback_Stream : T83; + Primitive_Restart_Index : T84; + Vertex_Attrib_Divisor : T85; procedure Load_Matrix (Value : Types.Doubles.Matrix4); pragma Import (StdCall, Load_Matrix, "glLoadMatrixd"); procedure Mult_Matrix (Factor : Types.Doubles.Matrix4); @@ -585,21 +592,21 @@ private package GL.API is pragma Import (StdCall, Light_Direction, "glLightfv"); procedure Blend_Func (Src_Factor, Dst_Factor : Blending.Blend_Factor); pragma Import (StdCall, Blend_Func, "glBlendFunc"); - Blend_Func_I : T85; - Blend_Func_Separate : T86; - Blend_Func_Separate_I : T87; - Blend_Color : T88; - Blend_Equation : T89; - Blend_Equation_I : T90; - Blend_Equation_Separate : T91; - Blend_Equation_Separate_I : T92; + Blend_Func_I : T86; + Blend_Func_Separate : T87; + Blend_Func_Separate_I : T88; + Blend_Color : T89; + Blend_Equation : T90; + Blend_Equation_I : T91; + Blend_Equation_Separate : T92; + Blend_Equation_Separate_I : T93; procedure Line_Width (Value : Single); pragma Import (StdCall, Line_Width, "glLineWidth"); procedure Polygon_Mode (Face : Culling.Face_Selector; Value : Rasterization.Polygon_Mode_Type); pragma Import (StdCall, Polygon_Mode, "glPolygonMode"); procedure Set_Point_Size (Value : Single); pragma Import (StdCall, Set_Point_Size, "glPointSize"); - Set_Point_Parameter_Single : T93; + Set_Point_Parameter_Single : T94; procedure Raster_Pos4 (Value : Types.Doubles.Vector4); pragma Import (StdCall, Raster_Pos4, "glRasterPos4dv"); procedure Raster_Pos3 (Value : Types.Doubles.Vector3); @@ -612,26 +619,26 @@ private package GL.API is pragma Import (StdCall, Clear, "glClear"); procedure Draw_Buffer (Mode : Buffers.Explicit_Color_Buffer_Selector); pragma Import (StdCall, Draw_Buffer, "glDrawBuffer"); - Draw_Buffers : T94; + Draw_Buffers : T95; procedure Clear_Color (Red, Green, Blue, Alpha : Colors.Component); pragma Import (StdCall, Clear_Color, "glClearColor"); procedure Clear_Depth (Depth : Buffers.Depth); pragma Import (StdCall, Clear_Depth, "glClearDepth"); procedure Clear_Stencil (Index : Buffers.Stencil_Index); pragma Import (StdCall, Clear_Stencil, "glClearStencil"); - Clear_Accum : T88; - Clear_Buffer : T95; - Clear_Draw_Buffer : T96; - Clear_Buffer_Depth : T97; - Clear_Buffer_Stencil : T98; - Clear_Buffer_Depth_Stencil : T99; + Clear_Accum : T89; + Clear_Buffer : T96; + Clear_Draw_Buffer : T97; + Clear_Buffer_Depth : T98; + Clear_Buffer_Stencil : T99; + Clear_Buffer_Depth_Stencil : T100; procedure Depth_Mask (Value : Low_Level.Bool); pragma Import (StdCall, Depth_Mask, "glDepthMask"); procedure Depth_Func (Func : Compare_Function); pragma Import (StdCall, Depth_Func, "glDepthFunc"); - Stencil_Func_Separate : T100; - Stencil_Op_Separate : T101; - Stencil_Mask_Separate : T102; + Stencil_Func_Separate : T101; + Stencil_Op_Separate : T102; + Stencil_Mask_Separate : T103; procedure Tex_Parameter_Float (Target : Low_Level.Enums.Texture_Kind; Param_Name : Enums.Textures.Parameter; Value : Single); pragma Import (StdCall, Tex_Parameter_Float, "glTexParameterf"); procedure Tex_Parameter_Int (Target : Low_Level.Enums.Texture_Kind; Param_Name : Enums.Textures.Parameter; Value : Int); @@ -688,19 +695,19 @@ private package GL.API is pragma Import (StdCall, Is_Texture, "glIsTexture"); procedure Tex_Image_1D (Target : Low_Level.Enums.Texture_Kind; Level : Objects.Textures.Mipmap_Level; Internal_Format : Pixels.Internal_Format; Width : Size; Border : Low_Level.Zero; Format : Pixels.Data_Format; Data_Type : Pixels.Data_Type; Data : Objects.Textures.Image_Source); pragma Import (StdCall, Tex_Image_1D, "glTexImage1D"); - Compressed_Tex_Image_1D : T103; - Tex_Sub_Image_1D : T104; - Tex_Storage_1D : T105; + Compressed_Tex_Image_1D : T104; + Tex_Sub_Image_1D : T105; + Tex_Storage_1D : T106; procedure Tex_Image_2D (Target : Low_Level.Enums.Texture_Kind; Level : Objects.Textures.Mipmap_Level; Internal_Format : Pixels.Internal_Format; Width, Height : Size; Border : Low_Level.Zero; Format : Pixels.Data_Format; Data_Type : Pixels.Data_Type; Data : Objects.Textures.Image_Source); pragma Import (StdCall, Tex_Image_2D, "glTexImage2D"); - Compressed_Tex_Image_2D : T106; + Compressed_Tex_Image_2D : T107; procedure Tex_Sub_Image_2D (Target : Low_Level.Enums.Texture_Kind; Level : Objects.Textures.Mipmap_Level; X_Offset, Y_Offset : Int; Width, Height : Size; Format : Pixels.Data_Format; Data_Type : Pixels.Data_Type; Data : Objects.Textures.Image_Source); pragma Import (StdCall, Tex_Sub_Image_2D, "glTexSubImage2D"); - Tex_Storage_2D : T107; - Tex_Image_3D : T108; - Compressed_Tex_Image_3D : T109; - Tex_Sub_Image_3D : T104; - Tex_Storage_3D : T110; + Tex_Storage_2D : T108; + Tex_Image_3D : T109; + Compressed_Tex_Image_3D : T110; + Tex_Sub_Image_3D : T105; + Tex_Storage_3D : T111; procedure Tex_Env_Float (Target : Enums.Textures.Env_Target; Param_Name : Enums.Textures.Env_Parameter; Value : Single); pragma Import (StdCall, Tex_Env_Float, "glTexEnvf"); procedure Tex_Env_Int (Target : Enums.Textures.Env_Target; Param_Name : Enums.Textures.Env_Parameter; Value : Int); @@ -727,111 +734,114 @@ private package GL.API is pragma Import (StdCall, Get_Tex_Env_Arr, "glGetTexEnvfv"); procedure Get_Tex_Env_Bool (Target : Enums.Textures.Env_Target; Param_Name : Enums.Textures.Env_Parameter; Value : out Low_Level.Bool); pragma Import (StdCall, Get_Tex_Env_Bool, "glGetTexEnviv"); - Active_Texture : T111; - Generate_Mipmap : T112; - Invalidate_Tex_Image : T113; - Invalidate_Tex_Sub_Image : T114; - Gen_Buffers : T115; - Gen_Transform_Feedbacks : T115; - Delete_Buffers : T116; - Delete_Transform_Feedbacks : T116; - Bind_Buffer : T117; - Bind_Transform_Feedback : T117; - Bind_Buffer_Base : T118; - Buffer_Data : T119; - Texture_Buffer_Data : T120; - Map_Buffer : T121; - Map_Buffer_Range : T122; - Buffer_Pointer : T123; - Buffer_Sub_Data : T124; - Get_Buffer_Sub_Data : T124; - Unmap_Buffer : T125; - Get_Buffer_Parameter_Access_Kind : T126; - Get_Buffer_Parameter_Bool : T127; - Get_Buffer_Parameter_Size : T128; - Get_Buffer_Parameter_Usage : T129; - Invalidate_Buffer_Data : T130; - Invalidate_Buffer_Sub_Data : T131; - Flush_Mapped_Buffer_Range : T132; - Gen_Vertex_Arrays : T133; - Delete_Vertex_Arrays : T134; - Bind_Vertex_Array : T135; - Gen_Renderbuffers : T136; - Delete_Renderbuffers : T137; - Renderbuffer_Storage : T138; - Renderbuffer_Storage_Multisample : T139; - Bind_Renderbuffer : T140; - Get_Renderbuffer_Parameter_Int : T141; - Get_Renderbuffer_Parameter_Internal_Format : T142; + Active_Texture : T112; + Generate_Mipmap : T113; + Invalidate_Tex_Image : T114; + Invalidate_Tex_Sub_Image : T115; + Gen_Buffers : T116; + Gen_Transform_Feedbacks : T116; + Delete_Buffers : T117; + Delete_Transform_Feedbacks : T117; + Bind_Buffer : T118; + Bind_Transform_Feedback : T118; + Bind_Buffer_Base : T119; + Buffer_Data : T120; + Texture_Buffer_Data : T121; + Map_Buffer : T122; + Map_Buffer_Range : T123; + Buffer_Pointer : T124; + Buffer_Sub_Data : T125; + Get_Buffer_Sub_Data : T125; + Unmap_Buffer : T126; + Get_Buffer_Parameter_Access_Kind : T127; + Get_Buffer_Parameter_Bool : T128; + Get_Buffer_Parameter_Size : T129; + Get_Buffer_Parameter_Usage : T130; + Invalidate_Buffer_Data : T131; + Invalidate_Buffer_Sub_Data : T132; + Flush_Mapped_Buffer_Range : T133; + Gen_Vertex_Arrays : T134; + Delete_Vertex_Arrays : T135; + Bind_Vertex_Array : T136; + Gen_Renderbuffers : T137; + Delete_Renderbuffers : T138; + Renderbuffer_Storage : T139; + Renderbuffer_Storage_Multisample : T140; + Bind_Renderbuffer : T141; + Get_Renderbuffer_Parameter_Int : T142; + Get_Renderbuffer_Parameter_Internal_Format : T143; procedure Read_Pixels (X, Y : Int; Width, Height : Size; Format : Pixels.Framebuffer_Format; Data_Type : Pixels.Data_Type; Data : System.Address); pragma Import (StdCall, Read_Pixels, "glReadPixels"); procedure Logic_Op (Value : Framebuffer.Logic_Op); pragma Import (StdCall, Logic_Op, "glLogicOp"); - Clamp_Color : T143; + Clamp_Color : T144; procedure Read_Buffer (Value : Framebuffer.Read_Buffer_Selector); pragma Import (StdCall, Read_Buffer, "glReadBuffer"); - Gen_Framebuffers : T144; - Delete_Framebuffers : T145; - Bind_Framebuffer : T146; - Check_Framebuffer_Status : T147; - Framebuffer_Renderbuffer : T148; - Framebuffer_Texture : T149; - Framebuffer_Texture_Layer : T150; - Blit_Framebuffer : T151; - Invalidate_Framebuffer : T152; - Invalidate_Sub_Framebuffer : T153; - Framebuffer_Parameter_Size : T154; - Framebuffer_Parameter_Bool : T155; - Get_Framebuffer_Parameter_Size : T156; - Get_Framebuffer_Parameter_Bool : T157; - Gen_Queries : T158; - Delete_Queries : T159; - Is_Query : T160; - Get_Query_Object : T161; - Begin_Query : T162; - End_Query : T163; - Begin_Query_Indexed : T164; - End_Query_Indexed : T165; - Query_Counter : T166; - Get_Shader_Param : T167; - Get_Shader_Type : T168; - Create_Shader : T169; - Delete_Shader : T170; - Shader_Source : T171; - Get_Shader_Source : T172; - Compile_Shader : T170; + Gen_Framebuffers : T145; + Delete_Framebuffers : T146; + Bind_Framebuffer : T147; + Check_Framebuffer_Status : T148; + Framebuffer_Renderbuffer : T149; + Framebuffer_Texture : T150; + Framebuffer_Texture_Layer : T151; + Blit_Framebuffer : T152; + Invalidate_Framebuffer : T153; + Invalidate_Sub_Framebuffer : T154; + Framebuffer_Parameter_Size : T155; + Framebuffer_Parameter_Bool : T156; + Get_Framebuffer_Parameter_Size : T157; + Get_Framebuffer_Parameter_Bool : T158; + Gen_Queries : T159; + Delete_Queries : T160; + Is_Query : T161; + Get_Query_Object : T162; + Begin_Query : T163; + End_Query : T164; + Begin_Query_Indexed : T165; + End_Query_Indexed : T166; + Query_Counter : T167; + Get_Shader_Param : T168; + Get_Shader_Type : T169; + Create_Shader : T170; + Delete_Shader : T171; + Shader_Source : T172; + Get_Shader_Source : T173; + Compile_Shader : T171; Release_Shader_Compiler : T71; - Get_Shader_Info_Log : T172; - Create_Program : T173; - Delete_Program : T174; - Get_Program_Param : T175; - Attach_Shader : T176; - Link_Program : T174; - Get_Program_Info_Log : T177; - Get_Program_Stage : T178; - Get_Subroutine_Index : T179; - Get_Subroutine_Uniform_Location : T180; - Use_Program : T174; - Validate_Program : T174; - Get_Uniform_Location : T181; - Bind_Attrib_Location : T182; - Get_Attrib_Location : T183; - Vertex_Attrib_Pointer : T184; - Vertex_AttribI_Pointer : T185; - Vertex_AttribL_Pointer : T185; - Enable_Vertex_Attrib_Array : T186; - Disable_Vertex_Attrib_Array : T186; - Get_Attached_Shaders : T187; - Bind_Frag_Data_Location : T188; - Get_Frag_Data_Location : T189; - Begin_Transform_Feedback : T190; + Get_Shader_Info_Log : T173; + Create_Program : T174; + Delete_Program : T175; + Get_Program_Param : T176; + Attach_Shader : T177; + Link_Program : T175; + Get_Program_Info_Log : T178; + Get_Program_Stage : T179; + Get_Subroutine_Index : T180; + Get_Subroutine_Uniform_Location : T181; + Use_Program : T175; + Validate_Program : T175; + Get_Uniform_Location : T182; + Bind_Attrib_Location : T183; + Get_Attrib_Location : T184; + Vertex_Attrib_Pointer : T185; + Vertex_AttribI_Pointer : T186; + Vertex_AttribL_Pointer : T186; + Enable_Vertex_Attrib_Array : T187; + Disable_Vertex_Attrib_Array : T187; + Get_Attached_Shaders : T188; + Bind_Frag_Data_Location : T189; + Get_Frag_Data_Location : T190; + Begin_Transform_Feedback : T191; End_Transform_Feedback : T71; - Get_Transform_Feedback_Varying : T191; - Transform_Feedback_Varyings : T192; - Set_Patch_Parameter_Int : T193; - Set_Patch_Parameter_Float_Array : T194; + Get_Transform_Feedback_Varying : T192; + Transform_Feedback_Varyings : T193; + Set_Patch_Parameter_Int : T194; + Set_Patch_Parameter_Float_Array : T195; procedure Depth_Range (Near, Far : Double); pragma Import (StdCall, Depth_Range, "glDepthRange"); procedure Viewport (X, Y : Int; Width, Height : Size); pragma Import (StdCall, Viewport, "glViewport"); + Dispatch_Compute : T196; + Memory_Barrier : T197; + Memory_Barrier_By_Region : T197; end GL.API; diff --git a/opengl/src/generated/gl-load_function_pointers.adb b/opengl/src/generated/gl-load_function_pointers.adb index ac2bb49f..0bfc5a83 100644 --- a/opengl/src/generated/gl-load_function_pointers.adb +++ b/opengl/src/generated/gl-load_function_pointers.adb @@ -222,6 +222,9 @@ procedure GL.Load_Function_Pointers is function Load_T192 is new Load (T192); function Load_T193 is new Load (T193); function Load_T194 is new Load (T194); + function Load_T195 is new Load (T195); + function Load_T196 is new Load (T196); + function Load_T197 is new Load (T197); begin GL.API.Doubles.Vertex_Attrib1 := Load_T1 ("glVertexAttribL1d"); GL.API.Doubles.Vertex_Attrib2 := Load_T2 ("glVertexAttribL2d"); @@ -297,139 +300,143 @@ begin GL.API.Debug_Message_Control := Load_T72 ("glDebugMessageControl"); GL.API.Get_Debug_Message_Log := Load_T73 ("glGetDebugMessageLog"); GL.API.Debug_Message_Callback := Load_T74 ("glDebugMessageCallback"); - GL.API.Get_String_I := Load_T75 ("glGetStringi"); - GL.API.Secondary_Color := Load_T76 ("glSecondaryColor3dv"); - GL.API.Fog_Coord := Load_T77 ("glFogCoordd"); - GL.API.Draw_Arrays_Instanced := Load_T78 ("glDrawArraysInstanced"); - GL.API.Draw_Elements_Instanced := Load_T79 ("glDrawElementsInstanced"); - GL.API.Draw_Elements_Base_Vertex := Load_T80 ("glDrawElementsBaseVertex"); - GL.API.Draw_Transform_Feedback := Load_T81 ("glDrawTransformFeedback"); - GL.API.Draw_Transform_Feedback_Stream := Load_T82 ("glDrawTransformFeedbackStream"); - GL.API.Primitive_Restart_Index := Load_T83 ("glPrimitiveRestartIndex"); - GL.API.Vertex_Attrib_Divisor := Load_T84 ("glVertexAttribDivisor"); - GL.API.Blend_Func_I := Load_T85 ("glBlendFunci"); - GL.API.Blend_Func_Separate := Load_T86 ("glBlendFuncSeparate"); - GL.API.Blend_Func_Separate_I := Load_T87 ("glBlendFuncSeparate"); - GL.API.Blend_Color := Load_T88 ("glBlendColor"); - GL.API.Blend_Equation := Load_T89 ("glBlendEquation"); - GL.API.Blend_Equation_I := Load_T90 ("glBlendEquationi"); - GL.API.Blend_Equation_Separate := Load_T91 ("glBlendEquationSeparate"); - GL.API.Blend_Equation_Separate_I := Load_T92 ("glBlendEquationi"); - GL.API.Set_Point_Parameter_Single := Load_T93 ("glPointParameterf"); - GL.API.Draw_Buffers := Load_T94 ("glDrawBuffers"); - GL.API.Clear_Accum := Load_T88 ("glClearAccum"); - GL.API.Clear_Buffer := Load_T95 ("glClearBufferfv"); - GL.API.Clear_Draw_Buffer := Load_T96 ("glClearBufferfv"); - GL.API.Clear_Buffer_Depth := Load_T97 ("glClearBufferfv"); - GL.API.Clear_Buffer_Stencil := Load_T98 ("glClearBufferiv"); - GL.API.Clear_Buffer_Depth_Stencil := Load_T99 ("glClearBufferfi"); - GL.API.Stencil_Func_Separate := Load_T100 ("glStencilFuncSeparate"); - GL.API.Stencil_Op_Separate := Load_T101 ("glStencilOpSeparate"); - GL.API.Stencil_Mask_Separate := Load_T102 ("glStencilMaskSeparate"); - GL.API.Compressed_Tex_Image_1D := Load_T103 ("glCompressedTexImage1D"); - GL.API.Tex_Sub_Image_1D := Load_T104 ("glTexSubImage1D"); - GL.API.Tex_Storage_1D := Load_T105 ("glTexStorage1D"); - GL.API.Compressed_Tex_Image_2D := Load_T106 ("glCompressedTexImage2D"); - GL.API.Tex_Storage_2D := Load_T107 ("glTexStorage2D"); - GL.API.Tex_Image_3D := Load_T108 ("glTexImage3D"); - GL.API.Compressed_Tex_Image_3D := Load_T109 ("glCompressedTexImage3D"); - GL.API.Tex_Sub_Image_3D := Load_T104 ("glTexSubImage3D"); - GL.API.Tex_Storage_3D := Load_T110 ("glTexStorage3D"); - GL.API.Active_Texture := Load_T111 ("glActiveTexture"); - GL.API.Generate_Mipmap := Load_T112 ("glGenerateMipmap"); - GL.API.Invalidate_Tex_Image := Load_T113 ("glInvalidateTexImage"); - GL.API.Invalidate_Tex_Sub_Image := Load_T114 ("glInvalidateTexSubImage"); - GL.API.Gen_Buffers := Load_T115 ("glGenBuffers"); - GL.API.Gen_Transform_Feedbacks := Load_T115 ("glGenTransformFeedbacks"); - GL.API.Delete_Buffers := Load_T116 ("glDeleteBuffers"); - GL.API.Delete_Transform_Feedbacks := Load_T116 ("glDeleteTransformFeedbacks"); - GL.API.Bind_Buffer := Load_T117 ("glBindBuffer"); - GL.API.Bind_Transform_Feedback := Load_T117 ("glBindTransformFeedback"); - GL.API.Bind_Buffer_Base := Load_T118 ("glBindBufferBase"); - GL.API.Buffer_Data := Load_T119 ("glBufferData"); - GL.API.Texture_Buffer_Data := Load_T120 ("glTexBuffer"); - GL.API.Map_Buffer := Load_T121 ("glMapBuffer"); - GL.API.Map_Buffer_Range := Load_T122 ("glMapBufferRange"); - GL.API.Buffer_Pointer := Load_T123 ("glGetBufferPointerv"); - GL.API.Buffer_Sub_Data := Load_T124 ("glBufferSubData"); - GL.API.Get_Buffer_Sub_Data := Load_T124 ("glGetBufferSubData"); - GL.API.Unmap_Buffer := Load_T125 ("glUnmapBuffer"); - GL.API.Get_Buffer_Parameter_Access_Kind := Load_T126 ("glGetBufferParameteriv"); - GL.API.Get_Buffer_Parameter_Bool := Load_T127 ("glGetBufferParameteriv"); - GL.API.Get_Buffer_Parameter_Size := Load_T128 ("glGetBufferParameteriv"); - GL.API.Get_Buffer_Parameter_Usage := Load_T129 ("glGetBufferParameteriv"); - GL.API.Invalidate_Buffer_Data := Load_T130 ("glInvalidateBufferData"); - GL.API.Invalidate_Buffer_Sub_Data := Load_T131 ("glInvalidateBufferSubData"); - GL.API.Flush_Mapped_Buffer_Range := Load_T132 ("glFlushMappedBufferRange"); - GL.API.Gen_Vertex_Arrays := Load_T133 ("glGenVertexArrays"); - GL.API.Delete_Vertex_Arrays := Load_T134 ("glDeleteVertexArrays"); - GL.API.Bind_Vertex_Array := Load_T135 ("glBindVertexArray"); - GL.API.Gen_Renderbuffers := Load_T136 ("glGenRenderbuffers"); - GL.API.Delete_Renderbuffers := Load_T137 ("glDeleteBuffers"); - GL.API.Renderbuffer_Storage := Load_T138 ("glRenderbufferStorage"); - GL.API.Renderbuffer_Storage_Multisample := Load_T139 ("glRenderbufferStorageMultisample"); - GL.API.Bind_Renderbuffer := Load_T140 ("glBindRenderbuffer"); - GL.API.Get_Renderbuffer_Parameter_Int := Load_T141 ("glGetRenderbufferParameteriv"); - GL.API.Get_Renderbuffer_Parameter_Internal_Format := Load_T142 ("glGetRenderbufferParameteriv"); - GL.API.Clamp_Color := Load_T143 ("glClampColor"); - GL.API.Gen_Framebuffers := Load_T144 ("glGenFramebuffers"); - GL.API.Delete_Framebuffers := Load_T145 ("glDeleteFramebuffers"); - GL.API.Bind_Framebuffer := Load_T146 ("glBindFramebuffer"); - GL.API.Check_Framebuffer_Status := Load_T147 ("glCheckFramebufferStatus"); - GL.API.Framebuffer_Renderbuffer := Load_T148 ("glFramebufferRenderbuffer"); - GL.API.Framebuffer_Texture := Load_T149 ("glFramebufferTexture"); - GL.API.Framebuffer_Texture_Layer := Load_T150 ("glFramebufferTextureLayer"); - GL.API.Blit_Framebuffer := Load_T151 ("glBlitFramebuffer"); - GL.API.Invalidate_Framebuffer := Load_T152 ("glInvalidateFramebuffer"); - GL.API.Invalidate_Sub_Framebuffer := Load_T153 ("glInvalidateSubFramebuffer"); - GL.API.Framebuffer_Parameter_Size := Load_T154 ("glFramebufferParameteri"); - GL.API.Framebuffer_Parameter_Bool := Load_T155 ("glFramebufferParameteri"); - GL.API.Get_Framebuffer_Parameter_Size := Load_T156 ("glGetFramebufferParameteriv"); - GL.API.Get_Framebuffer_Parameter_Bool := Load_T157 ("glGetFramebufferParameteriv"); - GL.API.Gen_Queries := Load_T158 ("glGenQueries"); - GL.API.Delete_Queries := Load_T159 ("glDeleteQueries"); - GL.API.Is_Query := Load_T160 ("glIsQuery"); - GL.API.Get_Query_Object := Load_T161 ("glGetQueryObjectuiv"); - GL.API.Begin_Query := Load_T162 ("glBeginQuery"); - GL.API.End_Query := Load_T163 ("glEndQuery"); - GL.API.Begin_Query_Indexed := Load_T164 ("glBeginQueryIndexed"); - GL.API.End_Query_Indexed := Load_T165 ("glEndQueryIndexed"); - GL.API.Query_Counter := Load_T166 ("glQueryCounter"); - GL.API.Get_Shader_Param := Load_T167 ("glGetShaderiv"); - GL.API.Get_Shader_Type := Load_T168 ("glGetShaderiv"); - GL.API.Create_Shader := Load_T169 ("glCreateShader"); - GL.API.Delete_Shader := Load_T170 ("glDeleteShader"); - GL.API.Shader_Source := Load_T171 ("glShaderSource"); - GL.API.Get_Shader_Source := Load_T172 ("glGetShaderSource"); - GL.API.Compile_Shader := Load_T170 ("glCompileShader"); + GL.API.Get_Integer_Indexed := Load_T75 ("glGetIntegeri_v"); + GL.API.Get_String_I := Load_T76 ("glGetStringi"); + GL.API.Secondary_Color := Load_T77 ("glSecondaryColor3dv"); + GL.API.Fog_Coord := Load_T78 ("glFogCoordd"); + GL.API.Draw_Arrays_Instanced := Load_T79 ("glDrawArraysInstanced"); + GL.API.Draw_Elements_Instanced := Load_T80 ("glDrawElementsInstanced"); + GL.API.Draw_Elements_Base_Vertex := Load_T81 ("glDrawElementsBaseVertex"); + GL.API.Draw_Transform_Feedback := Load_T82 ("glDrawTransformFeedback"); + GL.API.Draw_Transform_Feedback_Stream := Load_T83 ("glDrawTransformFeedbackStream"); + GL.API.Primitive_Restart_Index := Load_T84 ("glPrimitiveRestartIndex"); + GL.API.Vertex_Attrib_Divisor := Load_T85 ("glVertexAttribDivisor"); + GL.API.Blend_Func_I := Load_T86 ("glBlendFunci"); + GL.API.Blend_Func_Separate := Load_T87 ("glBlendFuncSeparate"); + GL.API.Blend_Func_Separate_I := Load_T88 ("glBlendFuncSeparate"); + GL.API.Blend_Color := Load_T89 ("glBlendColor"); + GL.API.Blend_Equation := Load_T90 ("glBlendEquation"); + GL.API.Blend_Equation_I := Load_T91 ("glBlendEquationi"); + GL.API.Blend_Equation_Separate := Load_T92 ("glBlendEquationSeparate"); + GL.API.Blend_Equation_Separate_I := Load_T93 ("glBlendEquationi"); + GL.API.Set_Point_Parameter_Single := Load_T94 ("glPointParameterf"); + GL.API.Draw_Buffers := Load_T95 ("glDrawBuffers"); + GL.API.Clear_Accum := Load_T89 ("glClearAccum"); + GL.API.Clear_Buffer := Load_T96 ("glClearBufferfv"); + GL.API.Clear_Draw_Buffer := Load_T97 ("glClearBufferfv"); + GL.API.Clear_Buffer_Depth := Load_T98 ("glClearBufferfv"); + GL.API.Clear_Buffer_Stencil := Load_T99 ("glClearBufferiv"); + GL.API.Clear_Buffer_Depth_Stencil := Load_T100 ("glClearBufferfi"); + GL.API.Stencil_Func_Separate := Load_T101 ("glStencilFuncSeparate"); + GL.API.Stencil_Op_Separate := Load_T102 ("glStencilOpSeparate"); + GL.API.Stencil_Mask_Separate := Load_T103 ("glStencilMaskSeparate"); + GL.API.Compressed_Tex_Image_1D := Load_T104 ("glCompressedTexImage1D"); + GL.API.Tex_Sub_Image_1D := Load_T105 ("glTexSubImage1D"); + GL.API.Tex_Storage_1D := Load_T106 ("glTexStorage1D"); + GL.API.Compressed_Tex_Image_2D := Load_T107 ("glCompressedTexImage2D"); + GL.API.Tex_Storage_2D := Load_T108 ("glTexStorage2D"); + GL.API.Tex_Image_3D := Load_T109 ("glTexImage3D"); + GL.API.Compressed_Tex_Image_3D := Load_T110 ("glCompressedTexImage3D"); + GL.API.Tex_Sub_Image_3D := Load_T105 ("glTexSubImage3D"); + GL.API.Tex_Storage_3D := Load_T111 ("glTexStorage3D"); + GL.API.Active_Texture := Load_T112 ("glActiveTexture"); + GL.API.Generate_Mipmap := Load_T113 ("glGenerateMipmap"); + GL.API.Invalidate_Tex_Image := Load_T114 ("glInvalidateTexImage"); + GL.API.Invalidate_Tex_Sub_Image := Load_T115 ("glInvalidateTexSubImage"); + GL.API.Gen_Buffers := Load_T116 ("glGenBuffers"); + GL.API.Gen_Transform_Feedbacks := Load_T116 ("glGenTransformFeedbacks"); + GL.API.Delete_Buffers := Load_T117 ("glDeleteBuffers"); + GL.API.Delete_Transform_Feedbacks := Load_T117 ("glDeleteTransformFeedbacks"); + GL.API.Bind_Buffer := Load_T118 ("glBindBuffer"); + GL.API.Bind_Transform_Feedback := Load_T118 ("glBindTransformFeedback"); + GL.API.Bind_Buffer_Base := Load_T119 ("glBindBufferBase"); + GL.API.Buffer_Data := Load_T120 ("glBufferData"); + GL.API.Texture_Buffer_Data := Load_T121 ("glTexBuffer"); + GL.API.Map_Buffer := Load_T122 ("glMapBuffer"); + GL.API.Map_Buffer_Range := Load_T123 ("glMapBufferRange"); + GL.API.Buffer_Pointer := Load_T124 ("glGetBufferPointerv"); + GL.API.Buffer_Sub_Data := Load_T125 ("glBufferSubData"); + GL.API.Get_Buffer_Sub_Data := Load_T125 ("glGetBufferSubData"); + GL.API.Unmap_Buffer := Load_T126 ("glUnmapBuffer"); + GL.API.Get_Buffer_Parameter_Access_Kind := Load_T127 ("glGetBufferParameteriv"); + GL.API.Get_Buffer_Parameter_Bool := Load_T128 ("glGetBufferParameteriv"); + GL.API.Get_Buffer_Parameter_Size := Load_T129 ("glGetBufferParameteriv"); + GL.API.Get_Buffer_Parameter_Usage := Load_T130 ("glGetBufferParameteriv"); + GL.API.Invalidate_Buffer_Data := Load_T131 ("glInvalidateBufferData"); + GL.API.Invalidate_Buffer_Sub_Data := Load_T132 ("glInvalidateBufferSubData"); + GL.API.Flush_Mapped_Buffer_Range := Load_T133 ("glFlushMappedBufferRange"); + GL.API.Gen_Vertex_Arrays := Load_T134 ("glGenVertexArrays"); + GL.API.Delete_Vertex_Arrays := Load_T135 ("glDeleteVertexArrays"); + GL.API.Bind_Vertex_Array := Load_T136 ("glBindVertexArray"); + GL.API.Gen_Renderbuffers := Load_T137 ("glGenRenderbuffers"); + GL.API.Delete_Renderbuffers := Load_T138 ("glDeleteBuffers"); + GL.API.Renderbuffer_Storage := Load_T139 ("glRenderbufferStorage"); + GL.API.Renderbuffer_Storage_Multisample := Load_T140 ("glRenderbufferStorageMultisample"); + GL.API.Bind_Renderbuffer := Load_T141 ("glBindRenderbuffer"); + GL.API.Get_Renderbuffer_Parameter_Int := Load_T142 ("glGetRenderbufferParameteriv"); + GL.API.Get_Renderbuffer_Parameter_Internal_Format := Load_T143 ("glGetRenderbufferParameteriv"); + GL.API.Clamp_Color := Load_T144 ("glClampColor"); + GL.API.Gen_Framebuffers := Load_T145 ("glGenFramebuffers"); + GL.API.Delete_Framebuffers := Load_T146 ("glDeleteFramebuffers"); + GL.API.Bind_Framebuffer := Load_T147 ("glBindFramebuffer"); + GL.API.Check_Framebuffer_Status := Load_T148 ("glCheckFramebufferStatus"); + GL.API.Framebuffer_Renderbuffer := Load_T149 ("glFramebufferRenderbuffer"); + GL.API.Framebuffer_Texture := Load_T150 ("glFramebufferTexture"); + GL.API.Framebuffer_Texture_Layer := Load_T151 ("glFramebufferTextureLayer"); + GL.API.Blit_Framebuffer := Load_T152 ("glBlitFramebuffer"); + GL.API.Invalidate_Framebuffer := Load_T153 ("glInvalidateFramebuffer"); + GL.API.Invalidate_Sub_Framebuffer := Load_T154 ("glInvalidateSubFramebuffer"); + GL.API.Framebuffer_Parameter_Size := Load_T155 ("glFramebufferParameteri"); + GL.API.Framebuffer_Parameter_Bool := Load_T156 ("glFramebufferParameteri"); + GL.API.Get_Framebuffer_Parameter_Size := Load_T157 ("glGetFramebufferParameteriv"); + GL.API.Get_Framebuffer_Parameter_Bool := Load_T158 ("glGetFramebufferParameteriv"); + GL.API.Gen_Queries := Load_T159 ("glGenQueries"); + GL.API.Delete_Queries := Load_T160 ("glDeleteQueries"); + GL.API.Is_Query := Load_T161 ("glIsQuery"); + GL.API.Get_Query_Object := Load_T162 ("glGetQueryObjectuiv"); + GL.API.Begin_Query := Load_T163 ("glBeginQuery"); + GL.API.End_Query := Load_T164 ("glEndQuery"); + GL.API.Begin_Query_Indexed := Load_T165 ("glBeginQueryIndexed"); + GL.API.End_Query_Indexed := Load_T166 ("glEndQueryIndexed"); + GL.API.Query_Counter := Load_T167 ("glQueryCounter"); + GL.API.Get_Shader_Param := Load_T168 ("glGetShaderiv"); + GL.API.Get_Shader_Type := Load_T169 ("glGetShaderiv"); + GL.API.Create_Shader := Load_T170 ("glCreateShader"); + GL.API.Delete_Shader := Load_T171 ("glDeleteShader"); + GL.API.Shader_Source := Load_T172 ("glShaderSource"); + GL.API.Get_Shader_Source := Load_T173 ("glGetShaderSource"); + GL.API.Compile_Shader := Load_T171 ("glCompileShader"); GL.API.Release_Shader_Compiler := Load_T71 ("glReleaseShaderCompiler"); - GL.API.Get_Shader_Info_Log := Load_T172 ("glGetShaderInfoLog"); - GL.API.Create_Program := Load_T173 ("glCreateProgram"); - GL.API.Delete_Program := Load_T174 ("glDeleteProgram"); - GL.API.Get_Program_Param := Load_T175 ("glGetProgramiv"); - GL.API.Attach_Shader := Load_T176 ("glAttachShader"); - GL.API.Link_Program := Load_T174 ("glLinkProgram"); - GL.API.Get_Program_Info_Log := Load_T177 ("glGetProgramInfoLog"); - GL.API.Get_Program_Stage := Load_T178 ("glGetProgramStageiv"); - GL.API.Get_Subroutine_Index := Load_T179 ("glGetSubroutineIndex"); - GL.API.Get_Subroutine_Uniform_Location := Load_T180 ("glGetSubroutineUniformLocation"); - GL.API.Use_Program := Load_T174 ("glUseProgram"); - GL.API.Validate_Program := Load_T174 ("glValidateProgram"); - GL.API.Get_Uniform_Location := Load_T181 ("glGetUniformLocation"); - GL.API.Bind_Attrib_Location := Load_T182 ("glBindAttribLocation"); - GL.API.Get_Attrib_Location := Load_T183 ("glGetAttribLocation"); - GL.API.Vertex_Attrib_Pointer := Load_T184 ("glVertexAttribPointer"); - GL.API.Vertex_AttribI_Pointer := Load_T185 ("glVertexAttribIPointer"); - GL.API.Vertex_AttribL_Pointer := Load_T185 ("glVertexAttribLPointer"); - GL.API.Enable_Vertex_Attrib_Array := Load_T186 ("glEnableVertexAttribArray"); - GL.API.Disable_Vertex_Attrib_Array := Load_T186 ("glDisableVertexAttribArray"); - GL.API.Get_Attached_Shaders := Load_T187 ("glGetAttachedShaders"); - GL.API.Bind_Frag_Data_Location := Load_T188 ("glBindFragDataLocation"); - GL.API.Get_Frag_Data_Location := Load_T189 ("glGetFragDataLocation"); - GL.API.Begin_Transform_Feedback := Load_T190 ("glBeginTransformFeedback"); + GL.API.Get_Shader_Info_Log := Load_T173 ("glGetShaderInfoLog"); + GL.API.Create_Program := Load_T174 ("glCreateProgram"); + GL.API.Delete_Program := Load_T175 ("glDeleteProgram"); + GL.API.Get_Program_Param := Load_T176 ("glGetProgramiv"); + GL.API.Attach_Shader := Load_T177 ("glAttachShader"); + GL.API.Link_Program := Load_T175 ("glLinkProgram"); + GL.API.Get_Program_Info_Log := Load_T178 ("glGetProgramInfoLog"); + GL.API.Get_Program_Stage := Load_T179 ("glGetProgramStageiv"); + GL.API.Get_Subroutine_Index := Load_T180 ("glGetSubroutineIndex"); + GL.API.Get_Subroutine_Uniform_Location := Load_T181 ("glGetSubroutineUniformLocation"); + GL.API.Use_Program := Load_T175 ("glUseProgram"); + GL.API.Validate_Program := Load_T175 ("glValidateProgram"); + GL.API.Get_Uniform_Location := Load_T182 ("glGetUniformLocation"); + GL.API.Bind_Attrib_Location := Load_T183 ("glBindAttribLocation"); + GL.API.Get_Attrib_Location := Load_T184 ("glGetAttribLocation"); + GL.API.Vertex_Attrib_Pointer := Load_T185 ("glVertexAttribPointer"); + GL.API.Vertex_AttribI_Pointer := Load_T186 ("glVertexAttribIPointer"); + GL.API.Vertex_AttribL_Pointer := Load_T186 ("glVertexAttribLPointer"); + GL.API.Enable_Vertex_Attrib_Array := Load_T187 ("glEnableVertexAttribArray"); + GL.API.Disable_Vertex_Attrib_Array := Load_T187 ("glDisableVertexAttribArray"); + GL.API.Get_Attached_Shaders := Load_T188 ("glGetAttachedShaders"); + GL.API.Bind_Frag_Data_Location := Load_T189 ("glBindFragDataLocation"); + GL.API.Get_Frag_Data_Location := Load_T190 ("glGetFragDataLocation"); + GL.API.Begin_Transform_Feedback := Load_T191 ("glBeginTransformFeedback"); GL.API.End_Transform_Feedback := Load_T71 ("glEndTransformFeedback"); - GL.API.Get_Transform_Feedback_Varying := Load_T191 ("glGetTransformFeedbackVarying"); - GL.API.Transform_Feedback_Varyings := Load_T192 ("glTransformFeedbackVaryings"); - GL.API.Set_Patch_Parameter_Int := Load_T193 ("glPatchParameteri"); - GL.API.Set_Patch_Parameter_Float_Array := Load_T194 ("glPatchParameterfv"); + GL.API.Get_Transform_Feedback_Varying := Load_T192 ("glGetTransformFeedbackVarying"); + GL.API.Transform_Feedback_Varyings := Load_T193 ("glTransformFeedbackVaryings"); + GL.API.Set_Patch_Parameter_Int := Load_T194 ("glPatchParameteri"); + GL.API.Set_Patch_Parameter_Float_Array := Load_T195 ("glPatchParameterfv"); + GL.API.Dispatch_Compute := Load_T196 ("glDispatchCompute"); + GL.API.Memory_Barrier := Load_T197 ("glMemoryBarrier"); + GL.API.Memory_Barrier_By_Region := Load_T197 ("glMemoryBarrierByRegion"); end GL.Load_Function_Pointers; diff --git a/opengl/src/implementation/gl-compute.adb b/opengl/src/implementation/gl-compute.adb new file mode 100644 index 00000000..562519e6 --- /dev/null +++ b/opengl/src/implementation/gl-compute.adb @@ -0,0 +1,48 @@ +-- part of OpenGLAda, (c) 2022 Felix Krause +-- released under the terms of the MIT license, see the file "COPYING" + +with GL.Enums.Getter; +with GL.API; + +package body GL.Compute is + function Max_Compute_Work_Group_Count (Index : Index_Type) return Int is + Value : aliased Int; + begin + API.Get_Integer_Indexed + (GL.Enums.Getter.Max_Compute_Work_Group_Count, + Index_Type'Pos (Index), + Value'Access); + Raise_Exception_On_OpenGL_Error; + return Value; + end Max_Compute_Work_Group_Count; + + function Max_Compute_Work_Group_Size (Index : Index_Type) return Int is + Value : aliased Int; + begin + API.Get_Integer_Indexed + (GL.Enums.Getter.Max_Compute_Work_Group_Size, + Index_Type'Pos (Index), + Value'Access); + Raise_Exception_On_OpenGL_Error; + return Value; + end Max_Compute_Work_Group_Size; + + function Max_Compute_Work_Group_Invocations return Int is + Value : aliased Int; + begin + API.Get_Integer + (GL.Enums.Getter.Max_Compute_Work_Group_Invocations, + Value'Access); + Raise_Exception_On_OpenGL_Error; + return Value; + end Max_Compute_Work_Group_Invocations; + + procedure Dispatch_Compute + (Num_Groups_X, Num_Groups_Y, Num_Groups_Z : UInt) is + begin + API.Dispatch_Compute (Num_Groups_X, Num_Groups_Y, Num_Groups_Z); + Raise_Exception_On_OpenGL_Error; + end Dispatch_Compute; +end GL.Compute; + + diff --git a/opengl/src/implementation/gl-enums-getter.ads b/opengl/src/implementation/gl-enums-getter.ads index 61b2c264..204f875a 100644 --- a/opengl/src/implementation/gl-enums-getter.ads +++ b/opengl/src/implementation/gl-enums-getter.ads @@ -248,9 +248,12 @@ package GL.Enums.Getter is Stencil_Back_Ref, Stencil_Back_Value_Mask, Stencil_Back_Writemask, + Max_Compute_Work_Group_Invocations, Max_Debug_Message_Length, Max_Debug_Logged_Messages, Debug_Logged_Messages, + Max_Compute_Work_Group_Count, + Max_Compute_Work_Group_Size, Max_Framebuffer_Width, Max_Framebuffer_Height, Max_Framebuffer_Layers, @@ -497,9 +500,12 @@ package GL.Enums.Getter is Stencil_Back_Ref => 16#8CA3#, Stencil_Back_Value_Mask => 16#8CA4#, Stencil_Back_Writemask => 16#8CA5#, + Max_Compute_Work_Group_Invocations => 16#90EB#, Max_Debug_Message_Length => 16#9143#, Max_Debug_Logged_Messages => 16#9144#, Debug_Logged_Messages => 16#9145#, + Max_Compute_Work_Group_Count => 16#91BE#, + Max_Compute_Work_Group_Size => 16#91BF#, Max_Framebuffer_Width => 16#9315#, Max_Framebuffer_Height => 16#9316#, Max_Framebuffer_Layers => 16#9317#, diff --git a/opengl/src/implementation/gl-memory.adb b/opengl/src/implementation/gl-memory.adb new file mode 100644 index 00000000..fb8fdb59 --- /dev/null +++ b/opengl/src/implementation/gl-memory.adb @@ -0,0 +1,24 @@ +-- part of OpenGLAda, (c) 2022 Felix Krause +-- released under the terms of the MIT license, see the file "COPYING" + +with Ada.Unchecked_Conversion; + +with GL.API; + +package body GL.Memory is + function To_BitField is new Ada.Unchecked_Conversion + (Barrier_Bits, GL.Low_Level.Bitfield); + + procedure Barrier (Bits : Barrier_Bits) is + begin + API.Memory_Barrier (To_BitField (Bits)); + Raise_Exception_On_OpenGL_Error; + end Barrier; + + procedure Barrier_By_Region (Bits : Barrier_Bits) is + begin + API.Memory_Barrier_By_Region (To_BitField (Bits)); + Raise_Exception_On_OpenGL_Error; + end Barrier_By_Region; +end GL.Memory; + diff --git a/opengl/src/interface/gl-compute.ads b/opengl/src/interface/gl-compute.ads new file mode 100644 index 00000000..089fc182 --- /dev/null +++ b/opengl/src/interface/gl-compute.ads @@ -0,0 +1,23 @@ +-- part of OpenGLAda, (c) 2022 Felix Krause +-- released under the terms of the MIT license, see the file "COPYING" + +with GL.Types; + +package GL.Compute is + pragma Preelaborate; + + use GL.Types; + + type Index_Type is (X, Y, Z); + + function Max_Compute_Work_Group_Count (Index : Index_Type) return Int; + function Max_Compute_Work_Group_Size (Index : Index_Type) return Int; + function Max_Compute_Work_Group_Invocations return Int; + + procedure Dispatch_Compute + (Num_Groups_X, Num_Groups_Y, Num_Groups_Z : UInt); + +private + for Index_Type use (X => 0, Y => 1, Z => 2); +end GL.Compute; + diff --git a/opengl/src/interface/gl-memory.ads b/opengl/src/interface/gl-memory.ads new file mode 100644 index 00000000..69771a83 --- /dev/null +++ b/opengl/src/interface/gl-memory.ads @@ -0,0 +1,58 @@ +-- part of OpenGLAda, (c) 2022 Felix Krause +-- released under the terms of the MIT license, see the file "COPYING" + +private with GL.Low_Level; + +package GL.Memory is + pragma Preelaborate; + + type Barrier_Bits is record + Vertex_Attrib_Array : Boolean := False; + Element_Array : Boolean := False; + Uniform : Boolean := False; + Texture_Fetch : Boolean := False; + + Shader_Image_Access : Boolean := False; + Command : Boolean := False; + Pixel_Buffer : Boolean := False; + Texture_Update : Boolean := False; + Buffer_Update : Boolean := False; + Framebuffer : Boolean := False; + Transform_Feedback : Boolean := False; + Atomic_Counter : Boolean := False; + Shader_Storage : Boolean := False; + Client_Mapped_Buffer : Boolean := False; + Query_Buffer : Boolean := False; + + Unused : Boolean := False; + end record; + pragma Convention (C, Barrier_Bits); + + procedure Barrier (Bits : Barrier_Bits); + + procedure Barrier_By_Region (Bits : Barrier_Bits); + +private + for Barrier_Bits use record + Vertex_Attrib_Array at 0 range 0 .. 0; + Element_Array at 0 range 1 .. 1; + Uniform at 0 range 2 .. 2; + Texture_Fetch at 0 range 3 .. 3; + + Shader_Image_Access at 0 range 5 .. 5; + Command at 0 range 6 .. 6; + Pixel_Buffer at 0 range 7 .. 7; + Texture_Update at 0 range 8 .. 8; + Buffer_Update at 0 range 9 .. 9; + Framebuffer at 0 range 10 .. 10; + Transform_Feedback at 0 range 11 .. 11; + Atomic_Counter at 0 range 12 .. 12; + Shader_Storage at 0 range 13 .. 13; + Client_Mapped_Buffer at 0 range 14 .. 14; + Query_Buffer at 0 range 15 .. 15; + + Unused at 0 range 16 .. 31; + end record; + for Barrier_Bits'Size use Low_Level.Bitfield'Size; +end GL.Memory; + diff --git a/opengl/src/interface/gl-objects-shaders.ads b/opengl/src/interface/gl-objects-shaders.ads index 69a944f3..cc164325 100644 --- a/opengl/src/interface/gl-objects-shaders.ads +++ b/opengl/src/interface/gl-objects-shaders.ads @@ -7,7 +7,8 @@ package GL.Objects.Shaders is pragma Preelaborate; type Shader_Type is (Fragment_Shader, Vertex_Shader, Geometry_Shader, - Tess_Evaluation_Shader, Tess_Control_Shader); + Tess_Evaluation_Shader, Tess_Control_Shader, + Compute_Shader); type Shader (Kind : Shader_Type) is new GL_Object with private; @@ -39,7 +40,8 @@ private Vertex_Shader => 16#8B31#, Geometry_Shader => 16#8DD9#, Tess_Evaluation_Shader => 16#8E87#, - Tess_Control_Shader => 16#8E88#); + Tess_Control_Shader => 16#8E88#, + Compute_Shader => 16#91B9#); for Shader_Type'Size use Low_Level.Enum'Size; end GL.Objects.Shaders; diff --git a/opengl/src/specs/gl-api.spec b/opengl/src/specs/gl-api.spec index 538cd390..a6088b11 100644 --- a/opengl/src/specs/gl-api.spec +++ b/opengl/src/specs/gl-api.spec @@ -103,6 +103,10 @@ spec GL.API is Static => "glGetFloatv"; procedure Get_Integer (Name : Enums.Getter.Parameter; Target : access Int) with Static => "glGetIntegerv"; + procedure Get_Integer_Indexed (Name : Enums.Getter.Parameter; + Index : UInt; + Target : access Int) with + Dynamic => "glGetIntegeri_v"; procedure Get_Int_Vec4 (Name : Enums.Getter.Parameter; Target : in out Ints.Vector4) with Static => "glGetIntegerv"; @@ -1300,4 +1304,24 @@ spec GL.API is Static => "glDepthRange", Wrapper => "GL.Window.Set_Depth_Range"; procedure Viewport (X, Y : Int; Width, Height : Size) with Static => "glViewport", Wrapper => "GL.Window.Set_Viewport"; + + ----------------------------------------------------------------------------- + -- Compute Shaders -- + ----------------------------------------------------------------------------- + + procedure Dispatch_Compute + (Num_Groups_X, Num_Groups_Y, Num_Groups_Z : UInt) with + Dynamic => "glDispatchCompute", + Wrapper => "GL.Compute.Dispatch_Compute"; + + ----------------------------------------------------------------------------- + -- Memory Barriers -- + ----------------------------------------------------------------------------- + + procedure Memory_Barrier (Bits : Low_Level.Bitfield) with + Dynamic => "glMemoryBarrier", + Wrapper => "GL.Memory.Barrier"; + procedure Memory_Barrier_By_Region (Bits : Low_Level.Bitfield) with + Dynamic => "glMemoryBarrierByRegion", + Wrapper => "GL.Memory.Barrier_By_Region"; end GL.API; diff --git a/tests/opengl-test.gpr b/tests/opengl-test.gpr index 37f6e9de..724aa963 100644 --- a/tests/opengl-test.gpr +++ b/tests/opengl-test.gpr @@ -11,7 +11,7 @@ project OpenGL.Test is for Main use ("gl_test-vbos", "gl_test-immediate", "gl_test-shaders", "gl_test-opengl3", "gl_test-context", "gl_test-framebuffers", - "gl_test-debugging"); + "gl_test-debugging", "gl_test-compute"); package Ide renames OpenGL.Ide; package Builder renames OpenGL.Builder; diff --git a/tests/src/gl/gl_test-compute-shader.glsl b/tests/src/gl/gl_test-compute-shader.glsl new file mode 100644 index 00000000..01d01c25 --- /dev/null +++ b/tests/src/gl/gl_test-compute-shader.glsl @@ -0,0 +1,10 @@ +#version 430 +layout(local_size_x = 32) in; +layout(std430, binding = 0) buffer data { + float values[]; +}; + +void main() { + int x = int(gl_GlobalInvocationID.x); + values[x] = 2 * values[x]; +} diff --git a/tests/src/gl/gl_test-compute.adb b/tests/src/gl/gl_test-compute.adb new file mode 100644 index 00000000..be5cb361 --- /dev/null +++ b/tests/src/gl/gl_test-compute.adb @@ -0,0 +1,139 @@ +-- part of OpenGLAda, (c) 2022 Felix Krause +-- released under the terms of the MIT license, see the file "COPYING" + +with Ada.Text_IO; + +with GL.Compute; +with GL.Files; +with GL.Memory; +with GL.Objects.Buffers; +with GL.Objects.Shaders; +with GL.Objects.Programs; +with GL.Types; + +with GL_Test.Display_Backend; + +procedure GL_Test.Compute is + use GL.Types; + + procedure Load_Singles is new GL.Objects.Buffers.Load_To_Buffer + (Single_Pointers); + + procedure Map_Singles is new GL.Objects.Buffers.Map + (Single_Pointers); + + Data_Count : constant := 1024; + + Iteration_Count : Natural := 0; + + Buffer : GL.Objects.Buffers.Buffer; + Invalid : GL.Objects.Buffers.Buffer; + Compute_Shader : GL.Objects.Shaders.Shader + (Kind => GL.Objects.Shaders.Compute_Shader); + Program : GL.Objects.Programs.Program; +begin + Display_Backend.Init; + Display_Backend.Open_Window (Width => 500, Height => 500); + + Buffer.Initialize_Id; + Invalid.Initialize_Id; + Compute_Shader.Initialize_Id; + Program.Initialize_Id; + + -- initialize an SSBO with numbers from 1 to `Data_Count` + declare + use GL.Objects.Buffers; + + Values : Single_Array (1 .. Data_Count); + begin + for I In Values'Range loop + Values (I) := Single (I); + end loop; + Shader_Storage_Buffer.Bind (Buffer); + Load_Singles + (Shader_Storage_Buffer, + Values, + Dynamic_Draw); + -- The following dummy bind is necessary for the Bind_Buffer_Base + -- to be effective. TODO: determine if it's a bug or not. + Shader_Storage_Buffer.Bind (Invalid); + Shader_Storage_Buffer.Bind_Buffer_Base (0, Buffer); + end; + + -- load shader sources and compile shaders + GL.Files.Load_Shader_Source_From_File + (Compute_Shader, "../src/gl/gl_test-compute-shader.glsl"); + + Compute_Shader.Compile; + + if not Compute_Shader.Compile_Status then + Ada.Text_IO.Put_Line ("Compilation of compute shader failed. log:"); + Ada.Text_IO.Put_Line (Compute_Shader.Info_Log); + end if; + + -- set up program + Program.Attach (Compute_Shader); + Program.Link; + if not Program.Link_Status then + Ada.Text_IO.Put_Line ("Program linking failed. Log:"); + Ada.Text_IO.Put_Line (Program.Info_Log); + return; + end if; + + -- check various constant + declare + use GL.Compute; + begin + for Index in Index_Type loop + Ada.Text_IO.Put ("Max compute work group count " & Index'Image & " :"); + Ada.Text_IO.Put_Line (Int'Image (Max_Compute_Work_Group_Count (Index))); + end loop; + + for Index in Index_Type loop + Ada.Text_IO.Put ("Max compute work group size " & Index'Image & " :"); + Ada.Text_IO.Put_Line (Int'Image (Max_Compute_Work_Group_Size (Index))); + end loop; + + Ada.Text_IO.Put ("Max compute work group invocations :"); + Ada.Text_IO.Put_Line (Int'Image (Max_Compute_Work_Group_Invocations)); + end; + + Program.Use_Program; + + -- dispatch compute shader 5 times + while Iteration_Count < 5 loop + -- local size for x axis is 32 as specified in the shader + GL.Compute.Dispatch_Compute (Data_Count / 32, 1, 1); + GL.Memory.Barrier ((Shader_Storage => True, others => False)); + Iteration_Count := Iteration_Count + 1; + end loop; + + -- print the final result to compare to the expected value + declare + use GL.Objects; + use GL.Objects.Buffers; + + CPU_Total : Single := 0.0; + GPU_Total : Single := 0.0; + + Value_Ptr : Single_Pointers.Pointer; + begin + Map_Singles (Shader_Storage_Buffer, Read_Only, Value_Ptr); + + for I in 1 .. Data_Count loop + -- We run 5 iterations of the compute shader which simply doubles its + -- previous value, so this is ultimately the same as multiplying the + -- initial value by 2 ** 5 = 32. + CPU_Total := CPU_Total + Single (I) * 32.0; + GPU_Total := GPU_Total + Value_Ptr.all; + Single_Pointers.Increment (Value_Ptr); + end loop; + + Unmap (Shader_Storage_Buffer); + + Ada.Text_IO.Put_Line ("CPU Total : " & CPU_Total'Image); + Ada.Text_IO.Put_Line ("GPU Total : " & GPU_Total'Image); + end; + + Display_Backend.Shutdown; +end GL_Test.Compute;