From fc07a0d0186071ad0f5d8c45d4ea0727876924b9 Mon Sep 17 00:00:00 2001 From: Martin Fouilleul Date: Tue, 11 Jul 2023 14:27:15 +0200 Subject: [PATCH 1/6] [osx, canvas] use 32 pixels-wide tiles --- src/mtl_renderer.m | 10 +++++----- src/mtl_renderer.metal | 9 ++++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/mtl_renderer.m b/src/mtl_renderer.m index 5103c00..503efef 100644 --- a/src/mtl_renderer.m +++ b/src/mtl_renderer.m @@ -17,7 +17,7 @@ #include"mtl_renderer.h" const int MG_MTL_INPUT_BUFFERS_COUNT = 3, - MG_MTL_TILE_SIZE = 16, + MG_MTL_TILE_SIZE = 32, MG_MTL_MSAA_COUNT = 8; typedef struct mg_mtl_canvas_backend @@ -914,7 +914,7 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, [mergeEncoder setBuffer:backend->logOffsetBuffer[backend->bufferIndex] offset:0 atIndex:11]; MTLSize mergeGridSize = MTLSizeMake(nTilesX, nTilesY, 1); - MTLSize mergeGroupSize = MTLSizeMake(16, 16, 1); + MTLSize mergeGroupSize = MTLSizeMake(MG_MTL_TILE_SIZE, MG_MTL_TILE_SIZE, 1); [mergeEncoder dispatchThreads: mergeGridSize threadsPerThreadgroup: mergeGroupSize]; [mergeEncoder endEncoding]; @@ -946,7 +946,7 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, [rasterEncoder setBytes: &useTexture length:sizeof(int) atIndex: 9]; MTLSize rasterGridSize = MTLSizeMake(viewportSize.x, viewportSize.y, 1); - MTLSize rasterGroupSize = MTLSizeMake(16, 16, 1); + MTLSize rasterGroupSize = MTLSizeMake(MG_MTL_TILE_SIZE, MG_MTL_TILE_SIZE, 1); // [rasterEncoder dispatchThreads: rasterGridSize threadsPerThreadgroup: rasterGroupSize]; [rasterEncoder dispatchThreadgroupsWithIndirectBuffer: backend->rasterDispatchBuffer @@ -999,7 +999,7 @@ void mg_mtl_canvas_resize(mg_mtl_canvas_backend* backend, vec2 size) MTLTextureDescriptor* texDesc = [[MTLTextureDescriptor alloc] init]; texDesc.textureType = MTLTextureType2D; texDesc.storageMode = MTLStorageModePrivate; - texDesc.usage = MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite; + texDesc.usage = MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite | MTLTextureUsageRenderTarget; texDesc.pixelFormat = MTLPixelFormatRGBA8Unorm; texDesc.width = size.x; texDesc.height = size.y; @@ -1407,7 +1407,7 @@ mg_canvas_backend* mtl_canvas_backend_create(mg_mtl_surface* surface) MTLTextureDescriptor* texDesc = [[MTLTextureDescriptor alloc] init]; texDesc.textureType = MTLTextureType2D; texDesc.storageMode = MTLStorageModePrivate; - texDesc.usage = MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite; + texDesc.usage = MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite | MTLTextureUsageRenderTarget; texDesc.pixelFormat = MTLPixelFormatRGBA8Unorm; texDesc.width = backend->frameSize.x; texDesc.height = backend->frameSize.y; diff --git a/src/mtl_renderer.metal b/src/mtl_renderer.metal index f0dad17..08276b6 100644 --- a/src/mtl_renderer.metal +++ b/src/mtl_renderer.metal @@ -1611,6 +1611,13 @@ kernel void mtl_raster(const device mg_mtl_screen_tile* screenTilesBuffer [[buff } opIndex = op->next; } + +/* + if((pixelCoord.x % tileSize[0] == 0) || (pixelCoord.y % tileSize[0] == 0)) + { + color = float4(0, 0, 0, 1); + } +//*/ outTexture.write(color, pixelCoord); } @@ -1631,7 +1638,7 @@ vertex vs_out mtl_vertex_shader(ushort vid [[vertex_id]]) return(out); } -fragment float4 mtl_fragment_shader(vs_out i [[stage_in]], texture2d tex [[texture(0)]]) +fragment float4 mtl_fragment_shader(vs_out i [[stage_in]], texture2d tex [[texture(0)]]) { constexpr sampler smp(mip_filter::nearest, mag_filter::linear, min_filter::linear); return(tex.sample(smp, i.uv)); From 98a516ff0a510c211f7499368d460184125c094b Mon Sep 17 00:00:00 2001 From: Martin Fouilleul Date: Tue, 11 Jul 2023 17:00:17 +0200 Subject: [PATCH 2/6] [osx, canvas] start with small input buffers and grow them as needed --- src/mtl_renderer.h | 1 - src/mtl_renderer.m | 411 ++++++++++++++++++++++++--------------------- 2 files changed, 220 insertions(+), 192 deletions(-) diff --git a/src/mtl_renderer.h b/src/mtl_renderer.h index 812d6e0..788e1df 100644 --- a/src/mtl_renderer.h +++ b/src/mtl_renderer.h @@ -34,7 +34,6 @@ typedef enum { typedef struct mg_mtl_path_elt { int pathIndex; - int localEltIndex; mg_mtl_seg_kind kind; vector_float2 p[4]; } mg_mtl_path_elt; diff --git a/src/mtl_renderer.m b/src/mtl_renderer.m index 503efef..abbe27e 100644 --- a/src/mtl_renderer.m +++ b/src/mtl_renderer.m @@ -34,8 +34,6 @@ typedef struct mg_mtl_canvas_backend id outTexture; - int pathBufferOffset; - int elementBufferOffset; int bufferIndex; dispatch_semaphore_t bufferSemaphore; @@ -57,6 +55,19 @@ typedef struct mg_mtl_canvas_backend int msaaCount; vec2 frameSize; + // encoding context + int eltCap; + int eltCount; + int eltBatchStart; + + int pathCap; + int pathCount; + int pathBatchStart; + + mg_primitive* primitive; + vec4 pathScreenExtents; + vec4 pathUserExtents; + } mg_mtl_canvas_backend; typedef struct mg_mtl_image_data @@ -84,20 +95,6 @@ void mg_mtl_print_log(int bufferIndex, id logBuffer, id lo } } - -typedef struct mg_mtl_encoding_context -{ - int mtlEltCount; - mg_mtl_path* pathBufferData; - mg_mtl_path_elt* elementBufferData; - int pathIndex; - int localEltIndex; - mg_primitive* primitive; - vec4 pathScreenExtents; - vec4 pathUserExtents; - -} mg_mtl_encoding_context; - static void mg_update_path_extents(vec4* extents, vec2 p) { extents->x = minimum(extents->x, p.x); @@ -106,27 +103,59 @@ static void mg_update_path_extents(vec4* extents, vec2 p) extents->w = maximum(extents->w, p.y); } -void mg_mtl_canvas_encode_element(mg_mtl_encoding_context* context, mg_path_elt_type kind, vec2* p) +id mg_mtl_grow_input_buffer(id device, id oldBuffer, int oldCopySize, int newSize) { - mg_mtl_path_elt* mtlElt = &context->elementBufferData[context->mtlEltCount]; - context->mtlEltCount++; + @autoreleasepool + { + MTLResourceOptions bufferOptions = MTLResourceCPUCacheModeWriteCombined + | MTLResourceStorageModeShared; - mtlElt->pathIndex = context->pathIndex; + id newBuffer = [device newBufferWithLength: newSize options: bufferOptions]; + + memcpy([newBuffer contents], [oldBuffer contents], oldCopySize); + + [oldBuffer release]; + return(newBuffer); + } +} + +void mg_mtl_canvas_encode_element(mg_mtl_canvas_backend* backend, mg_path_elt_type kind, vec2* p) +{ + int bufferIndex = backend->bufferIndex; + int bufferCap = [backend->elementBuffer[bufferIndex] length] / sizeof(mg_mtl_path_elt); + if(backend->eltCount >= bufferCap) + { + int newBufferCap = (int)(bufferCap * 1.5); + int newBufferSize = newBufferCap * sizeof(mg_mtl_path_elt); + + log_info("growing element buffer to %i elements\n", newBufferCap); + + backend->elementBuffer[bufferIndex] = mg_mtl_grow_input_buffer(backend->surface->device, + backend->elementBuffer[bufferIndex], + backend->eltCount * sizeof(mg_mtl_path_elt), + newBufferSize); + } + + mg_mtl_path_elt* elements = (mg_mtl_path_elt*)[backend->elementBuffer[bufferIndex] contents]; + mg_mtl_path_elt* elt = &elements[backend->eltCount]; + backend->eltCount++; + + elt->pathIndex = backend->pathCount - backend->pathBatchStart; int count = 0; switch(kind) { case MG_PATH_LINE: - mtlElt->kind = MG_MTL_LINE; + elt->kind = MG_MTL_LINE; count = 2; break; case MG_PATH_QUADRATIC: - mtlElt->kind = MG_MTL_QUADRATIC; + elt->kind = MG_MTL_QUADRATIC; count = 3; break; case MG_PATH_CUBIC: - mtlElt->kind = MG_MTL_CUBIC; + elt->kind = MG_MTL_CUBIC; count = 4; break; @@ -134,20 +163,89 @@ void mg_mtl_canvas_encode_element(mg_mtl_encoding_context* context, mg_path_elt_ break; } - mtlElt->localEltIndex = context->localEltIndex; - for(int i=0; ipathUserExtents, p[i]); + mg_update_path_extents(&backend->pathUserExtents, p[i]); - vec2 screenP = mg_mat2x3_mul(context->primitive->attributes.transform, p[i]); - mtlElt->p[i] = (vector_float2){screenP.x, screenP.y}; + vec2 screenP = mg_mat2x3_mul(backend->primitive->attributes.transform, p[i]); + elt->p[i] = (vector_float2){screenP.x, screenP.y}; - mg_update_path_extents(&context->pathScreenExtents, screenP); + mg_update_path_extents(&backend->pathScreenExtents, screenP); } } +void mg_mtl_encode_path(mg_mtl_canvas_backend* backend, mg_primitive* primitive, float scale) +{ + int bufferIndex = backend->bufferIndex; + int bufferCap = [backend->pathBuffer[bufferIndex] length] / sizeof(mg_mtl_path); + if(backend->pathCount >= bufferCap) + { + int newBufferCap = (int)(bufferCap * 1.5); + int newBufferSize = newBufferCap * sizeof(mg_mtl_path); + + log_info("growing path buffer to %i elements\n", newBufferCap); + + backend->pathBuffer[bufferIndex] = mg_mtl_grow_input_buffer(backend->surface->device, + backend->pathBuffer[bufferIndex], + backend->eltCount * sizeof(mg_mtl_path), + newBufferSize); + } + + mg_mtl_path* pathBufferData = (mg_mtl_path*)[backend->pathBuffer[backend->bufferIndex] contents]; + mg_mtl_path* path = &(pathBufferData[backend->pathCount]); + backend->pathCount++; + + path->cmd = (mg_mtl_cmd)primitive->cmd; + + path->box = (vector_float4){backend->pathScreenExtents.x, + backend->pathScreenExtents.y, + backend->pathScreenExtents.z, + backend->pathScreenExtents.w}; + + path->clip = (vector_float4){primitive->attributes.clip.x, + primitive->attributes.clip.y, + primitive->attributes.clip.x + primitive->attributes.clip.w, + primitive->attributes.clip.y + primitive->attributes.clip.h}; + + path->color = (vector_float4){primitive->attributes.color.r, + primitive->attributes.color.g, + primitive->attributes.color.b, + primitive->attributes.color.a}; + + mp_rect srcRegion = primitive->attributes.srcRegion; + + mp_rect destRegion = {backend->pathUserExtents.x, + backend->pathUserExtents.y, + backend->pathUserExtents.z - backend->pathUserExtents.x, + backend->pathUserExtents.w - backend->pathUserExtents.y}; + + if(!mg_image_is_nil(primitive->attributes.image)) + { + vec2 texSize = mg_image_size(primitive->attributes.image); + + mg_mat2x3 srcRegionToImage = {1/texSize.x, 0, srcRegion.x/texSize.x, + 0, 1/texSize.y, srcRegion.y/texSize.y}; + + mg_mat2x3 destRegionToSrcRegion = {srcRegion.w/destRegion.w, 0, 0, + 0, srcRegion.h/destRegion.h, 0}; + + mg_mat2x3 userToDestRegion = {1, 0, -destRegion.x, + 0, 1, -destRegion.y}; + + mg_mat2x3 screenToUser = mg_mat2x3_inv(primitive->attributes.transform); + + mg_mat2x3 uvTransform = srcRegionToImage; + uvTransform = mg_mat2x3_mul_m(uvTransform, destRegionToSrcRegion); + uvTransform = mg_mat2x3_mul_m(uvTransform, userToDestRegion); + uvTransform = mg_mat2x3_mul_m(uvTransform, screenToUser); + + path->uvTransform = simd_matrix(simd_make_float3(uvTransform.m[0]/scale, uvTransform.m[3]/scale, 0), + simd_make_float3(uvTransform.m[1]/scale, uvTransform.m[4]/scale, 0), + simd_make_float3(uvTransform.m[2], uvTransform.m[5], 1)); + } +} + bool mg_intersect_hull_legs(vec2 p0, vec2 p1, vec2 p2, vec2 p3, vec2* intersection) { /*NOTE: check intersection of lines (p0-p1) and (p2-p3) @@ -336,9 +434,9 @@ void mg_cubic_split(vec2 p[4], f32 t, vec2 outLeft[4], vec2 outRight[4]) outRight[3] = p[3]; } -void mg_mtl_render_stroke_line(mg_mtl_encoding_context* context, vec2* p) +void mg_mtl_render_stroke_line(mg_mtl_canvas_backend* backend, vec2* p) { - f32 width = context->primitive->attributes.width; + f32 width = backend->primitive->attributes.width; vec2 v = {p[1].x-p[0].x, p[1].y-p[0].y}; vec2 n = {v.y, -v.x}; @@ -350,28 +448,27 @@ void mg_mtl_render_stroke_line(mg_mtl_encoding_context* context, vec2* p) vec2 joint0[2] = {vec2_add(p[0], vec2_mul(-1, offset)), vec2_add(p[0], offset)}; vec2 joint1[2] = {vec2_add(p[1], offset), vec2_add(p[1], vec2_mul(-1, offset))}; - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, right); - - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, left); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, joint0); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, joint1); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, right); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, left); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, joint0); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, joint1); } -void mg_mtl_render_stroke_quadratic(mg_mtl_encoding_context* context, vec2* p) +void mg_mtl_render_stroke_quadratic(mg_mtl_canvas_backend* backend, vec2* p) { - f32 width = context->primitive->attributes.width; - f32 tolerance = minimum(context->primitive->attributes.tolerance, 0.5 * width); + f32 width = backend->primitive->attributes.width; + f32 tolerance = minimum(backend->primitive->attributes.tolerance, 0.5 * width); //NOTE: check for degenerate line case const f32 equalEps = 1e-3; if(vec2_close(p[0], p[1], equalEps)) { - mg_mtl_render_stroke_line(context, p+1); + mg_mtl_render_stroke_line(backend, p+1); return; } else if(vec2_close(p[1], p[2], equalEps)) { - mg_mtl_render_stroke_line(context, p); + mg_mtl_render_stroke_line(backend, p); return; } @@ -386,8 +483,8 @@ void mg_mtl_render_stroke_quadratic(mg_mtl_encoding_context* context, vec2* p) vec2 splitLeft[3]; vec2 splitRight[3]; mg_quadratic_split(p, 0.5, splitLeft, splitRight); - mg_mtl_render_stroke_quadratic(context, splitLeft); - mg_mtl_render_stroke_quadratic(context, splitRight); + mg_mtl_render_stroke_quadratic(backend, splitLeft); + mg_mtl_render_stroke_quadratic(backend, splitRight); } else { @@ -428,8 +525,8 @@ void mg_mtl_render_stroke_quadratic(mg_mtl_encoding_context* context, vec2* p) vec2 splitLeft[3]; vec2 splitRight[3]; mg_quadratic_split(p, maxOvershootParameter, splitLeft, splitRight); - mg_mtl_render_stroke_quadratic(context, splitLeft); - mg_mtl_render_stroke_quadratic(context, splitRight); + mg_mtl_render_stroke_quadratic(backend, splitLeft); + mg_mtl_render_stroke_quadratic(backend, splitRight); } else { @@ -437,21 +534,21 @@ void mg_mtl_render_stroke_quadratic(mg_mtl_encoding_context* context, vec2* p) leftHull[0] = leftHull[2]; leftHull[2] = tmp; - mg_mtl_canvas_encode_element(context, MG_PATH_QUADRATIC, rightHull); - mg_mtl_canvas_encode_element(context, MG_PATH_QUADRATIC, leftHull); + mg_mtl_canvas_encode_element(backend, MG_PATH_QUADRATIC, rightHull); + mg_mtl_canvas_encode_element(backend, MG_PATH_QUADRATIC, leftHull); vec2 joint0[2] = {rightHull[2], leftHull[0]}; vec2 joint1[2] = {leftHull[2], rightHull[0]}; - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, joint0); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, joint1); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, joint0); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, joint1); } } } -void mg_mtl_render_stroke_cubic(mg_mtl_encoding_context* context, vec2* p) +void mg_mtl_render_stroke_cubic(mg_mtl_canvas_backend* backend, vec2* p) { - f32 width = context->primitive->attributes.width; - f32 tolerance = minimum(context->primitive->attributes.tolerance, 0.5 * width); + f32 width = backend->primitive->attributes.width; + f32 tolerance = minimum(backend->primitive->attributes.tolerance, 0.5 * width); //NOTE: check degenerate line cases f32 equalEps = 1e-3; @@ -461,19 +558,19 @@ void mg_mtl_render_stroke_cubic(mg_mtl_encoding_context* context, vec2* p) ||(vec2_close(p[1], p[2], equalEps) && vec2_close(p[2], p[3], equalEps))) { vec2 line[2] = {p[0], p[3]}; - mg_mtl_render_stroke_line(context, line); + mg_mtl_render_stroke_line(backend, line); return; } else if(vec2_close(p[0], p[1], equalEps) && vec2_close(p[1], p[3], equalEps)) { vec2 line[2] = {p[0], vec2_add(vec2_mul(5./9, p[0]), vec2_mul(4./9, p[2]))}; - mg_mtl_render_stroke_line(context, line); + mg_mtl_render_stroke_line(backend, line); return; } else if(vec2_close(p[0], p[2], equalEps) && vec2_close(p[2], p[3], equalEps)) { vec2 line[2] = {p[0], vec2_add(vec2_mul(5./9, p[0]), vec2_mul(4./9, p[1]))}; - mg_mtl_render_stroke_line(context, line); + mg_mtl_render_stroke_line(backend, line); return; } @@ -488,8 +585,8 @@ void mg_mtl_render_stroke_cubic(mg_mtl_encoding_context* context, vec2* p) vec2 splitLeft[4]; vec2 splitRight[4]; mg_cubic_split(p, 0.5, splitLeft, splitRight); - mg_mtl_render_stroke_cubic(context, splitLeft); - mg_mtl_render_stroke_cubic(context, splitRight); + mg_mtl_render_stroke_cubic(backend, splitLeft); + mg_mtl_render_stroke_cubic(backend, splitRight); } else { @@ -530,8 +627,8 @@ void mg_mtl_render_stroke_cubic(mg_mtl_encoding_context* context, vec2* p) vec2 splitLeft[4]; vec2 splitRight[4]; mg_cubic_split(p, maxOvershootParameter, splitLeft, splitRight); - mg_mtl_render_stroke_cubic(context, splitLeft); - mg_mtl_render_stroke_cubic(context, splitRight); + mg_mtl_render_stroke_cubic(backend, splitLeft); + mg_mtl_render_stroke_cubic(backend, splitRight); } else { @@ -542,18 +639,18 @@ void mg_mtl_render_stroke_cubic(mg_mtl_encoding_context* context, vec2* p) leftHull[1] = leftHull[2]; leftHull[2] = tmp; - mg_mtl_canvas_encode_element(context, MG_PATH_CUBIC, rightHull); - mg_mtl_canvas_encode_element(context, MG_PATH_CUBIC, leftHull); + mg_mtl_canvas_encode_element(backend, MG_PATH_CUBIC, rightHull); + mg_mtl_canvas_encode_element(backend, MG_PATH_CUBIC, leftHull); vec2 joint0[2] = {rightHull[3], leftHull[0]}; vec2 joint1[2] = {leftHull[3], rightHull[0]}; - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, joint0); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, joint1); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, joint0); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, joint1); } } } -void mg_mtl_render_stroke_element(mg_mtl_encoding_context* context, +void mg_mtl_render_stroke_element(mg_mtl_canvas_backend* backend, mg_path_elt* element, vec2 currentPoint, vec2* startTangent, @@ -566,17 +663,17 @@ void mg_mtl_render_stroke_element(mg_mtl_encoding_context* context, switch(element->type) { case MG_PATH_LINE: - mg_mtl_render_stroke_line(context, controlPoints); + mg_mtl_render_stroke_line(backend, controlPoints); endPointIndex = 1; break; case MG_PATH_QUADRATIC: - mg_mtl_render_stroke_quadratic(context, controlPoints); + mg_mtl_render_stroke_quadratic(backend, controlPoints); endPointIndex = 2; break; case MG_PATH_CUBIC: - mg_mtl_render_stroke_cubic(context, controlPoints); + mg_mtl_render_stroke_cubic(backend, controlPoints); endPointIndex = 3; break; @@ -613,11 +710,11 @@ void mg_mtl_render_stroke_element(mg_mtl_encoding_context* context, DEBUG_ASSERT(startTangent->x != 0 || startTangent->y != 0); } -void mg_mtl_stroke_cap(mg_mtl_encoding_context* context, +void mg_mtl_stroke_cap(mg_mtl_canvas_backend* backend, vec2 p0, vec2 direction) { - mg_attributes* attributes = &context->primitive->attributes; + mg_attributes* attributes = &backend->primitive->attributes; //NOTE(martin): compute the tangent and normal vectors (multiplied by half width) at the cap point f32 dn = sqrt(Square(direction.x) + Square(direction.y)); @@ -635,18 +732,18 @@ void mg_mtl_stroke_cap(mg_mtl_encoding_context* context, {p0.x - n0.x, p0.y - n0.y}, {p0.x + n0.x, p0.y + n0.y}}; - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points+1); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points+2); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points+3); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points+1); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points+2); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points+3); } -void mg_mtl_stroke_joint(mg_mtl_encoding_context* context, +void mg_mtl_stroke_joint(mg_mtl_canvas_backend* backend, vec2 p0, vec2 t0, vec2 t1) { - mg_attributes* attributes = &context->primitive->attributes; + mg_attributes* attributes = &backend->primitive->attributes; //NOTE(martin): compute the normals at the joint point f32 norm_t0 = sqrt(Square(t0.x) + Square(t0.y)); @@ -694,10 +791,10 @@ void mg_mtl_stroke_joint(mg_mtl_encoding_context* context, {p0.x + n1.x*halfW, p0.y + n1.y*halfW}, p0}; - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points+1); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points+2); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points+3); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points+1); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points+2); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points+3); } else { @@ -707,13 +804,13 @@ void mg_mtl_stroke_joint(mg_mtl_encoding_context* context, {p0.x + n1.x*halfW, p0.y + n1.y*halfW}, p0}; - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points+1); - mg_mtl_canvas_encode_element(context, MG_PATH_LINE, points+2); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points+1); + mg_mtl_canvas_encode_element(backend, MG_PATH_LINE, points+2); } } -u32 mg_mtl_render_stroke_subpath(mg_mtl_encoding_context* context, +u32 mg_mtl_render_stroke_subpath(mg_mtl_canvas_backend* backend, mg_path_elt* elements, mg_path_descriptor* path, u32 startIndex, @@ -730,7 +827,7 @@ u32 mg_mtl_render_stroke_subpath(mg_mtl_encoding_context* context, vec2 endTangent = {0, 0}; //NOTE(martin): render first element and compute first tangent - mg_mtl_render_stroke_element(context, elements + startIndex, currentPoint, &startTangent, &endTangent, &endPoint); + mg_mtl_render_stroke_element(backend, elements + startIndex, currentPoint, &startTangent, &endTangent, &endPoint); firstTangent = startTangent; previousEndTangent = endTangent; @@ -738,18 +835,18 @@ u32 mg_mtl_render_stroke_subpath(mg_mtl_encoding_context* context, //NOTE(martin): render subsequent elements along with their joints - mg_attributes* attributes = &context->primitive->attributes; + mg_attributes* attributes = &backend->primitive->attributes; u32 eltIndex = startIndex + 1; for(; eltIndexjoint != MG_JOINT_NONE) { - mg_mtl_stroke_joint(context, currentPoint, previousEndTangent, startTangent); + mg_mtl_stroke_joint(backend, currentPoint, previousEndTangent, startTangent); } previousEndTangent = endTangent; currentPoint = endPoint; @@ -764,19 +861,19 @@ u32 mg_mtl_render_stroke_subpath(mg_mtl_encoding_context* context, if(attributes->joint != MG_JOINT_NONE) { //NOTE(martin): add a closing joint if the path is closed - mg_mtl_stroke_joint(context, endPoint, endTangent, firstTangent); + mg_mtl_stroke_joint(backend, endPoint, endTangent, firstTangent); } } else if(attributes->cap == MG_CAP_SQUARE) { //NOTE(martin): add start and end cap - mg_mtl_stroke_cap(context, startPoint, (vec2){-startTangent.x, -startTangent.y}); - mg_mtl_stroke_cap(context, endPoint, endTangent); + mg_mtl_stroke_cap(backend, startPoint, (vec2){-startTangent.x, -startTangent.y}); + mg_mtl_stroke_cap(backend, endPoint, endTangent); } return(eltIndex); } -void mg_mtl_render_stroke(mg_mtl_encoding_context* context, +void mg_mtl_render_stroke(mg_mtl_canvas_backend* backend, mg_path_elt* elements, mg_path_descriptor* path) { @@ -796,7 +893,7 @@ void mg_mtl_render_stroke(mg_mtl_encoding_context* context, } if(startIndex < eltCount) { - startIndex = mg_mtl_render_stroke_subpath(context, elements, path, startIndex, startPoint); + startIndex = mg_mtl_render_stroke_subpath(backend, elements, path, startIndex, startPoint); } } } @@ -804,8 +901,6 @@ void mg_mtl_render_stroke(mg_mtl_encoding_context* context, void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, mg_mtl_surface* surface, - int pathCount, - int eltCount, mg_image_data* image, int tileSize, int nTilesX, @@ -813,6 +908,11 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, vec2 viewportSize, f32 scale) { + int pathBufferOffset = backend->pathBatchStart * sizeof(mg_mtl_path); + int elementBufferOffset = backend->eltBatchStart * sizeof(mg_mtl_path_elt); + int pathCount = backend->pathCount - backend->pathBatchStart; + int eltCount = backend->eltCount - backend->eltBatchStart; + //NOTE: encode GPU commands @autoreleasepool { @@ -842,7 +942,7 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, [pathEncoder setComputePipelineState: backend->pathPipeline]; [pathEncoder setBytes:&pathCount length:sizeof(int) atIndex:0]; - [pathEncoder setBuffer:backend->pathBuffer[backend->bufferIndex] offset:backend->pathBufferOffset atIndex:1]; + [pathEncoder setBuffer:backend->pathBuffer[backend->bufferIndex] offset:pathBufferOffset atIndex:1]; [pathEncoder setBuffer:backend->pathQueueBuffer offset:0 atIndex:2]; [pathEncoder setBuffer:backend->tileQueueBuffer offset:0 atIndex:3]; [pathEncoder setBuffer:backend->tileQueueCountBuffer offset:0 atIndex:4]; @@ -861,7 +961,7 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, [segmentEncoder setComputePipelineState: backend->segmentPipeline]; [segmentEncoder setBytes:&eltCount length:sizeof(int) atIndex:0]; - [segmentEncoder setBuffer:backend->elementBuffer[backend->bufferIndex] offset:backend->elementBufferOffset atIndex:1]; + [segmentEncoder setBuffer:backend->elementBuffer[backend->bufferIndex] offset:elementBufferOffset atIndex:1]; [segmentEncoder setBuffer:backend->segmentCountBuffer offset:0 atIndex:2]; [segmentEncoder setBuffer:backend->segmentBuffer offset:0 atIndex:3]; [segmentEncoder setBuffer:backend->pathQueueBuffer offset:0 atIndex:4]; @@ -901,7 +1001,7 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, [mergeEncoder setComputePipelineState: backend->mergePipeline]; [mergeEncoder setBytes:&pathCount length:sizeof(int) atIndex:0]; - [mergeEncoder setBuffer:backend->pathBuffer[backend->bufferIndex] offset:backend->pathBufferOffset atIndex:1]; + [mergeEncoder setBuffer:backend->pathBuffer[backend->bufferIndex] offset:pathBufferOffset atIndex:1]; [mergeEncoder setBuffer:backend->pathQueueBuffer offset:0 atIndex:2]; [mergeEncoder setBuffer:backend->tileQueueBuffer offset:0 atIndex:3]; [mergeEncoder setBuffer:backend->tileOpBuffer offset:0 atIndex:4]; @@ -926,7 +1026,7 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, [rasterEncoder setBuffer:backend->screenTilesBuffer offset:0 atIndex:0]; [rasterEncoder setBuffer:backend->tileOpBuffer offset:0 atIndex:1]; - [rasterEncoder setBuffer:backend->pathBuffer[backend->bufferIndex] offset:backend->pathBufferOffset atIndex:2]; + [rasterEncoder setBuffer:backend->pathBuffer[backend->bufferIndex] offset:pathBufferOffset atIndex:2]; [rasterEncoder setBuffer:backend->segmentBuffer offset:0 atIndex:3]; [rasterEncoder setBytes:&tileSize length:sizeof(int) atIndex:4]; [rasterEncoder setBytes:&scale length:sizeof(float) atIndex:5]; @@ -947,7 +1047,6 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, MTLSize rasterGridSize = MTLSizeMake(viewportSize.x, viewportSize.y, 1); MTLSize rasterGroupSize = MTLSizeMake(MG_MTL_TILE_SIZE, MG_MTL_TILE_SIZE, 1); -// [rasterEncoder dispatchThreads: rasterGridSize threadsPerThreadgroup: rasterGroupSize]; [rasterEncoder dispatchThreadgroupsWithIndirectBuffer: backend->rasterDispatchBuffer indirectBufferOffset: 0 @@ -973,6 +1072,9 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, vertexCount: 3 ]; [renderEncoder endEncoding]; } + + backend->pathBatchStart = backend->pathCount; + backend->eltBatchStart = backend->eltCount; } void mg_mtl_canvas_resize(mg_mtl_canvas_backend* backend, vec2 size) @@ -1019,18 +1121,11 @@ void mg_mtl_canvas_render(mg_canvas_backend* interface, { mg_mtl_canvas_backend* backend = (mg_mtl_canvas_backend*)interface; - //NOTE: update rolling buffers + //NOTE: update rolling input buffers dispatch_semaphore_wait(backend->bufferSemaphore, DISPATCH_TIME_FOREVER); backend->bufferIndex = (backend->bufferIndex + 1) % MG_MTL_INPUT_BUFFERS_COUNT; - mg_mtl_path_elt* elementBufferData = (mg_mtl_path_elt*)[backend->elementBuffer[backend->bufferIndex] contents]; - mg_mtl_path* pathBufferData = (mg_mtl_path*)[backend->pathBuffer[backend->bufferIndex] contents]; - - ///////////////////////////////////////////////////////////////////////////////////// - //TODO: ensure screen tiles buffer is correct size - ///////////////////////////////////////////////////////////////////////////////////// - - //NOTE: prepare rendering + //NOTE: ensure screen tiles buffer is correct size mg_mtl_surface* surface = backend->surface; mp_rect frame = surface->interface.getFrame((mg_surface_data*)surface); @@ -1046,6 +1141,7 @@ void mg_mtl_canvas_render(mg_canvas_backend* interface, mg_mtl_canvas_resize(backend, viewportSize); } + //NOTE: acquire metal resources for rendering mg_mtl_surface_acquire_command_buffer(surface); mg_mtl_surface_acquire_drawable(surface); @@ -1068,17 +1164,15 @@ void mg_mtl_canvas_render(mg_canvas_backend* interface, renderEncoder.label = @"clear pass"; [renderEncoder endEncoding]; } - backend->pathBufferOffset = 0; - backend->elementBufferOffset = 0; + backend->pathCount = 0; + backend->pathBatchStart = 0; + backend->eltCount = 0; + backend->eltBatchStart = 0; //NOTE: encode and render batches - int pathCount = 0; vec2 currentPos = {0}; mg_image currentImage = mg_image_nil(); - mg_mtl_encoding_context context = {.mtlEltCount = 0, - .elementBufferData = elementBufferData, - .pathBufferData = pathBufferData}; for(int primitiveIndex = 0; primitiveIndex < primitiveCount; primitiveIndex++) { @@ -1090,51 +1184,37 @@ void mg_mtl_canvas_render(mg_canvas_backend* interface, mg_mtl_render_batch(backend, surface, - pathCount, - context.mtlEltCount, imageData, tileSize, nTilesX, nTilesY, viewportSize, scale); - - backend->pathBufferOffset += pathCount * sizeof(mg_mtl_path); - backend->elementBufferOffset += context.mtlEltCount * sizeof(mg_mtl_path_elt); - pathCount = 0; - context.mtlEltCount = 0; - context.elementBufferData = (mg_mtl_path_elt*)((char*)elementBufferData + backend->elementBufferOffset); - context.pathBufferData = (mg_mtl_path*)((char*)pathBufferData + backend->pathBufferOffset); } currentImage = primitive->attributes.image; if(primitive->path.count) { - context.primitive = primitive; - context.pathIndex = pathCount; - context.pathScreenExtents = (vec4){FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX}; - context.pathUserExtents = (vec4){FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX}; + backend->primitive = primitive; + backend->pathScreenExtents = (vec4){FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX}; + backend->pathUserExtents = (vec4){FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX}; if(primitive->cmd == MG_CMD_STROKE) { - mg_mtl_render_stroke(&context, pathElements + primitive->path.startIndex, &primitive->path); + mg_mtl_render_stroke(backend, pathElements + primitive->path.startIndex, &primitive->path); } else { - int segCount = 0; for(int eltIndex = 0; (eltIndex < primitive->path.count) && (primitive->path.startIndex + eltIndex < eltCount); eltIndex++) { - context.localEltIndex = segCount; - mg_path_elt* elt = &pathElements[primitive->path.startIndex + eltIndex]; if(elt->type != MG_PATH_MOVE) { vec2 p[4] = {currentPos, elt->p[0], elt->p[1], elt->p[2]}; - mg_mtl_canvas_encode_element(&context, elt->type, p); - segCount++; + mg_mtl_canvas_encode_element(backend, elt->type, p); } switch(elt->type) { @@ -1156,66 +1236,15 @@ void mg_mtl_canvas_render(mg_canvas_backend* interface, } } } - //NOTE: push path - mg_mtl_path* path = &context.pathBufferData[pathCount]; - pathCount++; - - path->cmd = (mg_mtl_cmd)primitive->cmd; - - path->box = (vector_float4){context.pathScreenExtents.x, - context.pathScreenExtents.y, - context.pathScreenExtents.z, - context.pathScreenExtents.w}; - - path->clip = (vector_float4){primitive->attributes.clip.x, - primitive->attributes.clip.y, - primitive->attributes.clip.x + primitive->attributes.clip.w, - primitive->attributes.clip.y + primitive->attributes.clip.h}; - - path->color = (vector_float4){primitive->attributes.color.r, - primitive->attributes.color.g, - primitive->attributes.color.b, - primitive->attributes.color.a}; - - mp_rect srcRegion = primitive->attributes.srcRegion; - - mp_rect destRegion = {context.pathUserExtents.x, - context.pathUserExtents.y, - context.pathUserExtents.z - context.pathUserExtents.x, - context.pathUserExtents.w - context.pathUserExtents.y}; - - if(!mg_image_is_nil(primitive->attributes.image)) - { - vec2 texSize = mg_image_size(primitive->attributes.image); - - mg_mat2x3 srcRegionToImage = {1/texSize.x, 0, srcRegion.x/texSize.x, - 0, 1/texSize.y, srcRegion.y/texSize.y}; - - mg_mat2x3 destRegionToSrcRegion = {srcRegion.w/destRegion.w, 0, 0, - 0, srcRegion.h/destRegion.h, 0}; - - mg_mat2x3 userToDestRegion = {1, 0, -destRegion.x, - 0, 1, -destRegion.y}; - - mg_mat2x3 screenToUser = mg_mat2x3_inv(primitive->attributes.transform); - - mg_mat2x3 uvTransform = srcRegionToImage; - uvTransform = mg_mat2x3_mul_m(uvTransform, destRegionToSrcRegion); - uvTransform = mg_mat2x3_mul_m(uvTransform, userToDestRegion); - uvTransform = mg_mat2x3_mul_m(uvTransform, screenToUser); - - path->uvTransform = simd_matrix(simd_make_float3(uvTransform.m[0]/scale, uvTransform.m[3]/scale, 0), - simd_make_float3(uvTransform.m[1]/scale, uvTransform.m[4]/scale, 0), - simd_make_float3(uvTransform.m[2], uvTransform.m[5], 1)); - } + //NOTE: encode path + mg_mtl_encode_path(backend, primitive, scale); } } mg_image_data* imageData = mg_image_data_from_handle(currentImage); + mg_mtl_render_batch(backend, surface, - pathCount, - context.mtlEltCount, imageData, tileSize, nTilesX, @@ -1321,8 +1350,8 @@ void mg_mtl_canvas_image_upload_region(mg_canvas_backend* backendInterface, mg_i bytesPerRow: 4 * region.w]; }} -const u32 MG_MTL_PATH_BUFFER_SIZE = (4<<20)*sizeof(mg_mtl_path), - MG_MTL_ELEMENT_BUFFER_SIZE = (4<<20)*sizeof(mg_mtl_path_elt), +const u32 MG_MTL_DEFAULT_PATH_BUFFER_LEN = (4<<10), + MG_MTL_DEFAULT_ELT_BUFFER_LEN = (4<<10), MG_MTL_SEGMENT_BUFFER_SIZE = (4<<20)*sizeof(mg_mtl_segment), MG_MTL_PATH_QUEUE_BUFFER_SIZE = (4<<20)*sizeof(mg_mtl_path_queue), MG_MTL_TILE_QUEUE_BUFFER_SIZE = (4<<20)*sizeof(mg_mtl_tile_queue), @@ -1424,10 +1453,10 @@ mg_canvas_backend* mtl_canvas_backend_create(mg_mtl_surface* surface) for(int i=0; ipathBuffer[i] = [surface->device newBufferWithLength: MG_MTL_PATH_BUFFER_SIZE + backend->pathBuffer[i] = [surface->device newBufferWithLength: MG_MTL_DEFAULT_PATH_BUFFER_LEN * sizeof(mg_mtl_path) options: bufferOptions]; - backend->elementBuffer[i] = [surface->device newBufferWithLength: MG_MTL_ELEMENT_BUFFER_SIZE + backend->elementBuffer[i] = [surface->device newBufferWithLength: MG_MTL_DEFAULT_ELT_BUFFER_LEN * sizeof(mg_mtl_path_elt) options: bufferOptions]; } From 025ebd91d50ce1207b285be6983522eade6cbab4 Mon Sep 17 00:00:00 2001 From: Martin Fouilleul Date: Tue, 11 Jul 2023 20:03:17 +0200 Subject: [PATCH 3/6] [osx, canvas] - Pass buffer lengths to kernels and bound check when allocating from buffers - Dynamically compute/guess size of intermediate buffers and grow if needed --- src/mtl_renderer.m | 100 +++++++++--- src/mtl_renderer.metal | 359 +++++++++++++++++++++++------------------ 2 files changed, 282 insertions(+), 177 deletions(-) diff --git a/src/mtl_renderer.m b/src/mtl_renderer.m index abbe27e..ad9531d 100644 --- a/src/mtl_renderer.m +++ b/src/mtl_renderer.m @@ -68,6 +68,9 @@ typedef struct mg_mtl_canvas_backend vec4 pathScreenExtents; vec4 pathUserExtents; + int maxTileQueueCount; + int maxSegmentCount; + } mg_mtl_canvas_backend; typedef struct mg_mtl_image_data @@ -145,16 +148,19 @@ void mg_mtl_canvas_encode_element(mg_mtl_canvas_backend* backend, mg_path_elt_ty switch(kind) { case MG_PATH_LINE: + backend->maxSegmentCount += 1; elt->kind = MG_MTL_LINE; count = 2; break; case MG_PATH_QUADRATIC: + backend->maxSegmentCount += 3; elt->kind = MG_MTL_QUADRATIC; count = 3; break; case MG_PATH_CUBIC: + backend->maxSegmentCount += 7; elt->kind = MG_MTL_CUBIC; count = 4; break; @@ -244,6 +250,10 @@ void mg_mtl_encode_path(mg_mtl_canvas_backend* backend, mg_primitive* primitive, simd_make_float3(uvTransform.m[1]/scale, uvTransform.m[4]/scale, 0), simd_make_float3(uvTransform.m[2], uvTransform.m[5], 1)); } + + int nTilesX = ((path->box.z - path->box.x)*scale - 1) / MG_MTL_TILE_SIZE + 1; + int nTilesY = ((path->box.w - path->box.y)*scale - 1) / MG_MTL_TILE_SIZE + 1; + backend->maxTileQueueCount += (nTilesX * nTilesY); } bool mg_intersect_hull_legs(vec2 p0, vec2 p1, vec2 p2, vec2 p3, vec2* intersection) @@ -899,6 +909,27 @@ void mg_mtl_render_stroke(mg_mtl_canvas_backend* backend, } +void mg_mtl_grow_buffer_if_needed(mg_mtl_canvas_backend* backend, id* buffer, u64 wantedSize) +{ + u64 bufferSize = [(*buffer) length]; + if(bufferSize < wantedSize) + { + int newSize = wantedSize * 1.2; + + @autoreleasepool + { + //NOTE: MTLBuffers are retained by the command buffer, so we don't risk deallocating while the buffer is in use + [*buffer release]; + *buffer = nil; + + id device = backend->surface->device; + MTLResourceOptions bufferOptions = MTLResourceStorageModePrivate; + + *buffer = [device newBufferWithLength: newSize options: bufferOptions]; + } + } +} + void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, mg_mtl_surface* surface, mg_image_data* image, @@ -910,13 +941,21 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, { int pathBufferOffset = backend->pathBatchStart * sizeof(mg_mtl_path); int elementBufferOffset = backend->eltBatchStart * sizeof(mg_mtl_path_elt); - int pathCount = backend->pathCount - backend->pathBatchStart; - int eltCount = backend->eltCount - backend->eltBatchStart; + int pathCount = backend->pathCount - backend->pathBatchStart; + int eltCount = backend->eltCount - backend->eltBatchStart; + + //NOTE: update intermediate buffers sizes if needed + + mg_mtl_grow_buffer_if_needed(backend, &backend->pathQueueBuffer, pathCount * sizeof(mg_mtl_path_queue)); + mg_mtl_grow_buffer_if_needed(backend, &backend->tileQueueBuffer, backend->maxTileQueueCount * sizeof(mg_mtl_tile_queue)); + mg_mtl_grow_buffer_if_needed(backend, &backend->segmentBuffer, backend->maxSegmentCount * sizeof(mg_mtl_segment)); + mg_mtl_grow_buffer_if_needed(backend, &backend->screenTilesBuffer, nTilesX * nTilesY * sizeof(mg_mtl_screen_tile)); + mg_mtl_grow_buffer_if_needed(backend, &backend->tileOpBuffer, backend->maxSegmentCount * 30 * sizeof(mg_mtl_tile_op)); //NOTE: encode GPU commands @autoreleasepool { - //NOTE: create output texture + //NOTE: clear output texture MTLRenderPassDescriptor* clearDescriptor = [MTLRenderPassDescriptor renderPassDescriptor]; clearDescriptor.colorAttachments[0].texture = backend->outTexture; clearDescriptor.colorAttachments[0].loadAction = MTLLoadActionClear; @@ -941,13 +980,16 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, pathEncoder.label = @"path pass"; [pathEncoder setComputePipelineState: backend->pathPipeline]; + int tileQueueMax = [backend->tileQueueBuffer length] / sizeof(mg_mtl_tile_queue); + [pathEncoder setBytes:&pathCount length:sizeof(int) atIndex:0]; [pathEncoder setBuffer:backend->pathBuffer[backend->bufferIndex] offset:pathBufferOffset atIndex:1]; [pathEncoder setBuffer:backend->pathQueueBuffer offset:0 atIndex:2]; [pathEncoder setBuffer:backend->tileQueueBuffer offset:0 atIndex:3]; [pathEncoder setBuffer:backend->tileQueueCountBuffer offset:0 atIndex:4]; - [pathEncoder setBytes:&tileSize length:sizeof(int) atIndex:5]; - [pathEncoder setBytes:&scale length:sizeof(int) atIndex:6]; + [pathEncoder setBytes:&tileQueueMax length:sizeof(int) atIndex:5]; + [pathEncoder setBytes:&tileSize length:sizeof(int) atIndex:6]; + [pathEncoder setBytes:&scale length:sizeof(int) atIndex:7]; MTLSize pathGridSize = MTLSizeMake(pathCount, 1, 1); MTLSize pathGroupSize = MTLSizeMake([backend->pathPipeline maxTotalThreadsPerThreadgroup], 1, 1); @@ -960,6 +1002,9 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, segmentEncoder.label = @"segment pass"; [segmentEncoder setComputePipelineState: backend->segmentPipeline]; + int tileOpMax = [backend->tileOpBuffer length] / sizeof(mg_mtl_tile_op); + int segmentMax = [backend->segmentBuffer length] / sizeof(mg_mtl_segment); + [segmentEncoder setBytes:&eltCount length:sizeof(int) atIndex:0]; [segmentEncoder setBuffer:backend->elementBuffer[backend->bufferIndex] offset:elementBufferOffset atIndex:1]; [segmentEncoder setBuffer:backend->segmentCountBuffer offset:0 atIndex:2]; @@ -968,10 +1013,12 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, [segmentEncoder setBuffer:backend->tileQueueBuffer offset:0 atIndex:5]; [segmentEncoder setBuffer:backend->tileOpBuffer offset:0 atIndex:6]; [segmentEncoder setBuffer:backend->tileOpCountBuffer offset:0 atIndex:7]; - [segmentEncoder setBytes:&tileSize length:sizeof(int) atIndex:8]; - [segmentEncoder setBytes:&scale length:sizeof(int) atIndex:9]; - [segmentEncoder setBuffer:backend->logBuffer[backend->bufferIndex] offset:0 atIndex:10]; - [segmentEncoder setBuffer:backend->logOffsetBuffer[backend->bufferIndex] offset:0 atIndex:11]; + [segmentEncoder setBytes:&tileOpMax length:sizeof(int) atIndex:8]; + [segmentEncoder setBytes:&segmentMax length:sizeof(int) atIndex:9]; + [segmentEncoder setBytes:&tileSize length:sizeof(int) atIndex:10]; + [segmentEncoder setBytes:&scale length:sizeof(int) atIndex:11]; + [segmentEncoder setBuffer:backend->logBuffer[backend->bufferIndex] offset:0 atIndex:12]; + [segmentEncoder setBuffer:backend->logOffsetBuffer[backend->bufferIndex] offset:0 atIndex:13]; MTLSize segmentGridSize = MTLSizeMake(eltCount, 1, 1); MTLSize segmentGroupSize = MTLSizeMake([backend->segmentPipeline maxTotalThreadsPerThreadgroup], 1, 1); @@ -1008,10 +1055,11 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, [mergeEncoder setBuffer:backend->tileOpCountBuffer offset:0 atIndex:5]; [mergeEncoder setBuffer:backend->rasterDispatchBuffer offset:0 atIndex:6]; [mergeEncoder setBuffer:backend->screenTilesBuffer offset:0 atIndex:7]; - [mergeEncoder setBytes:&tileSize length:sizeof(int) atIndex:8]; - [mergeEncoder setBytes:&scale length:sizeof(float) atIndex:9]; - [mergeEncoder setBuffer:backend->logBuffer[backend->bufferIndex] offset:0 atIndex:10]; - [mergeEncoder setBuffer:backend->logOffsetBuffer[backend->bufferIndex] offset:0 atIndex:11]; + [mergeEncoder setBytes:&tileOpMax length:sizeof(int) atIndex:8]; + [mergeEncoder setBytes:&tileSize length:sizeof(int) atIndex:9]; + [mergeEncoder setBytes:&scale length:sizeof(float) atIndex:10]; + [mergeEncoder setBuffer:backend->logBuffer[backend->bufferIndex] offset:0 atIndex:11]; + [mergeEncoder setBuffer:backend->logOffsetBuffer[backend->bufferIndex] offset:0 atIndex:12]; MTLSize mergeGridSize = MTLSizeMake(nTilesX, nTilesY, 1); MTLSize mergeGroupSize = MTLSizeMake(MG_MTL_TILE_SIZE, MG_MTL_TILE_SIZE, 1); @@ -1075,6 +1123,9 @@ void mg_mtl_render_batch(mg_mtl_canvas_backend* backend, backend->pathBatchStart = backend->pathCount; backend->eltBatchStart = backend->eltCount; + + backend->maxSegmentCount = 0; + backend->maxTileQueueCount = 0; } void mg_mtl_canvas_resize(mg_mtl_canvas_backend* backend, vec2 size) @@ -1168,6 +1219,8 @@ void mg_mtl_canvas_render(mg_canvas_backend* interface, backend->pathBatchStart = 0; backend->eltCount = 0; backend->eltBatchStart = 0; + backend->maxSegmentCount = 0; + backend->maxTileQueueCount = 0; //NOTE: encode and render batches vec2 currentPos = {0}; @@ -1350,12 +1403,13 @@ void mg_mtl_canvas_image_upload_region(mg_canvas_backend* backendInterface, mg_i bytesPerRow: 4 * region.w]; }} -const u32 MG_MTL_DEFAULT_PATH_BUFFER_LEN = (4<<10), - MG_MTL_DEFAULT_ELT_BUFFER_LEN = (4<<10), - MG_MTL_SEGMENT_BUFFER_SIZE = (4<<20)*sizeof(mg_mtl_segment), - MG_MTL_PATH_QUEUE_BUFFER_SIZE = (4<<20)*sizeof(mg_mtl_path_queue), - MG_MTL_TILE_QUEUE_BUFFER_SIZE = (4<<20)*sizeof(mg_mtl_tile_queue), - MG_MTL_TILE_OP_BUFFER_SIZE = (4<<20)*sizeof(mg_mtl_tile_op); +const u32 MG_MTL_DEFAULT_PATH_BUFFER_LEN = (4<<10), + MG_MTL_DEFAULT_ELT_BUFFER_LEN = (4<<10), + + MG_MTL_DEFAULT_SEGMENT_BUFFER_LEN = (4<<10), + MG_MTL_DEFAULT_PATH_QUEUE_BUFFER_LEN = (4<<10), + MG_MTL_DEFAULT_TILE_QUEUE_BUFFER_LEN = (4<<10), + MG_MTL_DEFAULT_TILE_OP_BUFFER_LEN = (4<<14); mg_canvas_backend* mtl_canvas_backend_create(mg_mtl_surface* surface) { @@ -1461,22 +1515,22 @@ mg_canvas_backend* mtl_canvas_backend_create(mg_mtl_surface* surface) } bufferOptions = MTLResourceStorageModePrivate; - backend->segmentBuffer = [surface->device newBufferWithLength: MG_MTL_SEGMENT_BUFFER_SIZE + backend->segmentBuffer = [surface->device newBufferWithLength: MG_MTL_DEFAULT_SEGMENT_BUFFER_LEN * sizeof(mg_mtl_segment) options: bufferOptions]; backend->segmentCountBuffer = [surface->device newBufferWithLength: sizeof(int) options: bufferOptions]; - backend->pathQueueBuffer = [surface->device newBufferWithLength: MG_MTL_PATH_QUEUE_BUFFER_SIZE + backend->pathQueueBuffer = [surface->device newBufferWithLength: MG_MTL_DEFAULT_PATH_QUEUE_BUFFER_LEN * sizeof(mg_mtl_path_queue) options: bufferOptions]; - backend->tileQueueBuffer = [surface->device newBufferWithLength: MG_MTL_TILE_QUEUE_BUFFER_SIZE + backend->tileQueueBuffer = [surface->device newBufferWithLength: MG_MTL_DEFAULT_TILE_QUEUE_BUFFER_LEN * sizeof(mg_mtl_tile_queue) options: bufferOptions]; backend->tileQueueCountBuffer = [surface->device newBufferWithLength: sizeof(int) options: bufferOptions]; - backend->tileOpBuffer = [surface->device newBufferWithLength: MG_MTL_TILE_OP_BUFFER_SIZE + backend->tileOpBuffer = [surface->device newBufferWithLength: MG_MTL_DEFAULT_TILE_OP_BUFFER_LEN * sizeof(mg_mtl_tile_op) options: bufferOptions]; backend->tileOpCountBuffer = [surface->device newBufferWithLength: sizeof(int) diff --git a/src/mtl_renderer.metal b/src/mtl_renderer.metal index 08276b6..1013f85 100644 --- a/src/mtl_renderer.metal +++ b/src/mtl_renderer.metal @@ -231,8 +231,9 @@ kernel void mtl_path_setup(constant int* pathCount [[buffer(0)]], device mg_mtl_path_queue* pathQueueBuffer [[buffer(2)]], device mg_mtl_tile_queue* tileQueueBuffer [[buffer(3)]], device atomic_int* tileQueueCount [[buffer(4)]], - constant int* tileSize [[buffer(5)]], - constant float* scale [[buffer(6)]], + constant int* tileQueueMax [[buffer(5)]], + constant int* tileSize [[buffer(6)]], + constant float* scale [[buffer(7)]], uint pathIndex [[thread_position_in_grid]]) { const device mg_mtl_path* path = &pathBuffer[pathIndex]; @@ -254,16 +255,24 @@ kernel void mtl_path_setup(constant int* pathCount [[buffer(0)]], int tileQueuesIndex = atomic_fetch_add_explicit(tileQueueCount, tileCount, memory_order_relaxed); - pathQueueBuffer[pathIndex].area = int4(firstTile.x, firstTile.y, nTilesX, nTilesY); - pathQueueBuffer[pathIndex].tileQueues = tileQueuesIndex; - - device mg_mtl_tile_queue* tileQueues = &tileQueueBuffer[tileQueuesIndex]; - - for(int i=0; i= tileQueueMax[0]) { - atomic_store_explicit(&tileQueues[i].first, -1, memory_order_relaxed); - tileQueues[i].last = -1; - atomic_store_explicit(&tileQueues[i].windingOffset, 0, memory_order_relaxed); + pathQueueBuffer[pathIndex].area = int4(0); + pathQueueBuffer[pathIndex].tileQueues = 0; + } + else + { + pathQueueBuffer[pathIndex].area = int4(firstTile.x, firstTile.y, nTilesX, nTilesY); + pathQueueBuffer[pathIndex].tileQueues = tileQueuesIndex; + + device mg_mtl_tile_queue* tileQueues = &tileQueueBuffer[tileQueuesIndex]; + + for(int i=0; itileOpCount, 1, memory_order_relaxed); - device mg_mtl_tile_op* op = &context->tileOpBuffer[tileOpIndex]; - op->kind = MG_MTL_OP_SEGMENT; - op->index = segIndex; - op->crossRight = false; - op->next = -1; - - int tileIndex = y*pathArea.z + x; - device mg_mtl_tile_queue* tile = &context->tileQueues[tileIndex]; - op->next = atomic_exchange_explicit(&tile->first, tileOpIndex, memory_order_relaxed); - if(op->next == -1) + if(tileOpIndex < context->tileOpMax) { - tile->last = tileOpIndex; - } + device mg_mtl_tile_op* op = &context->tileOpBuffer[tileOpIndex]; - //NOTE: if the segment crosses the tile's bottom boundary, update the tile's winding offset - if(crossB) - { - mtl_log(context->log, "cross bottom boundary, increment "); - mtl_log_f32(context->log, seg->windingIncrement); - mtl_log(context->log, "\n"); - atomic_fetch_add_explicit(&tile->windingOffset, seg->windingIncrement, memory_order_relaxed); - } + op->kind = MG_MTL_OP_SEGMENT; + op->index = segIndex; + op->crossRight = false; + op->next = -1; - //NOTE: if the segment crosses the right boundary, mark it. We reuse one of the previous tests - if(crossR) - { - op->crossRight = true; + int tileIndex = y*pathArea.z + x; + device mg_mtl_tile_queue* tile = &context->tileQueues[tileIndex]; + op->next = atomic_exchange_explicit(&tile->first, tileOpIndex, memory_order_relaxed); + if(op->next == -1) + { + tile->last = tileOpIndex; + } + + //NOTE: if the segment crosses the tile's bottom boundary, update the tile's winding offset + if(crossB) + { + mtl_log(context->log, "cross bottom boundary, increment "); + mtl_log_f32(context->log, seg->windingIncrement); + mtl_log(context->log, "\n"); + atomic_fetch_add_explicit(&tile->windingOffset, seg->windingIncrement, memory_order_relaxed); + } + + //NOTE: if the segment crosses the right boundary, mark it. We reuse one of the previous tests + if(crossR) + { + op->crossRight = true; + } } } } @@ -508,54 +524,60 @@ device mg_mtl_segment* mtl_segment_push(thread mtl_segment_setup_context* contex } break; } + device mg_mtl_segment* seg = 0; + int segIndex = atomic_fetch_add_explicit(context->segmentCount, 1, memory_order_relaxed); - device mg_mtl_segment* seg = &context->segmentBuffer[segIndex]; - bool goingUp = e.y >= s.y; - bool goingRight = e.x >= s.x; - - seg->kind = kind; - seg->pathIndex = context->pathIndex; - seg->windingIncrement = goingUp? 1 : -1; - - seg->box = (vector_float4){min(s.x, e.x), - min(s.y, e.y), - max(s.x, e.x), - max(s.y, e.y)}; - - float dx = c.x - seg->box.x; - float dy = c.y - seg->box.y; - float alpha = (seg->box.w - seg->box.y)/(seg->box.z - seg->box.x); - float ofs = seg->box.w - seg->box.y; - - if(goingUp == goingRight) + if(segIndex < context->segmentMax) { - if(seg->kind == MG_MTL_LINE) + seg = &context->segmentBuffer[segIndex]; + + bool goingUp = e.y >= s.y; + bool goingRight = e.x >= s.x; + + seg->kind = kind; + seg->pathIndex = context->pathIndex; + seg->windingIncrement = goingUp? 1 : -1; + + seg->box = (vector_float4){min(s.x, e.x), + min(s.y, e.y), + max(s.x, e.x), + max(s.y, e.y)}; + + float dx = c.x - seg->box.x; + float dy = c.y - seg->box.y; + float alpha = (seg->box.w - seg->box.y)/(seg->box.z - seg->box.x); + float ofs = seg->box.w - seg->box.y; + + if(goingUp == goingRight) { - seg->config = MG_MTL_BR; - } - else if(dy > alpha*dx) - { - seg->config = MG_MTL_TL; + if(seg->kind == MG_MTL_LINE) + { + seg->config = MG_MTL_BR; + } + else if(dy > alpha*dx) + { + seg->config = MG_MTL_TL; + } + else + { + seg->config = MG_MTL_BR; + } } else { - seg->config = MG_MTL_BR; - } - } - else - { - if(seg->kind == MG_MTL_LINE) - { - seg->config = MG_MTL_TR; - } - else if(dy < ofs - alpha*dx) - { - seg->config = MG_MTL_BL; - } - else - { - seg->config = MG_MTL_TR; + if(seg->kind == MG_MTL_LINE) + { + seg->config = MG_MTL_TR; + } + else if(dy < ofs - alpha*dx) + { + seg->config = MG_MTL_BL; + } + else + { + seg->config = MG_MTL_TR; + } } } return(seg); @@ -567,8 +589,11 @@ device mg_mtl_segment* mtl_segment_push(thread mtl_segment_setup_context* contex void mtl_line_setup(thread mtl_segment_setup_context* context, float2 p[2]) { device mg_mtl_segment* seg = mtl_segment_push(context, p, MG_MTL_LINE); - seg->hullVertex = p[0]; - mtl_segment_bin_to_tiles(context, seg); + if(seg) + { + seg->hullVertex = p[0]; + mtl_segment_bin_to_tiles(context, seg); + } } float2 mtl_quadratic_blossom(float2 p[3], float u, float v) @@ -636,26 +661,29 @@ void mtl_quadratic_emit(thread mtl_segment_setup_context* context, { device mg_mtl_segment* seg = mtl_segment_push(context, p, MG_MTL_QUADRATIC); - //NOTE: compute implicit equation matrix - float det = p[0].x*(p[1].y-p[2].y) + p[1].x*(p[2].y-p[0].y) + p[2].x*(p[0].y - p[1].y); + if(seg) + { + //NOTE: compute implicit equation matrix + float det = p[0].x*(p[1].y-p[2].y) + p[1].x*(p[2].y-p[0].y) + p[2].x*(p[0].y - p[1].y); - float a = p[0].y - p[1].y + 0.5*(p[2].y - p[0].y); - float b = p[1].x - p[0].x + 0.5*(p[0].x - p[2].x); - float c = p[0].x*p[1].y - p[1].x*p[0].y + 0.5*(p[2].x*p[0].y - p[0].x*p[2].y); - float d = p[0].y - p[1].y; - float e = p[1].x - p[0].x; - float f = p[0].x*p[1].y - p[1].x*p[0].y; + float a = p[0].y - p[1].y + 0.5*(p[2].y - p[0].y); + float b = p[1].x - p[0].x + 0.5*(p[0].x - p[2].x); + float c = p[0].x*p[1].y - p[1].x*p[0].y + 0.5*(p[2].x*p[0].y - p[0].x*p[2].y); + float d = p[0].y - p[1].y; + float e = p[1].x - p[0].x; + float f = p[0].x*p[1].y - p[1].x*p[0].y; - float flip = (seg->config == MG_MTL_TL || seg->config == MG_MTL_BL)? -1 : 1; - float g = flip*(p[2].x*(p[0].y - p[1].y) + p[0].x*(p[1].y - p[2].y) + p[1].x*(p[2].y - p[0].y)); + float flip = (seg->config == MG_MTL_TL || seg->config == MG_MTL_BL)? -1 : 1; + float g = flip*(p[2].x*(p[0].y - p[1].y) + p[0].x*(p[1].y - p[2].y) + p[1].x*(p[2].y - p[0].y)); - seg->implicitMatrix = (1/det)*matrix_float3x3({a, d, 0.}, + seg->implicitMatrix = (1/det)*matrix_float3x3({a, d, 0.}, {b, e, 0.}, {c, f, g}); - seg->hullVertex = p[1]; + seg->hullVertex = p[1]; - mtl_segment_bin_to_tiles(context, seg); + mtl_segment_bin_to_tiles(context, seg); + } } void mtl_quadratic_setup(thread mtl_segment_setup_context* context, thread float2* p) @@ -1044,70 +1072,73 @@ void mtl_cubic_emit(thread mtl_segment_setup_context* context, mtl_cubic_info cu { device mg_mtl_segment* seg = mtl_segment_push(context, sp, MG_MTL_CUBIC); - float2 v0 = p[0]; - float2 v1 = p[3]; - float2 v2; - matrix_float3x3 K; - - float sqrNorm0 = length_squared(p[1]-p[0]); - float sqrNorm1 = length_squared(p[2]-p[3]); - - //TODO: should not be the local sub-curve, but the global curve!!! - if(length_squared(p[0]-p[3]) > 1e-5) + if(seg) { - if(sqrNorm0 >= sqrNorm1) - { - v2 = p[1]; - K = {curve.K[0].xyz, curve.K[3].xyz, curve.K[1].xyz}; + float2 v0 = p[0]; + float2 v1 = p[3]; + float2 v2; + matrix_float3x3 K; + + float sqrNorm0 = length_squared(p[1]-p[0]); + float sqrNorm1 = length_squared(p[2]-p[3]); + + //TODO: should not be the local sub-curve, but the global curve!!! + if(length_squared(p[0]-p[3]) > 1e-5) + { + if(sqrNorm0 >= sqrNorm1) + { + v2 = p[1]; + K = {curve.K[0].xyz, curve.K[3].xyz, curve.K[1].xyz}; + } + else + { + v2 = p[2]; + K = {curve.K[0].xyz, curve.K[3].xyz, curve.K[2].xyz}; + } } else { + v1 = p[1]; v2 = p[2]; - K = {curve.K[0].xyz, curve.K[3].xyz, curve.K[2].xyz}; + K = {curve.K[0].xyz, curve.K[1].xyz, curve.K[2].xyz}; } - } - else - { - v1 = p[1]; - v2 = p[2]; - K = {curve.K[0].xyz, curve.K[1].xyz, curve.K[2].xyz}; - } - //NOTE: set matrices + //NOTE: set matrices - //TODO: should we compute matrix relative to a base point to avoid loss of precision - // when computing barycentric matrix? + //TODO: should we compute matrix relative to a base point to avoid loss of precision + // when computing barycentric matrix? - matrix_float3x3 B = mtl_barycentric_matrix(v0, v1, v2); - seg->implicitMatrix = K*B; - seg->hullVertex = mtl_select_hull_vertex(sp[0], sp[1], sp[2], sp[3], context->log); + matrix_float3x3 B = mtl_barycentric_matrix(v0, v1, v2); + seg->implicitMatrix = K*B; + seg->hullVertex = mtl_select_hull_vertex(sp[0], sp[1], sp[2], sp[3], context->log); - //NOTE: compute sign flip - seg->sign = 1; + //NOTE: compute sign flip + seg->sign = 1; - if(curve.kind == MTL_CUBIC_SERPENTINE - || curve.kind == MTL_CUBIC_CUSP) - { - seg->sign = (curve.d1 < 0)? -1 : 1; + if(curve.kind == MTL_CUBIC_SERPENTINE + || curve.kind == MTL_CUBIC_CUSP) + { + seg->sign = (curve.d1 < 0)? -1 : 1; + } + else if(curve.kind == MTL_CUBIC_LOOP) + { + float d1 = curve.d1; + float d2 = curve.d2; + float d3 = curve.d3; + + float H0 = d3*d1-square(d2) + d1*d2*s0 - square(d1)*square(s0); + float H1 = d3*d1-square(d2) + d1*d2*s1 - square(d1)*square(s1); + float H = (abs(H0) > abs(H1)) ? H0 : H1; + seg->sign = (H*d1 > 0) ? -1 : 1; + } + + if(sp[3].y > sp[0].y) + { + seg->sign *= -1; + } + + //NOTE: bin to tiles + mtl_segment_bin_to_tiles(context, seg); } - else if(curve.kind == MTL_CUBIC_LOOP) - { - float d1 = curve.d1; - float d2 = curve.d2; - float d3 = curve.d3; - - float H0 = d3*d1-square(d2) + d1*d2*s0 - square(d1)*square(s0); - float H1 = d3*d1-square(d2) + d1*d2*s1 - square(d1)*square(s1); - float H = (abs(H0) > abs(H1)) ? H0 : H1; - seg->sign = (H*d1 > 0) ? -1 : 1; - } - - if(sp[3].y > sp[0].y) - { - seg->sign *= -1; - } - - //NOTE: bin to tiles - mtl_segment_bin_to_tiles(context, seg); } void mtl_cubic_setup(thread mtl_segment_setup_context* context, float2 p[4]) @@ -1229,11 +1260,13 @@ kernel void mtl_segment_setup(constant int* elementCount [[buffer(0)]], device mg_mtl_tile_queue* tileQueueBuffer [[buffer(5)]], device mg_mtl_tile_op* tileOpBuffer [[buffer(6)]], device atomic_int* tileOpCount [[buffer(7)]], - constant int* tileSize [[buffer(8)]], - constant float* scale [[buffer(9)]], + constant int* segmentMax [[buffer(8)]], + constant int* tileOpMax [[buffer(9)]], + constant int* tileSize [[buffer(10)]], + constant float* scale [[buffer(11)]], - device char* logBuffer [[buffer(10)]], - device atomic_int* logOffsetBuffer [[buffer(11)]], + device char* logBuffer [[buffer(12)]], + device atomic_int* logOffsetBuffer [[buffer(13)]], uint eltIndex [[thread_position_in_grid]]) { const device mg_mtl_path_elt* elt = &elementBuffer[eltIndex]; @@ -1247,10 +1280,12 @@ kernel void mtl_segment_setup(constant int* elementCount [[buffer(0)]], .tileQueues = tileQueues, .tileOpBuffer = tileOpBuffer, .tileOpCount = tileOpCount, + .tileOpMax = tileOpMax[0], + .segmentMax = segmentMax[0], .tileSize = tileSize[0], .log.buffer = logBuffer, .log.offset = logOffsetBuffer, - .log.enabled = false}; + .log.enabled = false,}; switch(elt->kind) { @@ -1327,10 +1362,11 @@ kernel void mtl_merge(constant int* pathCount [[buffer(0)]], device atomic_int* tileOpCount [[buffer(5)]], device MTLDispatchThreadgroupsIndirectArguments* dispatchBuffer [[buffer(6)]], device mg_mtl_screen_tile* screenTilesBuffer [[buffer(7)]], - constant int* tileSize [[buffer(8)]], - constant float* scale [[buffer(9)]], - device char* logBuffer [[buffer(10)]], - device atomic_int* logOffsetBuffer [[buffer(11)]], + constant int* tileOpMax [[buffer(8)]], + constant int* tileSize [[buffer(9)]], + constant float* scale [[buffer(10)]], + device char* logBuffer [[buffer(11)]], + device atomic_int* logOffsetBuffer [[buffer(12)]], uint2 threadCoord [[thread_position_in_grid]], uint2 gridSize [[threads_per_grid]]) { @@ -1393,6 +1429,12 @@ kernel void mtl_merge(constant int* pathCount [[buffer(0)]], //NOTE: tile is full covered. Add path start op (with winding offset). // Additionally if color is opaque and tile is fully inside clip, trim tile list. int pathOpIndex = atomic_fetch_add_explicit(tileOpCount, 1, memory_order_relaxed); + + if(pathOpIndex >= tileOpMax[0]) + { + return; + } + device mg_mtl_tile_op* pathOp = &tileOpBuffer[pathOpIndex]; pathOp->kind = MG_MTL_OP_CLIP_FILL; pathOp->next = -1; @@ -1421,6 +1463,11 @@ kernel void mtl_merge(constant int* pathCount [[buffer(0)]], { //NOTE: add path start op (with winding offset) int startOpIndex = atomic_fetch_add_explicit(tileOpCount, 1, memory_order_relaxed); + if(startOpIndex >= tileOpMax[0]) + { + return; + } + device mg_mtl_tile_op* startOp = &tileOpBuffer[startOpIndex]; startOp->kind = MG_MTL_OP_START; startOp->next = -1; @@ -1439,6 +1486,11 @@ kernel void mtl_merge(constant int* pathCount [[buffer(0)]], //NOTE: add path end op int endOpIndex = atomic_fetch_add_explicit(tileOpCount, 1, memory_order_relaxed); + if(endOpIndex >= tileOpMax[0]) + { + return; + } + device mg_mtl_tile_op* endOp = &tileOpBuffer[endOpIndex]; endOp->kind = MG_MTL_OP_END; endOp->next = -1; @@ -1446,7 +1498,6 @@ kernel void mtl_merge(constant int* pathCount [[buffer(0)]], *nextLink = endOpIndex; nextLink = &endOp->next; - } } } From 684543ec157102016c9ef955beab6e5122ebc29e Mon Sep 17 00:00:00 2001 From: martinfouilleul Date: Wed, 12 Jul 2023 15:46:52 +0200 Subject: [PATCH 4/6] [gl canvas] fix implicit boolean conversion error on some drivers --- src/glsl_shaders/segment_setup.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glsl_shaders/segment_setup.glsl b/src/glsl_shaders/segment_setup.glsl index 903eaf9..8efdcd8 100644 --- a/src/glsl_shaders/segment_setup.glsl +++ b/src/glsl_shaders/segment_setup.glsl @@ -340,7 +340,7 @@ int quadratic_roots_with_det(float a, float b, float c, float det, out float r[2 if(a == 0) { - if(b) + if(b != 0) { count = 1; r[0] = -c/b; @@ -773,7 +773,7 @@ void cubic_setup(vec2 p[4], int pathIndex) int rootCount = rootCountX + rootCountY; for(int i=0; i<2; i++) { - if(curve.ts[i].y) + if(curve.ts[i].y != 0) { roots[rootCount] = curve.ts[i].x / curve.ts[i].y; rootCount++; From 6944325014cd57dd39a09958d21d70554a8307ae Mon Sep 17 00:00:00 2001 From: martinfouilleul Date: Wed, 12 Jul 2023 10:32:20 +0200 Subject: [PATCH 5/6] [win32, canvas] rolling input buffers --- src/gl_canvas.c | 61 +++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/src/gl_canvas.c b/src/gl_canvas.c index 86e47bd..4c0e0cf 100644 --- a/src/gl_canvas.c +++ b/src/gl_canvas.c @@ -111,7 +111,7 @@ typedef struct mg_gl_encoding_context } mg_gl_encoding_context; enum { -// MG_GL_INPUT_BUFFERS_COUNT = 3, + MG_GL_INPUT_BUFFERS_COUNT = 3, MG_GL_TILE_SIZE = 16, MG_GL_MSAA_COUNT = 8, }; @@ -133,10 +133,9 @@ typedef struct mg_gl_canvas_backend GLuint outTexture; int bufferIndex; - //TODO buffer semaphore... - - GLuint pathBuffer; - GLuint elementBuffer; + GLsync bufferSync[MG_GL_INPUT_BUFFERS_COUNT]; + GLuint pathBuffer[MG_GL_INPUT_BUFFERS_COUNT]; + GLuint elementBuffer[MG_GL_INPUT_BUFFERS_COUNT]; GLuint segmentBuffer; GLuint segmentCountBuffer; @@ -857,7 +856,6 @@ void mg_gl_encode_stroke(mg_gl_encoding_context* context, } } - void mg_gl_render_batch(mg_gl_canvas_backend* backend, mg_wgl_surface* surface, int pathCount, @@ -870,17 +868,14 @@ void mg_gl_render_batch(mg_gl_canvas_backend* backend, f32 scale) { //NOTE: send the buffers - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // this is wrong, we should send the part we just wrote, which doesn't necessarily start at the begining of the buffer - // or, alternatively, we should always write at the beginning of our data buffer and send from there... - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->pathBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER, LAYOUT_PATH_SIZE*pathCount, backend->pathBufferData, GL_STREAM_DRAW); + GLuint pathBuffer = backend->pathBuffer[backend->bufferIndex]; + GLuint elementBuffer = backend->elementBuffer[backend->bufferIndex]; - glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->elementBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER, LAYOUT_PATH_ELT_SIZE*eltCount, backend->elementBufferData, GL_STREAM_DRAW); + glBindBuffer(GL_SHADER_STORAGE_BUFFER, pathBuffer); + glBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, LAYOUT_PATH_SIZE*pathCount, backend->pathBufferData); - // --> this always bind the begining of the buffer, with the wrong pathCount/eltCount... + glBindBuffer(GL_SHADER_STORAGE_BUFFER, elementBuffer); + glBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, LAYOUT_PATH_ELT_SIZE*eltCount, backend->elementBufferData); //NOTE: clear counters int zero = 0; @@ -916,7 +911,7 @@ void mg_gl_render_batch(mg_gl_canvas_backend* backend, int pathQueueOffset = i*sizeof(mg_gl_path_queue); int count = minimum(maxWorkGroupCount, pathCount-i); - glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, backend->pathBuffer, pathOffset, count*sizeof(mg_gl_path)); + glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, pathBuffer, pathOffset, count*sizeof(mg_gl_path)); glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 1, backend->pathQueueBuffer, pathQueueOffset, count*sizeof(mg_gl_path_queue)); glDispatchCompute(count, 1, 1); @@ -941,7 +936,7 @@ void mg_gl_render_batch(mg_gl_canvas_backend* backend, int offset = i*sizeof(mg_gl_path_elt); int count = minimum(maxWorkGroupCount, eltCount-i); - glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, backend->elementBuffer, offset, count*sizeof(mg_gl_path_elt)); + glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, elementBuffer, offset, count*sizeof(mg_gl_path_elt)); glDispatchCompute(count, 1, 1); glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT); @@ -966,7 +961,7 @@ void mg_gl_render_batch(mg_gl_canvas_backend* backend, //NOTE: merge pass glUseProgram(backend->merge); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, backend->pathBuffer); + glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, pathBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, backend->pathQueueBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, backend->tileQueueBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, backend->tileOpCountBuffer); @@ -993,7 +988,7 @@ void mg_gl_render_batch(mg_gl_canvas_backend* backend, //NOTE: raster pass glUseProgram(backend->raster); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, backend->pathBuffer); + glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, pathBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, backend->segmentBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, backend->tileOpBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, backend->screenTilesBuffer); @@ -1046,6 +1041,15 @@ void mg_gl_canvas_render(mg_canvas_backend* interface, { mg_gl_canvas_backend* backend = (mg_gl_canvas_backend*)interface; + //NOTE: roll input buffers + backend->bufferIndex = (backend->bufferIndex + 1) % MG_GL_INPUT_BUFFERS_COUNT; + if(backend->bufferSync[backend->bufferIndex] != 0) + { + glClientWaitSync(backend->bufferSync[backend->bufferIndex], GL_SYNC_FLUSH_COMMANDS_BIT, 0xffffffff); + glDeleteSync(backend->bufferSync[backend->bufferIndex]); + backend->bufferSync[backend->bufferIndex] = 0; + } + //TODO update screen tiles buffer size mg_wgl_surface* surface = backend->surface; mp_rect frame = surface->interface.getFrame((mg_surface_data*)surface); @@ -1226,7 +1230,8 @@ void mg_gl_canvas_render(mg_canvas_backend* interface, viewportSize, scale); - //TODO add completion handler for rolling input buffers + //NOTE: add fence for rolling input buffers + backend->bufferSync[backend->bufferIndex] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); } //-------------------------------------------------------------------- @@ -1444,14 +1449,16 @@ mg_canvas_backend* gl_canvas_backend_create(mg_wgl_surface* surface) glGenBuffers(1, &backend->dummyVertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, backend->dummyVertexBuffer); - glGenBuffers(1, &backend->pathBuffer); - glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->pathBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER, MG_GL_PATH_BUFFER_SIZE, 0, GL_STREAM_DRAW); + for(int i=0; ipathBuffer[i]); + glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->pathBuffer[i]); + glBufferData(GL_SHADER_STORAGE_BUFFER, MG_GL_PATH_BUFFER_SIZE, 0, GL_STREAM_DRAW); - //TODO change flags - glGenBuffers(1, &backend->elementBuffer); - glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->elementBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER, MG_GL_ELEMENT_BUFFER_SIZE, 0, GL_STREAM_DRAW); + glGenBuffers(1, &backend->elementBuffer[i]); + glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->elementBuffer[i]); + glBufferData(GL_SHADER_STORAGE_BUFFER, MG_GL_ELEMENT_BUFFER_SIZE, 0, GL_STREAM_DRAW); + } glGenBuffers(1, &backend->segmentBuffer); glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->segmentBuffer); From 660ad33ddcbffa07a64115021870868ea96794a5 Mon Sep 17 00:00:00 2001 From: martinfouilleul Date: Wed, 12 Jul 2023 15:06:20 +0200 Subject: [PATCH 6/6] [win32, gl canvas] persistently map input buffers --- scripts/glapi.py | 5 +- src/gl_api.h | 2226 ++++++++++++------------- src/gl_canvas.c | 409 ++--- src/gl_loader.c | 3997 ++++++++++++++++++++++++++------------------- src/gl_loader.h | 45 +- src/wgl_surface.c | 4 +- 6 files changed, 3644 insertions(+), 3042 deletions(-) diff --git a/scripts/glapi.py b/scripts/glapi.py index b22c9da..0b28597 100644 --- a/scripts/glapi.py +++ b/scripts/glapi.py @@ -44,10 +44,11 @@ tree = et.parse(args.spec) gl41 = gather_api(tree, 'gl', 4.1) gl43 = gather_api(tree, 'gl', 4.3) +gl44 = gather_api(tree, 'gl', 4.4) gles30 = gather_api(tree, 'gles2', 3.1) gles31 = gather_api(tree, 'gles2', 3.2) -glall = list(set().union(gl41, gl43, gles30, gles31)) +glall = list(set().union(gl41, gl43, gl44, gles30, gles31)) #--------------------------------------------------------------- @@ -122,6 +123,7 @@ f.write("typedef void*(*mg_gl_load_proc)(const char* name);\n\n") f.write("void mg_gl_load_gl41(mg_gl_api* api, mg_gl_load_proc loadProc);\n") f.write("void mg_gl_load_gl43(mg_gl_api* api, mg_gl_load_proc loadProc);\n") +f.write("void mg_gl_load_gl44(mg_gl_api* api, mg_gl_load_proc loadProc);\n") f.write("void mg_gl_load_gles30(mg_gl_api* api, mg_gl_load_proc loadProc);\n") f.write("void mg_gl_load_gles31(mg_gl_api* api, mg_gl_load_proc loadProc);\n\n") @@ -152,6 +154,7 @@ f.write("mp_thread_local mg_gl_api* __mgGLAPI = 0;\n\n") emit_loader(f, 'gl41', gl41) emit_loader(f, 'gl43', gl43) +emit_loader(f, 'gl44', gl44) emit_loader(f, 'gles30', gles30) emit_loader(f, 'gles31', gles31) diff --git a/src/gl_api.h b/src/gl_api.h index e89f304..1619812 100644 --- a/src/gl_api.h +++ b/src/gl_api.h @@ -1,1104 +1,1122 @@ -/******************************************************** -* -* @file: gl_api.h -* @note: auto-generated by glapi.py from gl.xml -* @date: 22/022023 -* -*********************************************************/ -#ifndef __GL_API_H__ -#define __GL_API_H__ - -#include"GL/glcorearb.h" -#include"GLES3/gl32.h" - -typedef struct mg_gl_api -{ - PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv; - PFNGLVERTEXATTRIBI4IPROC VertexAttribI4i; - PFNGLUNIFORM2UIPROC Uniform2ui; - PFNGLGETACTIVEUNIFORMSIVPROC GetActiveUniformsiv; - PFNGLRELEASESHADERCOMPILERPROC ReleaseShaderCompiler; - PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC ProgramUniformMatrix3x2fv; - PFNGLBLENDFUNCPROC BlendFunc; - PFNGLVERTEXATTRIBI2IVPROC VertexAttribI2iv; - PFNGLFLUSHMAPPEDBUFFERRANGEPROC FlushMappedBufferRange; - PFNGLMEMORYBARRIERPROC MemoryBarrier; - PFNGLCLAMPCOLORPROC ClampColor; - PFNGLUNIFORM4DVPROC Uniform4dv; - PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC GetSubroutineUniformLocation; - PFNGLCOLORMASKPROC ColorMask; - PFNGLGETINTEGERVPROC GetIntegerv; - PFNGLDRAWBUFFERSPROC DrawBuffers; - PFNGLPROGRAMUNIFORM1IPROC ProgramUniform1i; - PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv; - PFNGLFRONTFACEPROC FrontFace; - PFNGLVERTEXATTRIBPOINTERPROC VertexAttribPointer; - PFNGLTEXSTORAGE1DPROC TexStorage1D; - PFNGLPROGRAMUNIFORM1UIPROC ProgramUniform1ui; - PFNGLSHADERSTORAGEBLOCKBINDINGPROC ShaderStorageBlockBinding; - PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv; - PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC DrawRangeElementsBaseVertex; - PFNGLPROGRAMUNIFORMMATRIX2FVPROC ProgramUniformMatrix2fv; - PFNGLOBJECTLABELPROC ObjectLabel; - PFNGLUNIFORMMATRIX3X4FVPROC UniformMatrix3x4fv; - PFNGLPOINTPARAMETERIPROC PointParameteri; - PFNGLMAPBUFFERPROC MapBuffer; - PFNGLVERTEXATTRIBI1IVPROC VertexAttribI1iv; - PFNGLMULTIDRAWELEMENTSPROC MultiDrawElements; - PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv; - PFNGLGETPROGRAMPIPELINEIVPROC GetProgramPipelineiv; - PFNGLGETBUFFERPOINTERVPROC GetBufferPointerv; - PFNGLDISABLEIPROC Disablei; - PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv; - PFNGLISTRANSFORMFEEDBACKPROC IsTransformFeedback; - PFNGLTEXSUBIMAGE2DPROC TexSubImage2D; - PFNGLBINDBUFFERBASEPROC BindBufferBase; - PFNGLSCISSORPROC Scissor; - PFNGLGENBUFFERSPROC GenBuffers; - PFNGLGETSHADERIVPROC GetShaderiv; - PFNGLVERTEXATTRIBL3DPROC VertexAttribL3d; - PFNGLTEXIMAGE3DPROC TexImage3D; - PFNGLVERTEXATTRIBP4UIPROC VertexAttribP4ui; - PFNGLGETDOUBLEI_VPROC GetDoublei_v; - PFNGLRESUMETRANSFORMFEEDBACKPROC ResumeTransformFeedback; - PFNGLDRAWARRAYSINSTANCEDPROC DrawArraysInstanced; - PFNGLBEGINQUERYINDEXEDPROC BeginQueryIndexed; - PFNGLVERTEXATTRIBL4DPROC VertexAttribL4d; - PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D; - PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC ProgramUniformMatrix2x4fv; - PFNGLLOGICOPPROC LogicOp; - PFNGLVERTEXATTRIBI4UBVPROC VertexAttribI4ubv; - PFNGLPRIMITIVEBOUNDINGBOXPROC PrimitiveBoundingBox; - PFNGLGETSTRINGIPROC GetStringi; - PFNGLUNIFORM4IVPROC Uniform4iv; - PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv; - PFNGLUNIFORM2IPROC Uniform2i; - PFNGLTEXPARAMETERIPROC TexParameteri; - PFNGLGETUNIFORMSUBROUTINEUIVPROC GetUniformSubroutineuiv; - PFNGLVERTEXATTRIB1FVPROC VertexAttrib1fv; - PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer; - PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv; - PFNGLVALIDATEPROGRAMPIPELINEPROC ValidateProgramPipeline; - PFNGLVERTEXATTRIB4DPROC VertexAttrib4d; - PFNGLPROGRAMUNIFORM2FPROC ProgramUniform2f; - PFNGLCLEARBUFFERUIVPROC ClearBufferuiv; - PFNGLBUFFERSUBDATAPROC BufferSubData; - PFNGLGETTRANSFORMFEEDBACKVARYINGPROC GetTransformFeedbackVarying; - PFNGLVERTEXATTRIBI2IPROC VertexAttribI2i; - PFNGLTEXPARAMETERIUIVPROC TexParameterIuiv; - PFNGLTEXPARAMETERIVPROC TexParameteriv; - PFNGLVERTEXATTRIBI3UIVPROC VertexAttribI3uiv; - PFNGLDELETEBUFFERSPROC DeleteBuffers; - PFNGLVERTEXATTRIBP3UIPROC VertexAttribP3ui; - PFNGLUNIFORM2FVPROC Uniform2fv; - PFNGLPROGRAMUNIFORM4DPROC ProgramUniform4d; - PFNGLPROGRAMUNIFORM1IVPROC ProgramUniform1iv; - PFNGLDELETEPROGRAMPIPELINESPROC DeleteProgramPipelines; - PFNGLDISABLEPROC Disable; - PFNGLPOINTPARAMETERFVPROC PointParameterfv; - PFNGLPROGRAMUNIFORM3DPROC ProgramUniform3d; - PFNGLCOMPILESHADERPROC CompileShader; - PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays; - PFNGLVERTEXATTRIBI4UIVPROC VertexAttribI4uiv; - PFNGLACTIVETEXTUREPROC ActiveTexture; - PFNGLDEBUGMESSAGEINSERTPROC DebugMessageInsert; - PFNGLGETTEXPARAMETERIIVPROC GetTexParameterIiv; - PFNGLQUERYCOUNTERPROC QueryCounter; - PFNGLVERTEXATTRIBI3IVPROC VertexAttribI3iv; - PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D; - PFNGLSAMPLERPARAMETERIVPROC SamplerParameteriv; - PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC GetFramebufferAttachmentParameteriv; - PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC ProgramUniformMatrix3x4dv; - PFNGLISVERTEXARRAYPROC IsVertexArray; - PFNGLTEXIMAGE1DPROC TexImage1D; - PFNGLGETOBJECTLABELPROC GetObjectLabel; - PFNGLVERTEXATTRIB1DPROC VertexAttrib1d; - PFNGLDELETESYNCPROC DeleteSync; - PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC GetActiveSubroutineUniformiv; - PFNGLGETPOINTERVPROC GetPointerv; - PFNGLINVALIDATETEXSUBIMAGEPROC InvalidateTexSubImage; - PFNGLDETACHSHADERPROC DetachShader; - PFNGLGETTEXPARAMETERIVPROC GetTexParameteriv; - PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv; - PFNGLSTENCILFUNCSEPARATEPROC StencilFuncSeparate; - PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv; - PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC DrawElementsInstancedBaseInstance; - PFNGLTEXSTORAGE2DMULTISAMPLEPROC TexStorage2DMultisample; - PFNGLUNIFORMMATRIX4FVPROC UniformMatrix4fv; - PFNGLVERTEXATTRIBP3UIVPROC VertexAttribP3uiv; - PFNGLTEXBUFFERRANGEPROC TexBufferRange; - PFNGLGENERATEMIPMAPPROC GenerateMipmap; - PFNGLVERTEXATTRIB2FVPROC VertexAttrib2fv; - PFNGLENABLEVERTEXATTRIBARRAYPROC EnableVertexAttribArray; - PFNGLGETATTACHEDSHADERSPROC GetAttachedShaders; - PFNGLVERTEXATTRIB3SPROC VertexAttrib3s; - PFNGLMULTIDRAWARRAYSPROC MultiDrawArrays; - PFNGLGETBOOLEANI_VPROC GetBooleani_v; - PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer; - PFNGLGETPROGRAMSTAGEIVPROC GetProgramStageiv; - PFNGLPOINTPARAMETERFPROC PointParameterf; - PFNGLUSEPROGRAMPROC UseProgram; - PFNGLPROGRAMUNIFORM4UIVPROC ProgramUniform4uiv; - PFNGLSCISSORINDEXEDVPROC ScissorIndexedv; - PFNGLCLEARBUFFERDATAPROC ClearBufferData; - PFNGLMULTIDRAWARRAYSINDIRECTPROC MultiDrawArraysIndirect; - PFNGLGETBUFFERSUBDATAPROC GetBufferSubData; - PFNGLPOLYGONOFFSETPROC PolygonOffset; - PFNGLVERTEXATTRIB4NUBPROC VertexAttrib4Nub; - PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage; - PFNGLDISABLEVERTEXATTRIBARRAYPROC DisableVertexAttribArray; - PFNGLLINKPROGRAMPROC LinkProgram; - PFNGLBINDIMAGETEXTUREPROC BindImageTexture; - PFNGLGETACTIVESUBROUTINENAMEPROC GetActiveSubroutineName; - PFNGLUNIFORM1IVPROC Uniform1iv; - PFNGLUNIFORM1IPROC Uniform1i; - PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv; - PFNGLPROGRAMUNIFORMMATRIX2DVPROC ProgramUniformMatrix2dv; - PFNGLPROGRAMUNIFORM4IVPROC ProgramUniform4iv; - PFNGLPROGRAMUNIFORM3UIVPROC ProgramUniform3uiv; - PFNGLPROGRAMUNIFORM4UIPROC ProgramUniform4ui; - PFNGLGETUNIFORMBLOCKINDEXPROC GetUniformBlockIndex; - PFNGLPROGRAMUNIFORM2DPROC ProgramUniform2d; - PFNGLCLEARPROC Clear; - PFNGLENDQUERYPROC EndQuery; - PFNGLPAUSETRANSFORMFEEDBACKPROC PauseTransformFeedback; - PFNGLDEPTHRANGEPROC DepthRange; - PFNGLPOLYGONMODEPROC PolygonMode; - PFNGLTEXIMAGE3DMULTISAMPLEPROC TexImage3DMultisample; - PFNGLISBUFFERPROC IsBuffer; - PFNGLCULLFACEPROC CullFace; - PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC ProgramUniformMatrix3x4fv; - PFNGLBINDVERTEXBUFFERPROC BindVertexBuffer; - PFNGLCOPYTEXIMAGE2DPROC CopyTexImage2D; - PFNGLVERTEXATTRIB3FPROC VertexAttrib3f; - PFNGLGENVERTEXARRAYSPROC GenVertexArrays; - PFNGLUNIFORMMATRIX2X4FVPROC UniformMatrix2x4fv; - PFNGLCOPYTEXSUBIMAGE2DPROC CopyTexSubImage2D; - PFNGLDRAWELEMENTSBASEVERTEXPROC DrawElementsBaseVertex; - PFNGLINVALIDATETEXIMAGEPROC InvalidateTexImage; - PFNGLINVALIDATESUBFRAMEBUFFERPROC InvalidateSubFramebuffer; - PFNGLGETERRORPROC GetError; - PFNGLBINDBUFFERPROC BindBuffer; - PFNGLVERTEXATTRIB3FVPROC VertexAttrib3fv; - PFNGLVERTEXATTRIBI4IVPROC VertexAttribI4iv; - PFNGLTEXTUREVIEWPROC TextureView; - PFNGLVERTEXATTRIBI4UIPROC VertexAttribI4ui; - PFNGLGETFLOATI_VPROC GetFloati_v; - PFNGLBLENDFUNCIPROC BlendFunci; - PFNGLPROGRAMUNIFORMMATRIX4FVPROC ProgramUniformMatrix4fv; - PFNGLTEXIMAGE2DMULTISAMPLEPROC TexImage2DMultisample; - PFNGLDEPTHFUNCPROC DepthFunc; - PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC ProgramUniformMatrix4x3dv; - PFNGLVERTEXATTRIB3DPROC VertexAttrib3d; - PFNGLSAMPLERPARAMETERFVPROC SamplerParameterfv; - PFNGLBINDFRAGDATALOCATIONPROC BindFragDataLocation; - PFNGLBINDATTRIBLOCATIONPROC BindAttribLocation; - PFNGLUNIFORM3IPROC Uniform3i; - PFNGLDELETESHADERPROC DeleteShader; - PFNGLREADBUFFERPROC ReadBuffer; - PFNGLUNIFORMMATRIX4DVPROC UniformMatrix4dv; - PFNGLVERTEXATTRIB2DPROC VertexAttrib2d; - PFNGLVERTEXATTRIBL2DPROC VertexAttribL2d; - PFNGLDELETESAMPLERSPROC DeleteSamplers; - PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv; - PFNGLDEPTHRANGEFPROC DepthRangef; - PFNGLFRAMEBUFFERPARAMETERIPROC FramebufferParameteri; - PFNGLTEXPARAMETERIIVPROC TexParameterIiv; - PFNGLGETINTERNALFORMATI64VPROC GetInternalformati64v; - PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC ProgramUniformMatrix2x3dv; - PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC ProgramUniformMatrix2x3fv; - PFNGLGETSYNCIVPROC GetSynciv; - PFNGLSCISSORARRAYVPROC ScissorArrayv; - PFNGLDEPTHMASKPROC DepthMask; - PFNGLPOINTSIZEPROC PointSize; - PFNGLGETUNIFORMFVPROC GetUniformfv; - PFNGLSAMPLECOVERAGEPROC SampleCoverage; - PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D; - PFNGLISPROGRAMPROC IsProgram; - PFNGLVERTEXATTRIBI1UIVPROC VertexAttribI1uiv; - PFNGLGETOBJECTPTRLABELPROC GetObjectPtrLabel; - PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D; - PFNGLUNIFORMSUBROUTINESUIVPROC UniformSubroutinesuiv; - PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate; - PFNGLUNIFORM2IVPROC Uniform2iv; - PFNGLUNIFORM3FPROC Uniform3f; - PFNGLBINDFRAGDATALOCATIONINDEXEDPROC BindFragDataLocationIndexed; - PFNGLUNIFORMMATRIX3X2FVPROC UniformMatrix3x2fv; - PFNGLGETSHADERSOURCEPROC GetShaderSource; - PFNGLVERTEXATTRIBIPOINTERPROC VertexAttribIPointer; - PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC DrawTransformFeedbackStreamInstanced; - PFNGLPROGRAMUNIFORM2IVPROC ProgramUniform2iv; - PFNGLVERTEXATTRIBP2UIPROC VertexAttribP2ui; - PFNGLGETQUERYIVPROC GetQueryiv; - PFNGLGETACTIVEATTRIBPROC GetActiveAttrib; - PFNGLTEXBUFFERPROC TexBuffer; - PFNGLDELETETRANSFORMFEEDBACKSPROC DeleteTransformFeedbacks; - PFNGLGENTRANSFORMFEEDBACKSPROC GenTransformFeedbacks; - PFNGLGETPROGRAMBINARYPROC GetProgramBinary; - PFNGLDRAWTRANSFORMFEEDBACKPROC DrawTransformFeedback; - PFNGLTEXSTORAGE3DMULTISAMPLEPROC TexStorage3DMultisample; - PFNGLBLENDEQUATIONIPROC BlendEquationi; - PFNGLVERTEXATTRIB1SPROC VertexAttrib1s; - PFNGLCREATEPROGRAMPROC CreateProgram; - PFNGLUNIFORM3UIVPROC Uniform3uiv; - PFNGLPIXELSTOREIPROC PixelStorei; - PFNGLUNIFORMMATRIX2X4DVPROC UniformMatrix2x4dv; - PFNGLGETUNIFORMDVPROC GetUniformdv; - PFNGLGETNUNIFORMUIVPROC GetnUniformuiv; - PFNGLPRIMITIVERESTARTINDEXPROC PrimitiveRestartIndex; - PFNGLVERTEXATTRIBI4SVPROC VertexAttribI4sv; - PFNGLVERTEXATTRIBI4USVPROC VertexAttribI4usv; - PFNGLINVALIDATEBUFFERSUBDATAPROC InvalidateBufferSubData; - PFNGLUNIFORMMATRIX4X2FVPROC UniformMatrix4x2fv; - PFNGLPOINTPARAMETERIVPROC PointParameteriv; - PFNGLCLEARDEPTHFPROC ClearDepthf; - PFNGLBINDPROGRAMPIPELINEPROC BindProgramPipeline; - PFNGLPROGRAMUNIFORM1DPROC ProgramUniform1d; - PFNGLGETVERTEXATTRIBFVPROC GetVertexAttribfv; - PFNGLCOPYBUFFERSUBDATAPROC CopyBufferSubData; - PFNGLGETINTERNALFORMATIVPROC GetInternalformativ; - PFNGLVERTEXATTRIBI1IPROC VertexAttribI1i; - PFNGLGETTEXPARAMETERIUIVPROC GetTexParameterIuiv; - PFNGLDISPATCHCOMPUTEPROC DispatchCompute; - PFNGLPROGRAMUNIFORM2DVPROC ProgramUniform2dv; - PFNGLMAPBUFFERRANGEPROC MapBufferRange; - PFNGLENDCONDITIONALRENDERPROC EndConditionalRender; - PFNGLGETSAMPLERPARAMETERIIVPROC GetSamplerParameterIiv; - PFNGLPATCHPARAMETERFVPROC PatchParameterfv; - PFNGLPROGRAMUNIFORM1UIVPROC ProgramUniform1uiv; - PFNGLGETVERTEXATTRIBIVPROC GetVertexAttribiv; - PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC GetActiveUniformBlockName; - PFNGLGETQUERYOBJECTI64VPROC GetQueryObjecti64v; - PFNGLDEPTHRANGEINDEXEDPROC DepthRangeIndexed; - PFNGLCLEARCOLORPROC ClearColor; - PFNGLVERTEXATTRIB4FPROC VertexAttrib4f; - PFNGLGETPROGRAMIVPROC GetProgramiv; - PFNGLGETTEXPARAMETERFVPROC GetTexParameterfv; - PFNGLVERTEXATTRIBI2UIVPROC VertexAttribI2uiv; - PFNGLSTENCILMASKPROC StencilMask; - PFNGLVERTEXATTRIBI3UIPROC VertexAttribI3ui; - PFNGLGETTEXLEVELPARAMETERFVPROC GetTexLevelParameterfv; - PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC ProgramUniformMatrix4x2fv; - PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D; - PFNGLUNIFORM3UIPROC Uniform3ui; - PFNGLVERTEXATTRIBI3IPROC VertexAttribI3i; - PFNGLVERTEXATTRIB2FPROC VertexAttrib2f; - PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv; - PFNGLGETPROGRAMINTERFACEIVPROC GetProgramInterfaceiv; - PFNGLENDTRANSFORMFEEDBACKPROC EndTransformFeedback; - PFNGLPROGRAMUNIFORM4FVPROC ProgramUniform4fv; - PFNGLGENQUERIESPROC GenQueries; - PFNGLENABLEPROC Enable; - PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC ProgramUniformMatrix2x4dv; - PFNGLGETBUFFERPARAMETERI64VPROC GetBufferParameteri64v; - PFNGLMULTIDRAWELEMENTSINDIRECTPROC MultiDrawElementsIndirect; - PFNGLCLEARBUFFERFIPROC ClearBufferfi; - PFNGLUNIFORMMATRIX4X3DVPROC UniformMatrix4x3dv; - PFNGLACTIVESHADERPROGRAMPROC ActiveShaderProgram; - PFNGLGETVERTEXATTRIBPOINTERVPROC GetVertexAttribPointerv; - PFNGLSAMPLERPARAMETERFPROC SamplerParameterf; - PFNGLMINSAMPLESHADINGPROC MinSampleShading; - PFNGLPROGRAMUNIFORM3IVPROC ProgramUniform3iv; - PFNGLISRENDERBUFFERPROC IsRenderbuffer; - PFNGLBINDFRAMEBUFFERPROC BindFramebuffer; - PFNGLVERTEXATTRIBP4UIVPROC VertexAttribP4uiv; - PFNGLREADPIXELSPROC ReadPixels; - PFNGLDELETEQUERIESPROC DeleteQueries; - PFNGLCOPYTEXIMAGE1DPROC CopyTexImage1D; - PFNGLSTENCILMASKSEPARATEPROC StencilMaskSeparate; - PFNGLUNIFORM2DVPROC Uniform2dv; - PFNGLDISPATCHCOMPUTEINDIRECTPROC DispatchComputeIndirect; - PFNGLINVALIDATEFRAMEBUFFERPROC InvalidateFramebuffer; - PFNGLGETPROGRAMRESOURCEIVPROC GetProgramResourceiv; - PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate; - PFNGLCOPYTEXSUBIMAGE3DPROC CopyTexSubImage3D; - PFNGLSTENCILOPPROC StencilOp; - PFNGLGETSAMPLERPARAMETERFVPROC GetSamplerParameterfv; - PFNGLGETATTRIBLOCATIONPROC GetAttribLocation; - PFNGLUNIFORM4UIVPROC Uniform4uiv; - PFNGLPATCHPARAMETERIPROC PatchParameteri; - PFNGLPROGRAMUNIFORM4DVPROC ProgramUniform4dv; - PFNGLBLENDFUNCSEPARATEIPROC BlendFuncSeparatei; - PFNGLPROGRAMUNIFORM2IPROC ProgramUniform2i; - PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC DrawTransformFeedbackInstanced; - PFNGLUNIFORM3DPROC Uniform3d; - PFNGLPROGRAMUNIFORM4IPROC ProgramUniform4i; - PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv; - PFNGLSHADERSOURCEPROC ShaderSource; - PFNGLVERTEXATTRIB4FVPROC VertexAttrib4fv; - PFNGLPIXELSTOREFPROC PixelStoref; - PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv; - PFNGLGETBUFFERPARAMETERIVPROC GetBufferParameteriv; - PFNGLGETACTIVEUNIFORMBLOCKIVPROC GetActiveUniformBlockiv; - PFNGLVALIDATEPROGRAMPROC ValidateProgram; - PFNGLPROGRAMUNIFORM3DVPROC ProgramUniform3dv; - PFNGLISTEXTUREPROC IsTexture; - PFNGLGETMULTISAMPLEFVPROC GetMultisamplefv; - PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D; - PFNGLGETSTRINGPROC GetString; - PFNGLGETNUNIFORMFVPROC GetnUniformfv; - PFNGLDRAWARRAYSINDIRECTPROC DrawArraysIndirect; - PFNGLDRAWELEMENTSPROC DrawElements; - PFNGLDEPTHRANGEARRAYVPROC DepthRangeArrayv; - PFNGLGETTEXLEVELPARAMETERIVPROC GetTexLevelParameteriv; - PFNGLBINDRENDERBUFFERPROC BindRenderbuffer; - PFNGLFLUSHPROC Flush; - PFNGLPROGRAMUNIFORM2UIVPROC ProgramUniform2uiv; - PFNGLBLENDEQUATIONPROC BlendEquation; - PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D; - PFNGLUNIFORM4IPROC Uniform4i; - PFNGLCOPYTEXSUBIMAGE1DPROC CopyTexSubImage1D; - PFNGLVIEWPORTPROC Viewport; - PFNGLBINDTRANSFORMFEEDBACKPROC BindTransformFeedback; - PFNGLUNIFORM1FVPROC Uniform1fv; - PFNGLUNIFORM3DVPROC Uniform3dv; - PFNGLUNIFORM1DPROC Uniform1d; - PFNGLVERTEXBINDINGDIVISORPROC VertexBindingDivisor; - PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC GetProgramResourceLocationIndex; - PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv; - PFNGLBEGINCONDITIONALRENDERPROC BeginConditionalRender; - PFNGLISSYNCPROC IsSync; - PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample; - PFNGLGETQUERYINDEXEDIVPROC GetQueryIndexediv; - PFNGLSHADERBINARYPROC ShaderBinary; - PFNGLTEXIMAGE2DPROC TexImage2D; - PFNGLGETSHADERINFOLOGPROC GetShaderInfoLog; - PFNGLBINDSAMPLERPROC BindSampler; - PFNGLCOPYIMAGESUBDATAPROC CopyImageSubData; - PFNGLREADNPIXELSPROC ReadnPixels; - PFNGLDRAWBUFFERPROC DrawBuffer; - PFNGLUNIFORM3FVPROC Uniform3fv; - PFNGLBINDVERTEXARRAYPROC BindVertexArray; - PFNGLCLEARBUFFERSUBDATAPROC ClearBufferSubData; - PFNGLUNMAPBUFFERPROC UnmapBuffer; - PFNGLSAMPLERPARAMETERIUIVPROC SamplerParameterIuiv; - PFNGLGETDEBUGMESSAGELOGPROC GetDebugMessageLog; - PFNGLBINDBUFFERRANGEPROC BindBufferRange; - PFNGLGETUNIFORMINDICESPROC GetUniformIndices; - PFNGLVIEWPORTARRAYVPROC ViewportArrayv; - PFNGLVIEWPORTINDEXEDFPROC ViewportIndexedf; - PFNGLUNIFORM1UIVPROC Uniform1uiv; - PFNGLGETINTEGER64VPROC GetInteger64v; - PFNGLGETINTEGERI_VPROC GetIntegeri_v; - PFNGLUNIFORM4FPROC Uniform4f; - PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv; - PFNGLGETVERTEXATTRIBLDVPROC GetVertexAttribLdv; - PFNGLUNIFORMMATRIX2DVPROC UniformMatrix2dv; - PFNGLVERTEXATTRIBL1DVPROC VertexAttribL1dv; - PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv; - PFNGLUNIFORM4DPROC Uniform4d; - PFNGLGENRENDERBUFFERSPROC GenRenderbuffers; - PFNGLBUFFERDATAPROC BufferData; - PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC DrawElementsInstancedBaseVertex; - PFNGLPROGRAMUNIFORM1FVPROC ProgramUniform1fv; - PFNGLPOPDEBUGGROUPPROC PopDebugGroup; - PFNGLBEGINQUERYPROC BeginQuery; - PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC ProgramUniformMatrix4x3fv; - PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D; - PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC DrawTransformFeedbackStream; - PFNGLGETFRAMEBUFFERPARAMETERIVPROC GetFramebufferParameteriv; - PFNGLWAITSYNCPROC WaitSync; - PFNGLGETSAMPLERPARAMETERIUIVPROC GetSamplerParameterIuiv; - PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC ProgramUniformMatrix4x2dv; - PFNGLVERTEXATTRIBI4BVPROC VertexAttribI4bv; - PFNGLPROGRAMPARAMETERIPROC ProgramParameteri; - PFNGLISPROGRAMPIPELINEPROC IsProgramPipeline; - PFNGLPROGRAMUNIFORM4FPROC ProgramUniform4f; - PFNGLDELETETEXTURESPROC DeleteTextures; - PFNGLBLENDEQUATIONSEPARATEIPROC BlendEquationSeparatei; - PFNGLGETVERTEXATTRIBIIVPROC GetVertexAttribIiv; - PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC DrawArraysInstancedBaseInstance; - PFNGLDEBUGMESSAGECALLBACKPROC DebugMessageCallback; - PFNGLVERTEXATTRIBBINDINGPROC VertexAttribBinding; - PFNGLTEXSUBIMAGE3DPROC TexSubImage3D; - PFNGLGETPROGRAMRESOURCEINDEXPROC GetProgramResourceIndex; - PFNGLSAMPLERPARAMETERIPROC SamplerParameteri; - PFNGLGETPROGRAMRESOURCENAMEPROC GetProgramResourceName; - PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv; - PFNGLDEBUGMESSAGECONTROLPROC DebugMessageControl; - PFNGLSCISSORINDEXEDPROC ScissorIndexed; - PFNGLENABLEIPROC Enablei; - PFNGLSTENCILFUNCPROC StencilFunc; - PFNGLGETSHADERPRECISIONFORMATPROC GetShaderPrecisionFormat; - PFNGLBLENDBARRIERPROC BlendBarrier; - PFNGLTEXPARAMETERFVPROC TexParameterfv; - PFNGLGETFLOATVPROC GetFloatv; - PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC ProgramUniformMatrix3x2dv; - PFNGLISQUERYPROC IsQuery; - PFNGLVERTEXATTRIBP1UIPROC VertexAttribP1ui; - PFNGLVERTEXATTRIB2SPROC VertexAttrib2s; - PFNGLINVALIDATEBUFFERDATAPROC InvalidateBufferData; - PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC GetActiveAtomicCounterBufferiv; - PFNGLGETACTIVEUNIFORMPROC GetActiveUniform; - PFNGLUNIFORMBLOCKBINDINGPROC UniformBlockBinding; - PFNGLPROGRAMUNIFORM3FVPROC ProgramUniform3fv; - PFNGLISENABLEDIPROC IsEnabledi; - PFNGLGETACTIVEUNIFORMNAMEPROC GetActiveUniformName; - PFNGLUNIFORMMATRIX3X4DVPROC UniformMatrix3x4dv; - PFNGLPROGRAMUNIFORM1FPROC ProgramUniform1f; - PFNGLISENABLEDPROC IsEnabled; - PFNGLGETPROGRAMPIPELINEINFOLOGPROC GetProgramPipelineInfoLog; - PFNGLMEMORYBARRIERBYREGIONPROC MemoryBarrierByRegion; - PFNGLDRAWELEMENTSINDIRECTPROC DrawElementsIndirect; - PFNGLGETFRAGDATALOCATIONPROC GetFragDataLocation; - PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC GetActiveSubroutineUniformName; - PFNGLDELETEPROGRAMPROC DeleteProgram; - PFNGLFRAMEBUFFERTEXTUREPROC FramebufferTexture; - PFNGLOBJECTPTRLABELPROC ObjectPtrLabel; - PFNGLPROVOKINGVERTEXPROC ProvokingVertex; - PFNGLUNIFORM1FPROC Uniform1f; - PFNGLUNIFORMMATRIX2X3FVPROC UniformMatrix2x3fv; - PFNGLCLEARBUFFERIVPROC ClearBufferiv; - PFNGLUNIFORMMATRIX4X2DVPROC UniformMatrix4x2dv; - PFNGLGETUNIFORMIVPROC GetUniformiv; - PFNGLUNIFORM1UIPROC Uniform1ui; - PFNGLISSHADERPROC IsShader; - PFNGLHINTPROC Hint; - PFNGLSTENCILOPSEPARATEPROC StencilOpSeparate; - PFNGLFINISHPROC Finish; - PFNGLGENSAMPLERSPROC GenSamplers; - PFNGLPROGRAMUNIFORM2FVPROC ProgramUniform2fv; - PFNGLGETDOUBLEVPROC GetDoublev; - PFNGLBLENDCOLORPROC BlendColor; - PFNGLDRAWRANGEELEMENTSPROC DrawRangeElements; - PFNGLGETUNIFORMUIVPROC GetUniformuiv; - PFNGLUSEPROGRAMSTAGESPROC UseProgramStages; - PFNGLGENFRAMEBUFFERSPROC GenFramebuffers; - PFNGLUNIFORM3IVPROC Uniform3iv; - PFNGLVERTEXATTRIBDIVISORPROC VertexAttribDivisor; - PFNGLGETCOMPRESSEDTEXIMAGEPROC GetCompressedTexImage; - PFNGLPROGRAMUNIFORMMATRIX3FVPROC ProgramUniformMatrix3fv; - PFNGLPROGRAMUNIFORM1DVPROC ProgramUniform1dv; - PFNGLTRANSFORMFEEDBACKVARYINGSPROC TransformFeedbackVaryings; - PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D; - PFNGLUNIFORMMATRIX2FVPROC UniformMatrix2fv; - PFNGLFENCESYNCPROC FenceSync; - PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus; - PFNGLTEXSUBIMAGE1DPROC TexSubImage1D; - PFNGLVERTEXATTRIBP2UIVPROC VertexAttribP2uiv; - PFNGLGENPROGRAMPIPELINESPROC GenProgramPipelines; - PFNGLGETVERTEXATTRIBDVPROC GetVertexAttribdv; - PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer; - PFNGLVERTEXATTRIB4SPROC VertexAttrib4s; - PFNGLCOLORMASKIPROC ColorMaski; - PFNGLVERTEXATTRIBLFORMATPROC VertexAttribLFormat; - PFNGLTEXPARAMETERFPROC TexParameterf; - PFNGLGETSUBROUTINEINDEXPROC GetSubroutineIndex; - PFNGLTEXSTORAGE2DPROC TexStorage2D; - PFNGLCREATESHADERPROGRAMVPROC CreateShaderProgramv; - PFNGLLINEWIDTHPROC LineWidth; - PFNGLPROGRAMUNIFORM2UIPROC ProgramUniform2ui; - PFNGLGETPROGRAMRESOURCELOCATIONPROC GetProgramResourceLocation; - PFNGLTEXSTORAGE3DPROC TexStorage3D; - PFNGLSAMPLEMASKIPROC SampleMaski; - PFNGLGETNUNIFORMIVPROC GetnUniformiv; - PFNGLVERTEXATTRIBLPOINTERPROC VertexAttribLPointer; - PFNGLUNIFORMMATRIX3FVPROC UniformMatrix3fv; - PFNGLVERTEXATTRIBFORMATPROC VertexAttribFormat; - PFNGLCLEARBUFFERFVPROC ClearBufferfv; - PFNGLPROGRAMUNIFORMMATRIX4DVPROC ProgramUniformMatrix4dv; - PFNGLGETQUERYOBJECTUI64VPROC GetQueryObjectui64v; - PFNGLVERTEXATTRIBP1UIVPROC VertexAttribP1uiv; - PFNGLDRAWARRAYSPROC DrawArrays; - PFNGLBINDTEXTUREPROC BindTexture; - PFNGLGETUNIFORMLOCATIONPROC GetUniformLocation; - PFNGLVERTEXATTRIBL2DVPROC VertexAttribL2dv; - PFNGLVERTEXATTRIBI1UIPROC VertexAttribI1ui; - PFNGLATTACHSHADERPROC AttachShader; - PFNGLGETSAMPLERPARAMETERIVPROC GetSamplerParameteriv; - PFNGLCREATESHADERPROC CreateShader; - PFNGLVERTEXATTRIBL4DVPROC VertexAttribL4dv; - PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers; - PFNGLISFRAMEBUFFERPROC IsFramebuffer; - PFNGLISSAMPLERPROC IsSampler; - PFNGLUNIFORM2FPROC Uniform2f; - PFNGLVERTEXATTRIBIFORMATPROC VertexAttribIFormat; - PFNGLVERTEXATTRIBL1DPROC VertexAttribL1d; - PFNGLPUSHDEBUGGROUPPROC PushDebugGroup; - PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv; - PFNGLGETPROGRAMINFOLOGPROC GetProgramInfoLog; - PFNGLGETBOOLEANVPROC GetBooleanv; - PFNGLVERTEXATTRIBI2UIPROC VertexAttribI2ui; - PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC MultiDrawElementsBaseVertex; - PFNGLPROGRAMUNIFORMMATRIX3DVPROC ProgramUniformMatrix3dv; - PFNGLVERTEXATTRIBL3DVPROC VertexAttribL3dv; - PFNGLPROGRAMUNIFORM3IPROC ProgramUniform3i; - PFNGLCLEARSTENCILPROC ClearStencil; - PFNGLSAMPLERPARAMETERIIVPROC SamplerParameterIiv; - PFNGLGETVERTEXATTRIBIUIVPROC GetVertexAttribIuiv; - PFNGLGETINTEGER64I_VPROC GetInteger64i_v; - PFNGLUNIFORM2DPROC Uniform2d; - PFNGLUNIFORMMATRIX3DVPROC UniformMatrix3dv; - PFNGLPROGRAMUNIFORM3UIPROC ProgramUniform3ui; - PFNGLDRAWELEMENTSINSTANCEDPROC DrawElementsInstanced; - PFNGLUNIFORMMATRIX3X2DVPROC UniformMatrix3x2dv; - PFNGLCLEARDEPTHPROC ClearDepth; - PFNGLENDQUERYINDEXEDPROC EndQueryIndexed; - PFNGLUNIFORMMATRIX4X3FVPROC UniformMatrix4x3fv; - PFNGLPROGRAMBINARYPROC ProgramBinary; - PFNGLGETFRAGDATAINDEXPROC GetFragDataIndex; - PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv; - PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers; - PFNGLUNIFORMMATRIX2X3DVPROC UniformMatrix2x3dv; - PFNGLUNIFORM4UIPROC Uniform4ui; - PFNGLGENTEXTURESPROC GenTextures; - PFNGLPROGRAMUNIFORM3FPROC ProgramUniform3f; - PFNGLUNIFORM2UIVPROC Uniform2uiv; - PFNGLCLIENTWAITSYNCPROC ClientWaitSync; - PFNGLGETTEXIMAGEPROC GetTexImage; - PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv; - PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC DrawElementsInstancedBaseVertexBaseInstance; - PFNGLUNIFORM1DVPROC Uniform1dv; - PFNGLVIEWPORTINDEXEDFVPROC ViewportIndexedfv; - PFNGLVERTEXATTRIB1FPROC VertexAttrib1f; - PFNGLGETGRAPHICSRESETSTATUSPROC GetGraphicsResetStatus; - PFNGLUNIFORM4FVPROC Uniform4fv; - PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv; - PFNGLBEGINTRANSFORMFEEDBACKPROC BeginTransformFeedback; -} mg_gl_api; - -MP_API mg_gl_api* mg_gl_get_api(void); - -#define glGetQueryObjectiv mg_gl_get_api()->GetQueryObjectiv -#define glVertexAttribI4i mg_gl_get_api()->VertexAttribI4i -#define glUniform2ui mg_gl_get_api()->Uniform2ui -#define glGetActiveUniformsiv mg_gl_get_api()->GetActiveUniformsiv -#define glReleaseShaderCompiler mg_gl_get_api()->ReleaseShaderCompiler -#define glProgramUniformMatrix3x2fv mg_gl_get_api()->ProgramUniformMatrix3x2fv -#define glBlendFunc mg_gl_get_api()->BlendFunc -#define glVertexAttribI2iv mg_gl_get_api()->VertexAttribI2iv -#define glFlushMappedBufferRange mg_gl_get_api()->FlushMappedBufferRange -#define glMemoryBarrier mg_gl_get_api()->MemoryBarrier -#define glClampColor mg_gl_get_api()->ClampColor -#define glUniform4dv mg_gl_get_api()->Uniform4dv -#define glGetSubroutineUniformLocation mg_gl_get_api()->GetSubroutineUniformLocation -#define glColorMask mg_gl_get_api()->ColorMask -#define glGetIntegerv mg_gl_get_api()->GetIntegerv -#define glDrawBuffers mg_gl_get_api()->DrawBuffers -#define glProgramUniform1i mg_gl_get_api()->ProgramUniform1i -#define glGetRenderbufferParameteriv mg_gl_get_api()->GetRenderbufferParameteriv -#define glFrontFace mg_gl_get_api()->FrontFace -#define glVertexAttribPointer mg_gl_get_api()->VertexAttribPointer -#define glTexStorage1D mg_gl_get_api()->TexStorage1D -#define glProgramUniform1ui mg_gl_get_api()->ProgramUniform1ui -#define glShaderStorageBlockBinding mg_gl_get_api()->ShaderStorageBlockBinding -#define glVertexAttrib1dv mg_gl_get_api()->VertexAttrib1dv -#define glDrawRangeElementsBaseVertex mg_gl_get_api()->DrawRangeElementsBaseVertex -#define glProgramUniformMatrix2fv mg_gl_get_api()->ProgramUniformMatrix2fv -#define glObjectLabel mg_gl_get_api()->ObjectLabel -#define glUniformMatrix3x4fv mg_gl_get_api()->UniformMatrix3x4fv -#define glPointParameteri mg_gl_get_api()->PointParameteri -#define glMapBuffer mg_gl_get_api()->MapBuffer -#define glVertexAttribI1iv mg_gl_get_api()->VertexAttribI1iv -#define glMultiDrawElements mg_gl_get_api()->MultiDrawElements -#define glVertexAttrib4iv mg_gl_get_api()->VertexAttrib4iv -#define glGetProgramPipelineiv mg_gl_get_api()->GetProgramPipelineiv -#define glGetBufferPointerv mg_gl_get_api()->GetBufferPointerv -#define glDisablei mg_gl_get_api()->Disablei -#define glVertexAttrib4uiv mg_gl_get_api()->VertexAttrib4uiv -#define glIsTransformFeedback mg_gl_get_api()->IsTransformFeedback -#define glTexSubImage2D mg_gl_get_api()->TexSubImage2D -#define glBindBufferBase mg_gl_get_api()->BindBufferBase -#define glScissor mg_gl_get_api()->Scissor -#define glGenBuffers mg_gl_get_api()->GenBuffers -#define glGetShaderiv mg_gl_get_api()->GetShaderiv -#define glVertexAttribL3d mg_gl_get_api()->VertexAttribL3d -#define glTexImage3D mg_gl_get_api()->TexImage3D -#define glVertexAttribP4ui mg_gl_get_api()->VertexAttribP4ui -#define glGetDoublei_v mg_gl_get_api()->GetDoublei_v -#define glResumeTransformFeedback mg_gl_get_api()->ResumeTransformFeedback -#define glDrawArraysInstanced mg_gl_get_api()->DrawArraysInstanced -#define glBeginQueryIndexed mg_gl_get_api()->BeginQueryIndexed -#define glVertexAttribL4d mg_gl_get_api()->VertexAttribL4d -#define glCompressedTexImage3D mg_gl_get_api()->CompressedTexImage3D -#define glProgramUniformMatrix2x4fv mg_gl_get_api()->ProgramUniformMatrix2x4fv -#define glLogicOp mg_gl_get_api()->LogicOp -#define glVertexAttribI4ubv mg_gl_get_api()->VertexAttribI4ubv -#define glPrimitiveBoundingBox mg_gl_get_api()->PrimitiveBoundingBox -#define glGetStringi mg_gl_get_api()->GetStringi -#define glUniform4iv mg_gl_get_api()->Uniform4iv -#define glVertexAttrib4Nusv mg_gl_get_api()->VertexAttrib4Nusv -#define glUniform2i mg_gl_get_api()->Uniform2i -#define glTexParameteri mg_gl_get_api()->TexParameteri -#define glGetUniformSubroutineuiv mg_gl_get_api()->GetUniformSubroutineuiv -#define glVertexAttrib1fv mg_gl_get_api()->VertexAttrib1fv -#define glBlitFramebuffer mg_gl_get_api()->BlitFramebuffer -#define glGetQueryObjectuiv mg_gl_get_api()->GetQueryObjectuiv -#define glValidateProgramPipeline mg_gl_get_api()->ValidateProgramPipeline -#define glVertexAttrib4d mg_gl_get_api()->VertexAttrib4d -#define glProgramUniform2f mg_gl_get_api()->ProgramUniform2f -#define glClearBufferuiv mg_gl_get_api()->ClearBufferuiv -#define glBufferSubData mg_gl_get_api()->BufferSubData -#define glGetTransformFeedbackVarying mg_gl_get_api()->GetTransformFeedbackVarying -#define glVertexAttribI2i mg_gl_get_api()->VertexAttribI2i -#define glTexParameterIuiv mg_gl_get_api()->TexParameterIuiv -#define glTexParameteriv mg_gl_get_api()->TexParameteriv -#define glVertexAttribI3uiv mg_gl_get_api()->VertexAttribI3uiv -#define glDeleteBuffers mg_gl_get_api()->DeleteBuffers -#define glVertexAttribP3ui mg_gl_get_api()->VertexAttribP3ui -#define glUniform2fv mg_gl_get_api()->Uniform2fv -#define glProgramUniform4d mg_gl_get_api()->ProgramUniform4d -#define glProgramUniform1iv mg_gl_get_api()->ProgramUniform1iv -#define glDeleteProgramPipelines mg_gl_get_api()->DeleteProgramPipelines -#define glDisable mg_gl_get_api()->Disable -#define glPointParameterfv mg_gl_get_api()->PointParameterfv -#define glProgramUniform3d mg_gl_get_api()->ProgramUniform3d -#define glCompileShader mg_gl_get_api()->CompileShader -#define glDeleteVertexArrays mg_gl_get_api()->DeleteVertexArrays -#define glVertexAttribI4uiv mg_gl_get_api()->VertexAttribI4uiv -#define glActiveTexture mg_gl_get_api()->ActiveTexture -#define glDebugMessageInsert mg_gl_get_api()->DebugMessageInsert -#define glGetTexParameterIiv mg_gl_get_api()->GetTexParameterIiv -#define glQueryCounter mg_gl_get_api()->QueryCounter -#define glVertexAttribI3iv mg_gl_get_api()->VertexAttribI3iv -#define glFramebufferTexture1D mg_gl_get_api()->FramebufferTexture1D -#define glSamplerParameteriv mg_gl_get_api()->SamplerParameteriv -#define glGetFramebufferAttachmentParameteriv mg_gl_get_api()->GetFramebufferAttachmentParameteriv -#define glProgramUniformMatrix3x4dv mg_gl_get_api()->ProgramUniformMatrix3x4dv -#define glIsVertexArray mg_gl_get_api()->IsVertexArray -#define glTexImage1D mg_gl_get_api()->TexImage1D -#define glGetObjectLabel mg_gl_get_api()->GetObjectLabel -#define glVertexAttrib1d mg_gl_get_api()->VertexAttrib1d -#define glDeleteSync mg_gl_get_api()->DeleteSync -#define glGetActiveSubroutineUniformiv mg_gl_get_api()->GetActiveSubroutineUniformiv -#define glGetPointerv mg_gl_get_api()->GetPointerv -#define glInvalidateTexSubImage mg_gl_get_api()->InvalidateTexSubImage -#define glDetachShader mg_gl_get_api()->DetachShader -#define glGetTexParameteriv mg_gl_get_api()->GetTexParameteriv -#define glVertexAttrib4Nuiv mg_gl_get_api()->VertexAttrib4Nuiv -#define glStencilFuncSeparate mg_gl_get_api()->StencilFuncSeparate -#define glVertexAttrib4usv mg_gl_get_api()->VertexAttrib4usv -#define glDrawElementsInstancedBaseInstance mg_gl_get_api()->DrawElementsInstancedBaseInstance -#define glTexStorage2DMultisample mg_gl_get_api()->TexStorage2DMultisample -#define glUniformMatrix4fv mg_gl_get_api()->UniformMatrix4fv -#define glVertexAttribP3uiv mg_gl_get_api()->VertexAttribP3uiv -#define glTexBufferRange mg_gl_get_api()->TexBufferRange -#define glGenerateMipmap mg_gl_get_api()->GenerateMipmap -#define glVertexAttrib2fv mg_gl_get_api()->VertexAttrib2fv -#define glEnableVertexAttribArray mg_gl_get_api()->EnableVertexAttribArray -#define glGetAttachedShaders mg_gl_get_api()->GetAttachedShaders -#define glVertexAttrib3s mg_gl_get_api()->VertexAttrib3s -#define glMultiDrawArrays mg_gl_get_api()->MultiDrawArrays -#define glGetBooleani_v mg_gl_get_api()->GetBooleani_v -#define glFramebufferTextureLayer mg_gl_get_api()->FramebufferTextureLayer -#define glGetProgramStageiv mg_gl_get_api()->GetProgramStageiv -#define glPointParameterf mg_gl_get_api()->PointParameterf -#define glUseProgram mg_gl_get_api()->UseProgram -#define glProgramUniform4uiv mg_gl_get_api()->ProgramUniform4uiv -#define glScissorIndexedv mg_gl_get_api()->ScissorIndexedv -#define glClearBufferData mg_gl_get_api()->ClearBufferData -#define glMultiDrawArraysIndirect mg_gl_get_api()->MultiDrawArraysIndirect -#define glGetBufferSubData mg_gl_get_api()->GetBufferSubData -#define glPolygonOffset mg_gl_get_api()->PolygonOffset -#define glVertexAttrib4Nub mg_gl_get_api()->VertexAttrib4Nub -#define glRenderbufferStorage mg_gl_get_api()->RenderbufferStorage -#define glDisableVertexAttribArray mg_gl_get_api()->DisableVertexAttribArray -#define glLinkProgram mg_gl_get_api()->LinkProgram -#define glBindImageTexture mg_gl_get_api()->BindImageTexture -#define glGetActiveSubroutineName mg_gl_get_api()->GetActiveSubroutineName -#define glUniform1iv mg_gl_get_api()->Uniform1iv -#define glUniform1i mg_gl_get_api()->Uniform1i -#define glVertexAttrib2sv mg_gl_get_api()->VertexAttrib2sv -#define glProgramUniformMatrix2dv mg_gl_get_api()->ProgramUniformMatrix2dv -#define glProgramUniform4iv mg_gl_get_api()->ProgramUniform4iv -#define glProgramUniform3uiv mg_gl_get_api()->ProgramUniform3uiv -#define glProgramUniform4ui mg_gl_get_api()->ProgramUniform4ui -#define glGetUniformBlockIndex mg_gl_get_api()->GetUniformBlockIndex -#define glProgramUniform2d mg_gl_get_api()->ProgramUniform2d -#define glClear mg_gl_get_api()->Clear -#define glEndQuery mg_gl_get_api()->EndQuery -#define glPauseTransformFeedback mg_gl_get_api()->PauseTransformFeedback -#define glDepthRange mg_gl_get_api()->DepthRange -#define glPolygonMode mg_gl_get_api()->PolygonMode -#define glTexImage3DMultisample mg_gl_get_api()->TexImage3DMultisample -#define glIsBuffer mg_gl_get_api()->IsBuffer -#define glCullFace mg_gl_get_api()->CullFace -#define glProgramUniformMatrix3x4fv mg_gl_get_api()->ProgramUniformMatrix3x4fv -#define glBindVertexBuffer mg_gl_get_api()->BindVertexBuffer -#define glCopyTexImage2D mg_gl_get_api()->CopyTexImage2D -#define glVertexAttrib3f mg_gl_get_api()->VertexAttrib3f -#define glGenVertexArrays mg_gl_get_api()->GenVertexArrays -#define glUniformMatrix2x4fv mg_gl_get_api()->UniformMatrix2x4fv -#define glCopyTexSubImage2D mg_gl_get_api()->CopyTexSubImage2D -#define glDrawElementsBaseVertex mg_gl_get_api()->DrawElementsBaseVertex -#define glInvalidateTexImage mg_gl_get_api()->InvalidateTexImage -#define glInvalidateSubFramebuffer mg_gl_get_api()->InvalidateSubFramebuffer -#define glGetError mg_gl_get_api()->GetError -#define glBindBuffer mg_gl_get_api()->BindBuffer -#define glVertexAttrib3fv mg_gl_get_api()->VertexAttrib3fv -#define glVertexAttribI4iv mg_gl_get_api()->VertexAttribI4iv -#define glTextureView mg_gl_get_api()->TextureView -#define glVertexAttribI4ui mg_gl_get_api()->VertexAttribI4ui -#define glGetFloati_v mg_gl_get_api()->GetFloati_v -#define glBlendFunci mg_gl_get_api()->BlendFunci -#define glProgramUniformMatrix4fv mg_gl_get_api()->ProgramUniformMatrix4fv -#define glTexImage2DMultisample mg_gl_get_api()->TexImage2DMultisample -#define glDepthFunc mg_gl_get_api()->DepthFunc -#define glProgramUniformMatrix4x3dv mg_gl_get_api()->ProgramUniformMatrix4x3dv -#define glVertexAttrib3d mg_gl_get_api()->VertexAttrib3d -#define glSamplerParameterfv mg_gl_get_api()->SamplerParameterfv -#define glBindFragDataLocation mg_gl_get_api()->BindFragDataLocation -#define glBindAttribLocation mg_gl_get_api()->BindAttribLocation -#define glUniform3i mg_gl_get_api()->Uniform3i -#define glDeleteShader mg_gl_get_api()->DeleteShader -#define glReadBuffer mg_gl_get_api()->ReadBuffer -#define glUniformMatrix4dv mg_gl_get_api()->UniformMatrix4dv -#define glVertexAttrib2d mg_gl_get_api()->VertexAttrib2d -#define glVertexAttribL2d mg_gl_get_api()->VertexAttribL2d -#define glDeleteSamplers mg_gl_get_api()->DeleteSamplers -#define glVertexAttrib1sv mg_gl_get_api()->VertexAttrib1sv -#define glDepthRangef mg_gl_get_api()->DepthRangef -#define glFramebufferParameteri mg_gl_get_api()->FramebufferParameteri -#define glTexParameterIiv mg_gl_get_api()->TexParameterIiv -#define glGetInternalformati64v mg_gl_get_api()->GetInternalformati64v -#define glProgramUniformMatrix2x3dv mg_gl_get_api()->ProgramUniformMatrix2x3dv -#define glProgramUniformMatrix2x3fv mg_gl_get_api()->ProgramUniformMatrix2x3fv -#define glGetSynciv mg_gl_get_api()->GetSynciv -#define glScissorArrayv mg_gl_get_api()->ScissorArrayv -#define glDepthMask mg_gl_get_api()->DepthMask -#define glPointSize mg_gl_get_api()->PointSize -#define glGetUniformfv mg_gl_get_api()->GetUniformfv -#define glSampleCoverage mg_gl_get_api()->SampleCoverage -#define glCompressedTexImage1D mg_gl_get_api()->CompressedTexImage1D -#define glIsProgram mg_gl_get_api()->IsProgram -#define glVertexAttribI1uiv mg_gl_get_api()->VertexAttribI1uiv -#define glGetObjectPtrLabel mg_gl_get_api()->GetObjectPtrLabel -#define glCompressedTexSubImage2D mg_gl_get_api()->CompressedTexSubImage2D -#define glUniformSubroutinesuiv mg_gl_get_api()->UniformSubroutinesuiv -#define glBlendFuncSeparate mg_gl_get_api()->BlendFuncSeparate -#define glUniform2iv mg_gl_get_api()->Uniform2iv -#define glUniform3f mg_gl_get_api()->Uniform3f -#define glBindFragDataLocationIndexed mg_gl_get_api()->BindFragDataLocationIndexed -#define glUniformMatrix3x2fv mg_gl_get_api()->UniformMatrix3x2fv -#define glGetShaderSource mg_gl_get_api()->GetShaderSource -#define glVertexAttribIPointer mg_gl_get_api()->VertexAttribIPointer -#define glDrawTransformFeedbackStreamInstanced mg_gl_get_api()->DrawTransformFeedbackStreamInstanced -#define glProgramUniform2iv mg_gl_get_api()->ProgramUniform2iv -#define glVertexAttribP2ui mg_gl_get_api()->VertexAttribP2ui -#define glGetQueryiv mg_gl_get_api()->GetQueryiv -#define glGetActiveAttrib mg_gl_get_api()->GetActiveAttrib -#define glTexBuffer mg_gl_get_api()->TexBuffer -#define glDeleteTransformFeedbacks mg_gl_get_api()->DeleteTransformFeedbacks -#define glGenTransformFeedbacks mg_gl_get_api()->GenTransformFeedbacks -#define glGetProgramBinary mg_gl_get_api()->GetProgramBinary -#define glDrawTransformFeedback mg_gl_get_api()->DrawTransformFeedback -#define glTexStorage3DMultisample mg_gl_get_api()->TexStorage3DMultisample -#define glBlendEquationi mg_gl_get_api()->BlendEquationi -#define glVertexAttrib1s mg_gl_get_api()->VertexAttrib1s -#define glCreateProgram mg_gl_get_api()->CreateProgram -#define glUniform3uiv mg_gl_get_api()->Uniform3uiv -#define glPixelStorei mg_gl_get_api()->PixelStorei -#define glUniformMatrix2x4dv mg_gl_get_api()->UniformMatrix2x4dv -#define glGetUniformdv mg_gl_get_api()->GetUniformdv -#define glGetnUniformuiv mg_gl_get_api()->GetnUniformuiv -#define glPrimitiveRestartIndex mg_gl_get_api()->PrimitiveRestartIndex -#define glVertexAttribI4sv mg_gl_get_api()->VertexAttribI4sv -#define glVertexAttribI4usv mg_gl_get_api()->VertexAttribI4usv -#define glInvalidateBufferSubData mg_gl_get_api()->InvalidateBufferSubData -#define glUniformMatrix4x2fv mg_gl_get_api()->UniformMatrix4x2fv -#define glPointParameteriv mg_gl_get_api()->PointParameteriv -#define glClearDepthf mg_gl_get_api()->ClearDepthf -#define glBindProgramPipeline mg_gl_get_api()->BindProgramPipeline -#define glProgramUniform1d mg_gl_get_api()->ProgramUniform1d -#define glGetVertexAttribfv mg_gl_get_api()->GetVertexAttribfv -#define glCopyBufferSubData mg_gl_get_api()->CopyBufferSubData -#define glGetInternalformativ mg_gl_get_api()->GetInternalformativ -#define glVertexAttribI1i mg_gl_get_api()->VertexAttribI1i -#define glGetTexParameterIuiv mg_gl_get_api()->GetTexParameterIuiv -#define glDispatchCompute mg_gl_get_api()->DispatchCompute -#define glProgramUniform2dv mg_gl_get_api()->ProgramUniform2dv -#define glMapBufferRange mg_gl_get_api()->MapBufferRange -#define glEndConditionalRender mg_gl_get_api()->EndConditionalRender -#define glGetSamplerParameterIiv mg_gl_get_api()->GetSamplerParameterIiv -#define glPatchParameterfv mg_gl_get_api()->PatchParameterfv -#define glProgramUniform1uiv mg_gl_get_api()->ProgramUniform1uiv -#define glGetVertexAttribiv mg_gl_get_api()->GetVertexAttribiv -#define glGetActiveUniformBlockName mg_gl_get_api()->GetActiveUniformBlockName -#define glGetQueryObjecti64v mg_gl_get_api()->GetQueryObjecti64v -#define glDepthRangeIndexed mg_gl_get_api()->DepthRangeIndexed -#define glClearColor mg_gl_get_api()->ClearColor -#define glVertexAttrib4f mg_gl_get_api()->VertexAttrib4f -#define glGetProgramiv mg_gl_get_api()->GetProgramiv -#define glGetTexParameterfv mg_gl_get_api()->GetTexParameterfv -#define glVertexAttribI2uiv mg_gl_get_api()->VertexAttribI2uiv -#define glStencilMask mg_gl_get_api()->StencilMask -#define glVertexAttribI3ui mg_gl_get_api()->VertexAttribI3ui -#define glGetTexLevelParameterfv mg_gl_get_api()->GetTexLevelParameterfv -#define glProgramUniformMatrix4x2fv mg_gl_get_api()->ProgramUniformMatrix4x2fv -#define glCompressedTexImage2D mg_gl_get_api()->CompressedTexImage2D -#define glUniform3ui mg_gl_get_api()->Uniform3ui -#define glVertexAttribI3i mg_gl_get_api()->VertexAttribI3i -#define glVertexAttrib2f mg_gl_get_api()->VertexAttrib2f -#define glVertexAttrib3dv mg_gl_get_api()->VertexAttrib3dv -#define glGetProgramInterfaceiv mg_gl_get_api()->GetProgramInterfaceiv -#define glEndTransformFeedback mg_gl_get_api()->EndTransformFeedback -#define glProgramUniform4fv mg_gl_get_api()->ProgramUniform4fv -#define glGenQueries mg_gl_get_api()->GenQueries -#define glEnable mg_gl_get_api()->Enable -#define glProgramUniformMatrix2x4dv mg_gl_get_api()->ProgramUniformMatrix2x4dv -#define glGetBufferParameteri64v mg_gl_get_api()->GetBufferParameteri64v -#define glMultiDrawElementsIndirect mg_gl_get_api()->MultiDrawElementsIndirect -#define glClearBufferfi mg_gl_get_api()->ClearBufferfi -#define glUniformMatrix4x3dv mg_gl_get_api()->UniformMatrix4x3dv -#define glActiveShaderProgram mg_gl_get_api()->ActiveShaderProgram -#define glGetVertexAttribPointerv mg_gl_get_api()->GetVertexAttribPointerv -#define glSamplerParameterf mg_gl_get_api()->SamplerParameterf -#define glMinSampleShading mg_gl_get_api()->MinSampleShading -#define glProgramUniform3iv mg_gl_get_api()->ProgramUniform3iv -#define glIsRenderbuffer mg_gl_get_api()->IsRenderbuffer -#define glBindFramebuffer mg_gl_get_api()->BindFramebuffer -#define glVertexAttribP4uiv mg_gl_get_api()->VertexAttribP4uiv -#define glReadPixels mg_gl_get_api()->ReadPixels -#define glDeleteQueries mg_gl_get_api()->DeleteQueries -#define glCopyTexImage1D mg_gl_get_api()->CopyTexImage1D -#define glStencilMaskSeparate mg_gl_get_api()->StencilMaskSeparate -#define glUniform2dv mg_gl_get_api()->Uniform2dv -#define glDispatchComputeIndirect mg_gl_get_api()->DispatchComputeIndirect -#define glInvalidateFramebuffer mg_gl_get_api()->InvalidateFramebuffer -#define glGetProgramResourceiv mg_gl_get_api()->GetProgramResourceiv -#define glBlendEquationSeparate mg_gl_get_api()->BlendEquationSeparate -#define glCopyTexSubImage3D mg_gl_get_api()->CopyTexSubImage3D -#define glStencilOp mg_gl_get_api()->StencilOp -#define glGetSamplerParameterfv mg_gl_get_api()->GetSamplerParameterfv -#define glGetAttribLocation mg_gl_get_api()->GetAttribLocation -#define glUniform4uiv mg_gl_get_api()->Uniform4uiv -#define glPatchParameteri mg_gl_get_api()->PatchParameteri -#define glProgramUniform4dv mg_gl_get_api()->ProgramUniform4dv -#define glBlendFuncSeparatei mg_gl_get_api()->BlendFuncSeparatei -#define glProgramUniform2i mg_gl_get_api()->ProgramUniform2i -#define glDrawTransformFeedbackInstanced mg_gl_get_api()->DrawTransformFeedbackInstanced -#define glUniform3d mg_gl_get_api()->Uniform3d -#define glProgramUniform4i mg_gl_get_api()->ProgramUniform4i -#define glVertexAttrib3sv mg_gl_get_api()->VertexAttrib3sv -#define glShaderSource mg_gl_get_api()->ShaderSource -#define glVertexAttrib4fv mg_gl_get_api()->VertexAttrib4fv -#define glPixelStoref mg_gl_get_api()->PixelStoref -#define glVertexAttrib4Niv mg_gl_get_api()->VertexAttrib4Niv -#define glGetBufferParameteriv mg_gl_get_api()->GetBufferParameteriv -#define glGetActiveUniformBlockiv mg_gl_get_api()->GetActiveUniformBlockiv -#define glValidateProgram mg_gl_get_api()->ValidateProgram -#define glProgramUniform3dv mg_gl_get_api()->ProgramUniform3dv -#define glIsTexture mg_gl_get_api()->IsTexture -#define glGetMultisamplefv mg_gl_get_api()->GetMultisamplefv -#define glCompressedTexSubImage3D mg_gl_get_api()->CompressedTexSubImage3D -#define glGetString mg_gl_get_api()->GetString -#define glGetnUniformfv mg_gl_get_api()->GetnUniformfv -#define glDrawArraysIndirect mg_gl_get_api()->DrawArraysIndirect -#define glDrawElements mg_gl_get_api()->DrawElements -#define glDepthRangeArrayv mg_gl_get_api()->DepthRangeArrayv -#define glGetTexLevelParameteriv mg_gl_get_api()->GetTexLevelParameteriv -#define glBindRenderbuffer mg_gl_get_api()->BindRenderbuffer -#define glFlush mg_gl_get_api()->Flush -#define glProgramUniform2uiv mg_gl_get_api()->ProgramUniform2uiv -#define glBlendEquation mg_gl_get_api()->BlendEquation -#define glFramebufferTexture2D mg_gl_get_api()->FramebufferTexture2D -#define glUniform4i mg_gl_get_api()->Uniform4i -#define glCopyTexSubImage1D mg_gl_get_api()->CopyTexSubImage1D -#define glViewport mg_gl_get_api()->Viewport -#define glBindTransformFeedback mg_gl_get_api()->BindTransformFeedback -#define glUniform1fv mg_gl_get_api()->Uniform1fv -#define glUniform3dv mg_gl_get_api()->Uniform3dv -#define glUniform1d mg_gl_get_api()->Uniform1d -#define glVertexBindingDivisor mg_gl_get_api()->VertexBindingDivisor -#define glGetProgramResourceLocationIndex mg_gl_get_api()->GetProgramResourceLocationIndex -#define glVertexAttrib2dv mg_gl_get_api()->VertexAttrib2dv -#define glBeginConditionalRender mg_gl_get_api()->BeginConditionalRender -#define glIsSync mg_gl_get_api()->IsSync -#define glRenderbufferStorageMultisample mg_gl_get_api()->RenderbufferStorageMultisample -#define glGetQueryIndexediv mg_gl_get_api()->GetQueryIndexediv -#define glShaderBinary mg_gl_get_api()->ShaderBinary -#define glTexImage2D mg_gl_get_api()->TexImage2D -#define glGetShaderInfoLog mg_gl_get_api()->GetShaderInfoLog -#define glBindSampler mg_gl_get_api()->BindSampler -#define glCopyImageSubData mg_gl_get_api()->CopyImageSubData -#define glReadnPixels mg_gl_get_api()->ReadnPixels -#define glDrawBuffer mg_gl_get_api()->DrawBuffer -#define glUniform3fv mg_gl_get_api()->Uniform3fv -#define glBindVertexArray mg_gl_get_api()->BindVertexArray -#define glClearBufferSubData mg_gl_get_api()->ClearBufferSubData -#define glUnmapBuffer mg_gl_get_api()->UnmapBuffer -#define glSamplerParameterIuiv mg_gl_get_api()->SamplerParameterIuiv -#define glGetDebugMessageLog mg_gl_get_api()->GetDebugMessageLog -#define glBindBufferRange mg_gl_get_api()->BindBufferRange -#define glGetUniformIndices mg_gl_get_api()->GetUniformIndices -#define glViewportArrayv mg_gl_get_api()->ViewportArrayv -#define glViewportIndexedf mg_gl_get_api()->ViewportIndexedf -#define glUniform1uiv mg_gl_get_api()->Uniform1uiv -#define glGetInteger64v mg_gl_get_api()->GetInteger64v -#define glGetIntegeri_v mg_gl_get_api()->GetIntegeri_v -#define glUniform4f mg_gl_get_api()->Uniform4f -#define glVertexAttrib4Nbv mg_gl_get_api()->VertexAttrib4Nbv -#define glGetVertexAttribLdv mg_gl_get_api()->GetVertexAttribLdv -#define glUniformMatrix2dv mg_gl_get_api()->UniformMatrix2dv -#define glVertexAttribL1dv mg_gl_get_api()->VertexAttribL1dv -#define glVertexAttrib4bv mg_gl_get_api()->VertexAttrib4bv -#define glUniform4d mg_gl_get_api()->Uniform4d -#define glGenRenderbuffers mg_gl_get_api()->GenRenderbuffers -#define glBufferData mg_gl_get_api()->BufferData -#define glDrawElementsInstancedBaseVertex mg_gl_get_api()->DrawElementsInstancedBaseVertex -#define glProgramUniform1fv mg_gl_get_api()->ProgramUniform1fv -#define glPopDebugGroup mg_gl_get_api()->PopDebugGroup -#define glBeginQuery mg_gl_get_api()->BeginQuery -#define glProgramUniformMatrix4x3fv mg_gl_get_api()->ProgramUniformMatrix4x3fv -#define glCompressedTexSubImage1D mg_gl_get_api()->CompressedTexSubImage1D -#define glDrawTransformFeedbackStream mg_gl_get_api()->DrawTransformFeedbackStream -#define glGetFramebufferParameteriv mg_gl_get_api()->GetFramebufferParameteriv -#define glWaitSync mg_gl_get_api()->WaitSync -#define glGetSamplerParameterIuiv mg_gl_get_api()->GetSamplerParameterIuiv -#define glProgramUniformMatrix4x2dv mg_gl_get_api()->ProgramUniformMatrix4x2dv -#define glVertexAttribI4bv mg_gl_get_api()->VertexAttribI4bv -#define glProgramParameteri mg_gl_get_api()->ProgramParameteri -#define glIsProgramPipeline mg_gl_get_api()->IsProgramPipeline -#define glProgramUniform4f mg_gl_get_api()->ProgramUniform4f -#define glDeleteTextures mg_gl_get_api()->DeleteTextures -#define glBlendEquationSeparatei mg_gl_get_api()->BlendEquationSeparatei -#define glGetVertexAttribIiv mg_gl_get_api()->GetVertexAttribIiv -#define glDrawArraysInstancedBaseInstance mg_gl_get_api()->DrawArraysInstancedBaseInstance -#define glDebugMessageCallback mg_gl_get_api()->DebugMessageCallback -#define glVertexAttribBinding mg_gl_get_api()->VertexAttribBinding -#define glTexSubImage3D mg_gl_get_api()->TexSubImage3D -#define glGetProgramResourceIndex mg_gl_get_api()->GetProgramResourceIndex -#define glSamplerParameteri mg_gl_get_api()->SamplerParameteri -#define glGetProgramResourceName mg_gl_get_api()->GetProgramResourceName -#define glVertexAttrib4ubv mg_gl_get_api()->VertexAttrib4ubv -#define glDebugMessageControl mg_gl_get_api()->DebugMessageControl -#define glScissorIndexed mg_gl_get_api()->ScissorIndexed -#define glEnablei mg_gl_get_api()->Enablei -#define glStencilFunc mg_gl_get_api()->StencilFunc -#define glGetShaderPrecisionFormat mg_gl_get_api()->GetShaderPrecisionFormat -#define glBlendBarrier mg_gl_get_api()->BlendBarrier -#define glTexParameterfv mg_gl_get_api()->TexParameterfv -#define glGetFloatv mg_gl_get_api()->GetFloatv -#define glProgramUniformMatrix3x2dv mg_gl_get_api()->ProgramUniformMatrix3x2dv -#define glIsQuery mg_gl_get_api()->IsQuery -#define glVertexAttribP1ui mg_gl_get_api()->VertexAttribP1ui -#define glVertexAttrib2s mg_gl_get_api()->VertexAttrib2s -#define glInvalidateBufferData mg_gl_get_api()->InvalidateBufferData -#define glGetActiveAtomicCounterBufferiv mg_gl_get_api()->GetActiveAtomicCounterBufferiv -#define glGetActiveUniform mg_gl_get_api()->GetActiveUniform -#define glUniformBlockBinding mg_gl_get_api()->UniformBlockBinding -#define glProgramUniform3fv mg_gl_get_api()->ProgramUniform3fv -#define glIsEnabledi mg_gl_get_api()->IsEnabledi -#define glGetActiveUniformName mg_gl_get_api()->GetActiveUniformName -#define glUniformMatrix3x4dv mg_gl_get_api()->UniformMatrix3x4dv -#define glProgramUniform1f mg_gl_get_api()->ProgramUniform1f -#define glIsEnabled mg_gl_get_api()->IsEnabled -#define glGetProgramPipelineInfoLog mg_gl_get_api()->GetProgramPipelineInfoLog -#define glMemoryBarrierByRegion mg_gl_get_api()->MemoryBarrierByRegion -#define glDrawElementsIndirect mg_gl_get_api()->DrawElementsIndirect -#define glGetFragDataLocation mg_gl_get_api()->GetFragDataLocation -#define glGetActiveSubroutineUniformName mg_gl_get_api()->GetActiveSubroutineUniformName -#define glDeleteProgram mg_gl_get_api()->DeleteProgram -#define glFramebufferTexture mg_gl_get_api()->FramebufferTexture -#define glObjectPtrLabel mg_gl_get_api()->ObjectPtrLabel -#define glProvokingVertex mg_gl_get_api()->ProvokingVertex -#define glUniform1f mg_gl_get_api()->Uniform1f -#define glUniformMatrix2x3fv mg_gl_get_api()->UniformMatrix2x3fv -#define glClearBufferiv mg_gl_get_api()->ClearBufferiv -#define glUniformMatrix4x2dv mg_gl_get_api()->UniformMatrix4x2dv -#define glGetUniformiv mg_gl_get_api()->GetUniformiv -#define glUniform1ui mg_gl_get_api()->Uniform1ui -#define glIsShader mg_gl_get_api()->IsShader -#define glHint mg_gl_get_api()->Hint -#define glStencilOpSeparate mg_gl_get_api()->StencilOpSeparate -#define glFinish mg_gl_get_api()->Finish -#define glGenSamplers mg_gl_get_api()->GenSamplers -#define glProgramUniform2fv mg_gl_get_api()->ProgramUniform2fv -#define glGetDoublev mg_gl_get_api()->GetDoublev -#define glBlendColor mg_gl_get_api()->BlendColor -#define glDrawRangeElements mg_gl_get_api()->DrawRangeElements -#define glGetUniformuiv mg_gl_get_api()->GetUniformuiv -#define glUseProgramStages mg_gl_get_api()->UseProgramStages -#define glGenFramebuffers mg_gl_get_api()->GenFramebuffers -#define glUniform3iv mg_gl_get_api()->Uniform3iv -#define glVertexAttribDivisor mg_gl_get_api()->VertexAttribDivisor -#define glGetCompressedTexImage mg_gl_get_api()->GetCompressedTexImage -#define glProgramUniformMatrix3fv mg_gl_get_api()->ProgramUniformMatrix3fv -#define glProgramUniform1dv mg_gl_get_api()->ProgramUniform1dv -#define glTransformFeedbackVaryings mg_gl_get_api()->TransformFeedbackVaryings -#define glFramebufferTexture3D mg_gl_get_api()->FramebufferTexture3D -#define glUniformMatrix2fv mg_gl_get_api()->UniformMatrix2fv -#define glFenceSync mg_gl_get_api()->FenceSync -#define glCheckFramebufferStatus mg_gl_get_api()->CheckFramebufferStatus -#define glTexSubImage1D mg_gl_get_api()->TexSubImage1D -#define glVertexAttribP2uiv mg_gl_get_api()->VertexAttribP2uiv -#define glGenProgramPipelines mg_gl_get_api()->GenProgramPipelines -#define glGetVertexAttribdv mg_gl_get_api()->GetVertexAttribdv -#define glFramebufferRenderbuffer mg_gl_get_api()->FramebufferRenderbuffer -#define glVertexAttrib4s mg_gl_get_api()->VertexAttrib4s -#define glColorMaski mg_gl_get_api()->ColorMaski -#define glVertexAttribLFormat mg_gl_get_api()->VertexAttribLFormat -#define glTexParameterf mg_gl_get_api()->TexParameterf -#define glGetSubroutineIndex mg_gl_get_api()->GetSubroutineIndex -#define glTexStorage2D mg_gl_get_api()->TexStorage2D -#define glCreateShaderProgramv mg_gl_get_api()->CreateShaderProgramv -#define glLineWidth mg_gl_get_api()->LineWidth -#define glProgramUniform2ui mg_gl_get_api()->ProgramUniform2ui -#define glGetProgramResourceLocation mg_gl_get_api()->GetProgramResourceLocation -#define glTexStorage3D mg_gl_get_api()->TexStorage3D -#define glSampleMaski mg_gl_get_api()->SampleMaski -#define glGetnUniformiv mg_gl_get_api()->GetnUniformiv -#define glVertexAttribLPointer mg_gl_get_api()->VertexAttribLPointer -#define glUniformMatrix3fv mg_gl_get_api()->UniformMatrix3fv -#define glVertexAttribFormat mg_gl_get_api()->VertexAttribFormat -#define glClearBufferfv mg_gl_get_api()->ClearBufferfv -#define glProgramUniformMatrix4dv mg_gl_get_api()->ProgramUniformMatrix4dv -#define glGetQueryObjectui64v mg_gl_get_api()->GetQueryObjectui64v -#define glVertexAttribP1uiv mg_gl_get_api()->VertexAttribP1uiv -#define glDrawArrays mg_gl_get_api()->DrawArrays -#define glBindTexture mg_gl_get_api()->BindTexture -#define glGetUniformLocation mg_gl_get_api()->GetUniformLocation -#define glVertexAttribL2dv mg_gl_get_api()->VertexAttribL2dv -#define glVertexAttribI1ui mg_gl_get_api()->VertexAttribI1ui -#define glAttachShader mg_gl_get_api()->AttachShader -#define glGetSamplerParameteriv mg_gl_get_api()->GetSamplerParameteriv -#define glCreateShader mg_gl_get_api()->CreateShader -#define glVertexAttribL4dv mg_gl_get_api()->VertexAttribL4dv -#define glDeleteFramebuffers mg_gl_get_api()->DeleteFramebuffers -#define glIsFramebuffer mg_gl_get_api()->IsFramebuffer -#define glIsSampler mg_gl_get_api()->IsSampler -#define glUniform2f mg_gl_get_api()->Uniform2f -#define glVertexAttribIFormat mg_gl_get_api()->VertexAttribIFormat -#define glVertexAttribL1d mg_gl_get_api()->VertexAttribL1d -#define glPushDebugGroup mg_gl_get_api()->PushDebugGroup -#define glVertexAttrib4Nubv mg_gl_get_api()->VertexAttrib4Nubv -#define glGetProgramInfoLog mg_gl_get_api()->GetProgramInfoLog -#define glGetBooleanv mg_gl_get_api()->GetBooleanv -#define glVertexAttribI2ui mg_gl_get_api()->VertexAttribI2ui -#define glMultiDrawElementsBaseVertex mg_gl_get_api()->MultiDrawElementsBaseVertex -#define glProgramUniformMatrix3dv mg_gl_get_api()->ProgramUniformMatrix3dv -#define glVertexAttribL3dv mg_gl_get_api()->VertexAttribL3dv -#define glProgramUniform3i mg_gl_get_api()->ProgramUniform3i -#define glClearStencil mg_gl_get_api()->ClearStencil -#define glSamplerParameterIiv mg_gl_get_api()->SamplerParameterIiv -#define glGetVertexAttribIuiv mg_gl_get_api()->GetVertexAttribIuiv -#define glGetInteger64i_v mg_gl_get_api()->GetInteger64i_v -#define glUniform2d mg_gl_get_api()->Uniform2d -#define glUniformMatrix3dv mg_gl_get_api()->UniformMatrix3dv -#define glProgramUniform3ui mg_gl_get_api()->ProgramUniform3ui -#define glDrawElementsInstanced mg_gl_get_api()->DrawElementsInstanced -#define glUniformMatrix3x2dv mg_gl_get_api()->UniformMatrix3x2dv -#define glClearDepth mg_gl_get_api()->ClearDepth -#define glEndQueryIndexed mg_gl_get_api()->EndQueryIndexed -#define glUniformMatrix4x3fv mg_gl_get_api()->UniformMatrix4x3fv -#define glProgramBinary mg_gl_get_api()->ProgramBinary -#define glGetFragDataIndex mg_gl_get_api()->GetFragDataIndex -#define glVertexAttrib4Nsv mg_gl_get_api()->VertexAttrib4Nsv -#define glDeleteRenderbuffers mg_gl_get_api()->DeleteRenderbuffers -#define glUniformMatrix2x3dv mg_gl_get_api()->UniformMatrix2x3dv -#define glUniform4ui mg_gl_get_api()->Uniform4ui -#define glGenTextures mg_gl_get_api()->GenTextures -#define glProgramUniform3f mg_gl_get_api()->ProgramUniform3f -#define glUniform2uiv mg_gl_get_api()->Uniform2uiv -#define glClientWaitSync mg_gl_get_api()->ClientWaitSync -#define glGetTexImage mg_gl_get_api()->GetTexImage -#define glVertexAttrib4sv mg_gl_get_api()->VertexAttrib4sv -#define glDrawElementsInstancedBaseVertexBaseInstance mg_gl_get_api()->DrawElementsInstancedBaseVertexBaseInstance -#define glUniform1dv mg_gl_get_api()->Uniform1dv -#define glViewportIndexedfv mg_gl_get_api()->ViewportIndexedfv -#define glVertexAttrib1f mg_gl_get_api()->VertexAttrib1f -#define glGetGraphicsResetStatus mg_gl_get_api()->GetGraphicsResetStatus -#define glUniform4fv mg_gl_get_api()->Uniform4fv -#define glVertexAttrib4dv mg_gl_get_api()->VertexAttrib4dv -#define glBeginTransformFeedback mg_gl_get_api()->BeginTransformFeedback -#endif // __GL_API_H__ +/******************************************************** +* +* @file: gl_api.h +* @note: auto-generated by glapi.py from gl.xml +* @date: 12/072023 +* +*********************************************************/ +#ifndef __GL_API_H__ +#define __GL_API_H__ + +#include"GL/glcorearb.h" +#include"GLES3/gl32.h" + +typedef struct mg_gl_api +{ + PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv; + PFNGLCLEARDEPTHPROC ClearDepth; + PFNGLSAMPLERPARAMETERIVPROC SamplerParameteriv; + PFNGLUNIFORMSUBROUTINESUIVPROC UniformSubroutinesuiv; + PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv; + PFNGLINVALIDATEBUFFERSUBDATAPROC InvalidateBufferSubData; + PFNGLACTIVESHADERPROGRAMPROC ActiveShaderProgram; + PFNGLGENPROGRAMPIPELINESPROC GenProgramPipelines; + PFNGLUNIFORMMATRIX4X3FVPROC UniformMatrix4x3fv; + PFNGLVERTEXATTRIB1FVPROC VertexAttrib1fv; + PFNGLGETSAMPLERPARAMETERIVPROC GetSamplerParameteriv; + PFNGLLOGICOPPROC LogicOp; + PFNGLCLEARBUFFERDATAPROC ClearBufferData; + PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC DrawElementsInstancedBaseVertex; + PFNGLTEXSTORAGE2DMULTISAMPLEPROC TexStorage2DMultisample; + PFNGLPROGRAMUNIFORM2IPROC ProgramUniform2i; + PFNGLSTENCILMASKSEPARATEPROC StencilMaskSeparate; + PFNGLVERTEXATTRIB1DPROC VertexAttrib1d; + PFNGLBLENDEQUATIONSEPARATEIPROC BlendEquationSeparatei; + PFNGLVERTEXATTRIB2FVPROC VertexAttrib2fv; + PFNGLVERTEXATTRIBI2UIVPROC VertexAttribI2uiv; + PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv; + PFNGLVERTEXATTRIBL2DPROC VertexAttribL2d; + PFNGLBINDBUFFERPROC BindBuffer; + PFNGLBLENDFUNCPROC BlendFunc; + PFNGLDELETEQUERIESPROC DeleteQueries; + PFNGLGETPROGRAMBINARYPROC GetProgramBinary; + PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate; + PFNGLGETUNIFORMSUBROUTINEUIVPROC GetUniformSubroutineuiv; + PFNGLBINDPROGRAMPIPELINEPROC BindProgramPipeline; + PFNGLGENSAMPLERSPROC GenSamplers; + PFNGLGETOBJECTPTRLABELPROC GetObjectPtrLabel; + PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv; + PFNGLGETTEXPARAMETERIUIVPROC GetTexParameterIuiv; + PFNGLPROGRAMUNIFORMMATRIX3FVPROC ProgramUniformMatrix3fv; + PFNGLCOPYTEXIMAGE2DPROC CopyTexImage2D; + PFNGLGETSHADERIVPROC GetShaderiv; + PFNGLCLEARBUFFERUIVPROC ClearBufferuiv; + PFNGLVERTEXATTRIBP1UIVPROC VertexAttribP1uiv; + PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC ProgramUniformMatrix3x4fv; + PFNGLMEMORYBARRIERPROC MemoryBarrier; + PFNGLVERTEXATTRIBL1DVPROC VertexAttribL1dv; + PFNGLUNIFORMBLOCKBINDINGPROC UniformBlockBinding; + PFNGLBINDTEXTURESPROC BindTextures; + PFNGLBLENDFUNCIPROC BlendFunci; + PFNGLVERTEXATTRIBL3DVPROC VertexAttribL3dv; + PFNGLTEXSTORAGE1DPROC TexStorage1D; + PFNGLUNIFORM1DPROC Uniform1d; + PFNGLUNIFORMMATRIX2X4DVPROC UniformMatrix2x4dv; + PFNGLPROGRAMUNIFORM1IPROC ProgramUniform1i; + PFNGLQUERYCOUNTERPROC QueryCounter; + PFNGLGETDEBUGMESSAGELOGPROC GetDebugMessageLog; + PFNGLGETMULTISAMPLEFVPROC GetMultisamplefv; + PFNGLGETFRAGDATALOCATIONPROC GetFragDataLocation; + PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus; + PFNGLISFRAMEBUFFERPROC IsFramebuffer; + PFNGLTEXSTORAGE3DPROC TexStorage3D; + PFNGLVERTEXATTRIBIFORMATPROC VertexAttribIFormat; + PFNGLVERTEXATTRIB4NUBPROC VertexAttrib4Nub; + PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv; + PFNGLUNIFORMMATRIX3X4FVPROC UniformMatrix3x4fv; + PFNGLGETBUFFERSUBDATAPROC GetBufferSubData; + PFNGLUNIFORM2IVPROC Uniform2iv; + PFNGLISENABLEDIPROC IsEnabledi; + PFNGLGETPROGRAMRESOURCELOCATIONPROC GetProgramResourceLocation; + PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D; + PFNGLCOPYTEXSUBIMAGE2DPROC CopyTexSubImage2D; + PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC ProgramUniformMatrix4x3dv; + PFNGLVIEWPORTINDEXEDFVPROC ViewportIndexedfv; + PFNGLENABLEIPROC Enablei; + PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC ProgramUniformMatrix4x2dv; + PFNGLPROGRAMUNIFORM4IPROC ProgramUniform4i; + PFNGLGETSYNCIVPROC GetSynciv; + PFNGLGENRENDERBUFFERSPROC GenRenderbuffers; + PFNGLSAMPLERPARAMETERIUIVPROC SamplerParameterIuiv; + PFNGLPROGRAMUNIFORM3IPROC ProgramUniform3i; + PFNGLUNIFORM3IVPROC Uniform3iv; + PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv; + PFNGLPROVOKINGVERTEXPROC ProvokingVertex; + PFNGLPOPDEBUGGROUPPROC PopDebugGroup; + PFNGLTEXSUBIMAGE2DPROC TexSubImage2D; + PFNGLBINDBUFFERSRANGEPROC BindBuffersRange; + PFNGLUNIFORMMATRIX3DVPROC UniformMatrix3dv; + PFNGLPROGRAMUNIFORM1UIPROC ProgramUniform1ui; + PFNGLCREATESHADERPROGRAMVPROC CreateShaderProgramv; + PFNGLDISPATCHCOMPUTEINDIRECTPROC DispatchComputeIndirect; + PFNGLCLEARTEXIMAGEPROC ClearTexImage; + PFNGLVERTEXATTRIBP1UIPROC VertexAttribP1ui; + PFNGLSAMPLEMASKIPROC SampleMaski; + PFNGLUNIFORM4IPROC Uniform4i; + PFNGLCOPYTEXIMAGE1DPROC CopyTexImage1D; + PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC GetSubroutineUniformLocation; + PFNGLGETGRAPHICSRESETSTATUSPROC GetGraphicsResetStatus; + PFNGLPOLYGONMODEPROC PolygonMode; + PFNGLUNIFORM4FVPROC Uniform4fv; + PFNGLPUSHDEBUGGROUPPROC PushDebugGroup; + PFNGLMULTIDRAWARRAYSINDIRECTPROC MultiDrawArraysIndirect; + PFNGLCREATEPROGRAMPROC CreateProgram; + PFNGLSCISSORINDEXEDVPROC ScissorIndexedv; + PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D; + PFNGLPROGRAMUNIFORMMATRIX3DVPROC ProgramUniformMatrix3dv; + PFNGLSHADERSOURCEPROC ShaderSource; + PFNGLUNIFORM2FPROC Uniform2f; + PFNGLBUFFERSUBDATAPROC BufferSubData; + PFNGLBINDSAMPLERSPROC BindSamplers; + PFNGLCLEARTEXSUBIMAGEPROC ClearTexSubImage; + PFNGLBLENDCOLORPROC BlendColor; + PFNGLBINDVERTEXARRAYPROC BindVertexArray; + PFNGLCLEARBUFFERFVPROC ClearBufferfv; + PFNGLTEXSUBIMAGE1DPROC TexSubImage1D; + PFNGLVERTEXATTRIBI1UIPROC VertexAttribI1ui; + PFNGLGETBOOLEANI_VPROC GetBooleani_v; + PFNGLGETACTIVEUNIFORMSIVPROC GetActiveUniformsiv; + PFNGLUNIFORM2UIVPROC Uniform2uiv; + PFNGLGETSUBROUTINEINDEXPROC GetSubroutineIndex; + PFNGLBEGINCONDITIONALRENDERPROC BeginConditionalRender; + PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC GetFramebufferAttachmentParameteriv; + PFNGLVERTEXATTRIBI4UIVPROC VertexAttribI4uiv; + PFNGLVIEWPORTARRAYVPROC ViewportArrayv; + PFNGLUNIFORM3FPROC Uniform3f; + PFNGLVERTEXATTRIB4DPROC VertexAttrib4d; + PFNGLGETQUERYIVPROC GetQueryiv; + PFNGLCOPYBUFFERSUBDATAPROC CopyBufferSubData; + PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC DrawTransformFeedbackStream; + PFNGLGETPOINTERVPROC GetPointerv; + PFNGLVERTEXATTRIBPOINTERPROC VertexAttribPointer; + PFNGLGETACTIVEUNIFORMPROC GetActiveUniform; + PFNGLUNIFORM3UIVPROC Uniform3uiv; + PFNGLGETBUFFERPARAMETERI64VPROC GetBufferParameteri64v; + PFNGLTEXIMAGE1DPROC TexImage1D; + PFNGLPROGRAMUNIFORMMATRIX2FVPROC ProgramUniformMatrix2fv; + PFNGLDRAWTRANSFORMFEEDBACKPROC DrawTransformFeedback; + PFNGLTEXTUREVIEWPROC TextureView; + PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv; + PFNGLGETPROGRAMINFOLOGPROC GetProgramInfoLog; + PFNGLVERTEXATTRIBLPOINTERPROC VertexAttribLPointer; + PFNGLPROGRAMUNIFORM4IVPROC ProgramUniform4iv; + PFNGLSAMPLERPARAMETERFPROC SamplerParameterf; + PFNGLGETTEXPARAMETERFVPROC GetTexParameterfv; + PFNGLGETUNIFORMFVPROC GetUniformfv; + PFNGLSCISSORARRAYVPROC ScissorArrayv; + PFNGLDEBUGMESSAGEINSERTPROC DebugMessageInsert; + PFNGLDRAWELEMENTSINSTANCEDPROC DrawElementsInstanced; + PFNGLGETDOUBLEVPROC GetDoublev; + PFNGLGETINTEGER64VPROC GetInteger64v; + PFNGLDRAWARRAYSINDIRECTPROC DrawArraysIndirect; + PFNGLLINEWIDTHPROC LineWidth; + PFNGLVERTEXATTRIB2SPROC VertexAttrib2s; + PFNGLGETBOOLEANVPROC GetBooleanv; + PFNGLTRANSFORMFEEDBACKVARYINGSPROC TransformFeedbackVaryings; + PFNGLGETTEXLEVELPARAMETERFVPROC GetTexLevelParameterfv; + PFNGLCOPYTEXSUBIMAGE3DPROC CopyTexSubImage3D; + PFNGLVIEWPORTINDEXEDFPROC ViewportIndexedf; + PFNGLSCISSORPROC Scissor; + PFNGLTEXPARAMETERIIVPROC TexParameterIiv; + PFNGLINVALIDATETEXIMAGEPROC InvalidateTexImage; + PFNGLBEGINTRANSFORMFEEDBACKPROC BeginTransformFeedback; + PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC DrawTransformFeedbackStreamInstanced; + PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv; + PFNGLUNIFORMMATRIX2DVPROC UniformMatrix2dv; + PFNGLCOLORMASKPROC ColorMask; + PFNGLTEXIMAGE2DMULTISAMPLEPROC TexImage2DMultisample; + PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D; + PFNGLGETVERTEXATTRIBIIVPROC GetVertexAttribIiv; + PFNGLVERTEXATTRIBL3DPROC VertexAttribL3d; + PFNGLVERTEXATTRIB1FPROC VertexAttrib1f; + PFNGLGETTRANSFORMFEEDBACKVARYINGPROC GetTransformFeedbackVarying; + PFNGLISSHADERPROC IsShader; + PFNGLCLEARBUFFERFIPROC ClearBufferfi; + PFNGLVALIDATEPROGRAMPROC ValidateProgram; + PFNGLPROGRAMUNIFORM2FPROC ProgramUniform2f; + PFNGLGETNUNIFORMFVPROC GetnUniformfv; + PFNGLTEXIMAGE3DMULTISAMPLEPROC TexImage3DMultisample; + PFNGLFRONTFACEPROC FrontFace; + PFNGLVERTEXATTRIBI2IVPROC VertexAttribI2iv; + PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage; + PFNGLPROGRAMUNIFORM4DVPROC ProgramUniform4dv; + PFNGLGETSHADERSOURCEPROC GetShaderSource; + PFNGLGETVERTEXATTRIBDVPROC GetVertexAttribdv; + PFNGLPRIMITIVERESTARTINDEXPROC PrimitiveRestartIndex; + PFNGLUNMAPBUFFERPROC UnmapBuffer; + PFNGLVERTEXATTRIBP2UIVPROC VertexAttribP2uiv; + PFNGLGETBUFFERPARAMETERIVPROC GetBufferParameteriv; + PFNGLUNIFORMMATRIX2X3FVPROC UniformMatrix2x3fv; + PFNGLDEBUGMESSAGECONTROLPROC DebugMessageControl; + PFNGLPIXELSTOREFPROC PixelStoref; + PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC ProgramUniformMatrix3x2fv; + PFNGLGETNUNIFORMIVPROC GetnUniformiv; + PFNGLGETINTEGERI_VPROC GetIntegeri_v; + PFNGLVERTEXATTRIBL4DPROC VertexAttribL4d; + PFNGLREADNPIXELSPROC ReadnPixels; + PFNGLUSEPROGRAMPROC UseProgram; + PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC GetActiveSubroutineUniformiv; + PFNGLDISABLEPROC Disable; + PFNGLCULLFACEPROC CullFace; + PFNGLGETVERTEXATTRIBIVPROC GetVertexAttribiv; + PFNGLVERTEXATTRIBI4IVPROC VertexAttribI4iv; + PFNGLVIEWPORTPROC Viewport; + PFNGLATTACHSHADERPROC AttachShader; + PFNGLPROGRAMBINARYPROC ProgramBinary; + PFNGLDEPTHRANGEPROC DepthRange; + PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC ProgramUniformMatrix3x2dv; + PFNGLPROGRAMUNIFORM3DVPROC ProgramUniform3dv; + PFNGLFRAMEBUFFERPARAMETERIPROC FramebufferParameteri; + PFNGLDRAWBUFFERSPROC DrawBuffers; + PFNGLVERTEXATTRIBI3IPROC VertexAttribI3i; + PFNGLVERTEXATTRIBL1DPROC VertexAttribL1d; + PFNGLBLENDBARRIERPROC BlendBarrier; + PFNGLGETVERTEXATTRIBPOINTERVPROC GetVertexAttribPointerv; + PFNGLUNIFORM4UIVPROC Uniform4uiv; + PFNGLBEGINQUERYPROC BeginQuery; + PFNGLENDCONDITIONALRENDERPROC EndConditionalRender; + PFNGLSHADERSTORAGEBLOCKBINDINGPROC ShaderStorageBlockBinding; + PFNGLGETVERTEXATTRIBIUIVPROC GetVertexAttribIuiv; + PFNGLBINDBUFFERRANGEPROC BindBufferRange; + PFNGLCOPYTEXSUBIMAGE1DPROC CopyTexSubImage1D; + PFNGLVERTEXATTRIB3SPROC VertexAttrib3s; + PFNGLMAPBUFFERRANGEPROC MapBufferRange; + PFNGLPROGRAMUNIFORM4UIPROC ProgramUniform4ui; + PFNGLINVALIDATESUBFRAMEBUFFERPROC InvalidateSubFramebuffer; + PFNGLSCISSORINDEXEDPROC ScissorIndexed; + PFNGLDELETESYNCPROC DeleteSync; + PFNGLVERTEXATTRIBP4UIVPROC VertexAttribP4uiv; + PFNGLENABLEVERTEXATTRIBARRAYPROC EnableVertexAttribArray; + PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D; + PFNGLGETUNIFORMDVPROC GetUniformdv; + PFNGLHINTPROC Hint; + PFNGLFINISHPROC Finish; + PFNGLSAMPLERPARAMETERIPROC SamplerParameteri; + PFNGLISVERTEXARRAYPROC IsVertexArray; + PFNGLBLENDEQUATIONPROC BlendEquation; + PFNGLUNIFORM2DPROC Uniform2d; + PFNGLISSYNCPROC IsSync; + PFNGLVERTEXATTRIBL4DVPROC VertexAttribL4dv; + PFNGLUNIFORMMATRIX4X2FVPROC UniformMatrix4x2fv; + PFNGLVERTEXATTRIBI2IPROC VertexAttribI2i; + PFNGLGETATTRIBLOCATIONPROC GetAttribLocation; + PFNGLVERTEXATTRIB3DPROC VertexAttrib3d; + PFNGLVERTEXATTRIBP3UIVPROC VertexAttribP3uiv; + PFNGLGETFLOATVPROC GetFloatv; + PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer; + PFNGLGENFRAMEBUFFERSPROC GenFramebuffers; + PFNGLVERTEXATTRIB4SPROC VertexAttrib4s; + PFNGLVERTEXATTRIBL2DVPROC VertexAttribL2dv; + PFNGLUNIFORMMATRIX4X3DVPROC UniformMatrix4x3dv; + PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC GetActiveUniformBlockName; + PFNGLCOMPILESHADERPROC CompileShader; + PFNGLDEPTHMASKPROC DepthMask; + PFNGLVERTEXATTRIBIPOINTERPROC VertexAttribIPointer; + PFNGLDEPTHRANGEINDEXEDPROC DepthRangeIndexed; + PFNGLPROGRAMUNIFORMMATRIX4DVPROC ProgramUniformMatrix4dv; + PFNGLUNIFORM3UIPROC Uniform3ui; + PFNGLGETSAMPLERPARAMETERFVPROC GetSamplerParameterfv; + PFNGLREADBUFFERPROC ReadBuffer; + PFNGLVERTEXATTRIB2FPROC VertexAttrib2f; + PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv; + PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv; + PFNGLUNIFORM3FVPROC Uniform3fv; + PFNGLGETBUFFERPOINTERVPROC GetBufferPointerv; + PFNGLGETPROGRAMPIPELINEINFOLOGPROC GetProgramPipelineInfoLog; + PFNGLUNIFORM2FVPROC Uniform2fv; + PFNGLGETERRORPROC GetError; + PFNGLPROGRAMUNIFORMMATRIX2DVPROC ProgramUniformMatrix2dv; + PFNGLISENABLEDPROC IsEnabled; + PFNGLUNIFORM4FPROC Uniform4f; + PFNGLDRAWARRAYSINSTANCEDPROC DrawArraysInstanced; + PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D; + PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC ProgramUniformMatrix2x4dv; + PFNGLVERTEXATTRIB3FPROC VertexAttrib3f; + PFNGLVERTEXATTRIBI1IPROC VertexAttribI1i; + PFNGLPOINTPARAMETERFVPROC PointParameterfv; + PFNGLBINDTEXTUREPROC BindTexture; + PFNGLPROGRAMUNIFORM2FVPROC ProgramUniform2fv; + PFNGLBINDVERTEXBUFFERSPROC BindVertexBuffers; + PFNGLISTRANSFORMFEEDBACKPROC IsTransformFeedback; + PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC ProgramUniformMatrix2x3dv; + PFNGLBEGINQUERYINDEXEDPROC BeginQueryIndexed; + PFNGLSAMPLECOVERAGEPROC SampleCoverage; + PFNGLDEPTHFUNCPROC DepthFunc; + PFNGLGENBUFFERSPROC GenBuffers; + PFNGLOBJECTLABELPROC ObjectLabel; + PFNGLUNIFORM1FVPROC Uniform1fv; + PFNGLUNIFORM4UIPROC Uniform4ui; + PFNGLBINDSAMPLERPROC BindSampler; + PFNGLDRAWARRAYSPROC DrawArrays; + PFNGLDELETESHADERPROC DeleteShader; + PFNGLMULTIDRAWARRAYSPROC MultiDrawArrays; + PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC ProgramUniformMatrix2x3fv; + PFNGLPROGRAMUNIFORM2UIPROC ProgramUniform2ui; + PFNGLBUFFERSTORAGEPROC BufferStorage; + PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC ProgramUniformMatrix4x2fv; + PFNGLDRAWELEMENTSBASEVERTEXPROC DrawElementsBaseVertex; + PFNGLPROGRAMUNIFORM3FVPROC ProgramUniform3fv; + PFNGLCOLORMASKIPROC ColorMaski; + PFNGLGETQUERYOBJECTUI64VPROC GetQueryObjectui64v; + PFNGLGENVERTEXARRAYSPROC GenVertexArrays; + PFNGLUNIFORMMATRIX3X4DVPROC UniformMatrix3x4dv; + PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers; + PFNGLPROGRAMUNIFORM3UIVPROC ProgramUniform3uiv; + PFNGLUNIFORM2DVPROC Uniform2dv; + PFNGLGETDOUBLEI_VPROC GetDoublei_v; + PFNGLUNIFORM3IPROC Uniform3i; + PFNGLVERTEXATTRIBP2UIPROC VertexAttribP2ui; + PFNGLGETINTEGERVPROC GetIntegerv; + PFNGLCLAMPCOLORPROC ClampColor; + PFNGLTEXSTORAGE3DMULTISAMPLEPROC TexStorage3DMultisample; + PFNGLCLEARBUFFERSUBDATAPROC ClearBufferSubData; + PFNGLCOPYIMAGESUBDATAPROC CopyImageSubData; + PFNGLPAUSETRANSFORMFEEDBACKPROC PauseTransformFeedback; + PFNGLUNIFORM3DVPROC Uniform3dv; + PFNGLPROGRAMUNIFORM1DPROC ProgramUniform1d; + PFNGLGETTEXPARAMETERIIVPROC GetTexParameterIiv; + PFNGLTEXPARAMETERFVPROC TexParameterfv; + PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC ProgramUniformMatrix3x4dv; + PFNGLGETFRAMEBUFFERPARAMETERIVPROC GetFramebufferParameteriv; + PFNGLGENQUERIESPROC GenQueries; + PFNGLDELETEBUFFERSPROC DeleteBuffers; + PFNGLUNIFORM1IPROC Uniform1i; + PFNGLPROGRAMUNIFORM4FVPROC ProgramUniform4fv; + PFNGLPROGRAMUNIFORM4FPROC ProgramUniform4f; + PFNGLSHADERBINARYPROC ShaderBinary; + PFNGLTEXPARAMETERFPROC TexParameterf; + PFNGLUNIFORMMATRIX3X2FVPROC UniformMatrix3x2fv; + PFNGLGETTEXIMAGEPROC GetTexImage; + PFNGLPROGRAMUNIFORMMATRIX4FVPROC ProgramUniformMatrix4fv; + PFNGLVERTEXATTRIB4FPROC VertexAttrib4f; + PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate; + PFNGLGETVERTEXATTRIBFVPROC GetVertexAttribfv; + PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv; + PFNGLCLEARDEPTHFPROC ClearDepthf; + PFNGLINVALIDATEFRAMEBUFFERPROC InvalidateFramebuffer; + PFNGLPIXELSTOREIPROC PixelStorei; + PFNGLACTIVETEXTUREPROC ActiveTexture; + PFNGLISPROGRAMPIPELINEPROC IsProgramPipeline; + PFNGLUNIFORM4IVPROC Uniform4iv; + PFNGLBINDATTRIBLOCATIONPROC BindAttribLocation; + PFNGLGETVERTEXATTRIBLDVPROC GetVertexAttribLdv; + PFNGLGETPROGRAMRESOURCENAMEPROC GetProgramResourceName; + PFNGLGETINTEGER64I_VPROC GetInteger64i_v; + PFNGLPATCHPARAMETERFVPROC PatchParameterfv; + PFNGLUNIFORM1DVPROC Uniform1dv; + PFNGLVERTEXATTRIBI1IVPROC VertexAttribI1iv; + PFNGLVERTEXATTRIBI3UIVPROC VertexAttribI3uiv; + PFNGLVERTEXATTRIBI4UBVPROC VertexAttribI4ubv; + PFNGLUSEPROGRAMSTAGESPROC UseProgramStages; + PFNGLISRENDERBUFFERPROC IsRenderbuffer; + PFNGLBINDFRAGDATALOCATIONPROC BindFragDataLocation; + PFNGLUNIFORM1UIPROC Uniform1ui; + PFNGLSTENCILMASKPROC StencilMask; + PFNGLGETSHADERPRECISIONFORMATPROC GetShaderPrecisionFormat; + PFNGLBINDIMAGETEXTUREPROC BindImageTexture; + PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv; + PFNGLPROGRAMUNIFORM1IVPROC ProgramUniform1iv; + PFNGLGETACTIVESUBROUTINENAMEPROC GetActiveSubroutineName; + PFNGLGETFLOATI_VPROC GetFloati_v; + PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample; + PFNGLGETSHADERINFOLOGPROC GetShaderInfoLog; + PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC DrawElementsInstancedBaseInstance; + PFNGLVERTEXATTRIBP4UIPROC VertexAttribP4ui; + PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv; + PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC GetActiveSubroutineUniformName; + PFNGLUNIFORM1UIVPROC Uniform1uiv; + PFNGLUNIFORMMATRIX4X2DVPROC UniformMatrix4x2dv; + PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv; + PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv; + PFNGLDELETETEXTURESPROC DeleteTextures; + PFNGLGENERATEMIPMAPPROC GenerateMipmap; + PFNGLGENTRANSFORMFEEDBACKSPROC GenTransformFeedbacks; + PFNGLWAITSYNCPROC WaitSync; + PFNGLUNIFORM2UIPROC Uniform2ui; + PFNGLBLENDEQUATIONIPROC BlendEquationi; + PFNGLBUFFERDATAPROC BufferData; + PFNGLGETUNIFORMINDICESPROC GetUniformIndices; + PFNGLVERTEXATTRIB4FVPROC VertexAttrib4fv; + PFNGLRESUMETRANSFORMFEEDBACKPROC ResumeTransformFeedback; + PFNGLBINDTRANSFORMFEEDBACKPROC BindTransformFeedback; + PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv; + PFNGLLINKPROGRAMPROC LinkProgram; + PFNGLTEXIMAGE3DPROC TexImage3D; + PFNGLCLEARPROC Clear; + PFNGLVERTEXATTRIB3FVPROC VertexAttrib3fv; + PFNGLFENCESYNCPROC FenceSync; + PFNGLGETACTIVEATTRIBPROC GetActiveAttrib; + PFNGLREADPIXELSPROC ReadPixels; + PFNGLPROGRAMUNIFORM2DPROC ProgramUniform2d; + PFNGLGETSAMPLERPARAMETERIIVPROC GetSamplerParameterIiv; + PFNGLGETPROGRAMSTAGEIVPROC GetProgramStageiv; + PFNGLRELEASESHADERCOMPILERPROC ReleaseShaderCompiler; + PFNGLVERTEXATTRIBI4USVPROC VertexAttribI4usv; + PFNGLGETUNIFORMUIVPROC GetUniformuiv; + PFNGLPROGRAMUNIFORM1DVPROC ProgramUniform1dv; + PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer; + PFNGLPROGRAMUNIFORM3FPROC ProgramUniform3f; + PFNGLPROGRAMUNIFORM3UIPROC ProgramUniform3ui; + PFNGLDELETEPROGRAMPROC DeleteProgram; + PFNGLPOLYGONOFFSETPROC PolygonOffset; + PFNGLSAMPLERPARAMETERIIVPROC SamplerParameterIiv; + PFNGLUNIFORMMATRIX3X2DVPROC UniformMatrix3x2dv; + PFNGLUNIFORM4DVPROC Uniform4dv; + PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays; + PFNGLGETPROGRAMRESOURCEIVPROC GetProgramResourceiv; + PFNGLUNIFORMMATRIX2X4FVPROC UniformMatrix2x4fv; + PFNGLGETINTERNALFORMATI64VPROC GetInternalformati64v; + PFNGLPOINTPARAMETERIVPROC PointParameteriv; + PFNGLVERTEXATTRIBI4SVPROC VertexAttribI4sv; + PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC DrawTransformFeedbackInstanced; + PFNGLGETATTACHEDSHADERSPROC GetAttachedShaders; + PFNGLVERTEXATTRIBI3IVPROC VertexAttribI3iv; + PFNGLTEXPARAMETERIUIVPROC TexParameterIuiv; + PFNGLVERTEXATTRIBBINDINGPROC VertexAttribBinding; + PFNGLMULTIDRAWELEMENTSPROC MultiDrawElements; + PFNGLTEXBUFFERPROC TexBuffer; + PFNGLGETSTRINGPROC GetString; + PFNGLGETNUNIFORMUIVPROC GetnUniformuiv; + PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC DrawElementsInstancedBaseVertexBaseInstance; + PFNGLGETUNIFORMIVPROC GetUniformiv; + PFNGLDELETEPROGRAMPIPELINESPROC DeleteProgramPipelines; + PFNGLVERTEXATTRIBI2UIPROC VertexAttribI2ui; + PFNGLPROGRAMUNIFORM2DVPROC ProgramUniform2dv; + PFNGLTEXBUFFERRANGEPROC TexBufferRange; + PFNGLTEXPARAMETERIPROC TexParameteri; + PFNGLBINDBUFFERSBASEPROC BindBuffersBase; + PFNGLVERTEXATTRIB2DPROC VertexAttrib2d; + PFNGLCREATESHADERPROC CreateShader; + PFNGLBINDVERTEXBUFFERPROC BindVertexBuffer; + PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D; + PFNGLDEPTHRANGEARRAYVPROC DepthRangeArrayv; + PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv; + PFNGLUNIFORMMATRIX4FVPROC UniformMatrix4fv; + PFNGLCLEARSTENCILPROC ClearStencil; + PFNGLBINDBUFFERBASEPROC BindBufferBase; + PFNGLINVALIDATETEXSUBIMAGEPROC InvalidateTexSubImage; + PFNGLOBJECTPTRLABELPROC ObjectPtrLabel; + PFNGLMINSAMPLESHADINGPROC MinSampleShading; + PFNGLENABLEPROC Enable; + PFNGLINVALIDATEBUFFERDATAPROC InvalidateBufferData; + PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC ProgramUniformMatrix2x4fv; + PFNGLVERTEXATTRIBLFORMATPROC VertexAttribLFormat; + PFNGLMULTIDRAWELEMENTSINDIRECTPROC MultiDrawElementsIndirect; + PFNGLGETOBJECTLABELPROC GetObjectLabel; + PFNGLVERTEXATTRIBI3UIPROC VertexAttribI3ui; + PFNGLFLUSHMAPPEDBUFFERRANGEPROC FlushMappedBufferRange; + PFNGLGETUNIFORMBLOCKINDEXPROC GetUniformBlockIndex; + PFNGLGETUNIFORMLOCATIONPROC GetUniformLocation; + PFNGLGETQUERYOBJECTI64VPROC GetQueryObjecti64v; + PFNGLPROGRAMUNIFORM1UIVPROC ProgramUniform1uiv; + PFNGLISSAMPLERPROC IsSampler; + PFNGLPROGRAMUNIFORM4UIVPROC ProgramUniform4uiv; + PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv; + PFNGLVERTEXATTRIBI4UIPROC VertexAttribI4ui; + PFNGLTEXSUBIMAGE3DPROC TexSubImage3D; + PFNGLFRAMEBUFFERTEXTUREPROC FramebufferTexture; + PFNGLPOINTPARAMETERFPROC PointParameterf; + PFNGLGETINTERNALFORMATIVPROC GetInternalformativ; + PFNGLGETACTIVEUNIFORMBLOCKIVPROC GetActiveUniformBlockiv; + PFNGLDETACHSHADERPROC DetachShader; + PFNGLUNIFORM2IPROC Uniform2i; + PFNGLPROGRAMPARAMETERIPROC ProgramParameteri; + PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv; + PFNGLSAMPLERPARAMETERFVPROC SamplerParameterfv; + PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv; + PFNGLCLEARCOLORPROC ClearColor; + PFNGLTEXPARAMETERIVPROC TexParameteriv; + PFNGLUNIFORM3DPROC Uniform3d; + PFNGLENDTRANSFORMFEEDBACKPROC EndTransformFeedback; + PFNGLDRAWELEMENTSPROC DrawElements; + PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv; + PFNGLMAPBUFFERPROC MapBuffer; + PFNGLGETPROGRAMIVPROC GetProgramiv; + PFNGLPROGRAMUNIFORM2UIVPROC ProgramUniform2uiv; + PFNGLUNIFORMMATRIX4DVPROC UniformMatrix4dv; + PFNGLPROGRAMUNIFORM1FVPROC ProgramUniform1fv; + PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC DrawArraysInstancedBaseInstance; + PFNGLGETQUERYINDEXEDIVPROC GetQueryIndexediv; + PFNGLSTENCILFUNCPROC StencilFunc; + PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC GetActiveAtomicCounterBufferiv; + PFNGLSTENCILFUNCSEPARATEPROC StencilFuncSeparate; + PFNGLSTENCILOPPROC StencilOp; + PFNGLVERTEXATTRIBDIVISORPROC VertexAttribDivisor; + PFNGLDEBUGMESSAGECALLBACKPROC DebugMessageCallback; + PFNGLVERTEXATTRIBP3UIPROC VertexAttribP3ui; + PFNGLBINDFRAMEBUFFERPROC BindFramebuffer; + PFNGLISPROGRAMPROC IsProgram; + PFNGLPROGRAMUNIFORM2IVPROC ProgramUniform2iv; + PFNGLDELETESAMPLERSPROC DeleteSamplers; + PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D; + PFNGLFLUSHPROC Flush; + PFNGLDEPTHRANGEFPROC DepthRangef; + PFNGLMEMORYBARRIERBYREGIONPROC MemoryBarrierByRegion; + PFNGLGETACTIVEUNIFORMNAMEPROC GetActiveUniformName; + PFNGLGETPROGRAMINTERFACEIVPROC GetProgramInterfaceiv; + PFNGLDISABLEIPROC Disablei; + PFNGLISTEXTUREPROC IsTexture; + PFNGLUNIFORMMATRIX2X3DVPROC UniformMatrix2x3dv; + PFNGLBLENDFUNCSEPARATEIPROC BlendFuncSeparatei; + PFNGLDISABLEVERTEXATTRIBARRAYPROC DisableVertexAttribArray; + PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D; + PFNGLISQUERYPROC IsQuery; + PFNGLTEXIMAGE2DPROC TexImage2D; + PFNGLUNIFORM1FPROC Uniform1f; + PFNGLBINDRENDERBUFFERPROC BindRenderbuffer; + PFNGLBINDFRAGDATALOCATIONINDEXEDPROC BindFragDataLocationIndexed; + PFNGLVERTEXATTRIBI4BVPROC VertexAttribI4bv; + PFNGLVERTEXATTRIB1SPROC VertexAttrib1s; + PFNGLGETCOMPRESSEDTEXIMAGEPROC GetCompressedTexImage; + PFNGLUNIFORMMATRIX3FVPROC UniformMatrix3fv; + PFNGLSTENCILOPSEPARATEPROC StencilOpSeparate; + PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC ProgramUniformMatrix4x3fv; + PFNGLGETSTRINGIPROC GetStringi; + PFNGLDISPATCHCOMPUTEPROC DispatchCompute; + PFNGLPOINTPARAMETERIPROC PointParameteri; + PFNGLBINDIMAGETEXTURESPROC BindImageTextures; + PFNGLDELETETRANSFORMFEEDBACKSPROC DeleteTransformFeedbacks; + PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC DrawRangeElementsBaseVertex; + PFNGLPROGRAMUNIFORM4DPROC ProgramUniform4d; + PFNGLVERTEXATTRIBI4IPROC VertexAttribI4i; + PFNGLDRAWBUFFERPROC DrawBuffer; + PFNGLTEXSTORAGE2DPROC TexStorage2D; + PFNGLVERTEXATTRIBFORMATPROC VertexAttribFormat; + PFNGLENDQUERYPROC EndQuery; + PFNGLPATCHPARAMETERIPROC PatchParameteri; + PFNGLCLEARBUFFERIVPROC ClearBufferiv; + PFNGLENDQUERYINDEXEDPROC EndQueryIndexed; + PFNGLPOINTSIZEPROC PointSize; + PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv; + PFNGLUNIFORM4DPROC Uniform4d; + PFNGLGENTEXTURESPROC GenTextures; + PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC GetProgramResourceLocationIndex; + PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC MultiDrawElementsBaseVertex; + PFNGLPROGRAMUNIFORM3DPROC ProgramUniform3d; + PFNGLGETFRAGDATAINDEXPROC GetFragDataIndex; + PFNGLCLIENTWAITSYNCPROC ClientWaitSync; + PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers; + PFNGLPROGRAMUNIFORM3IVPROC ProgramUniform3iv; + PFNGLDRAWELEMENTSINDIRECTPROC DrawElementsIndirect; + PFNGLPRIMITIVEBOUNDINGBOXPROC PrimitiveBoundingBox; + PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D; + PFNGLDRAWRANGEELEMENTSPROC DrawRangeElements; + PFNGLUNIFORM1IVPROC Uniform1iv; + PFNGLGETSAMPLERPARAMETERIUIVPROC GetSamplerParameterIuiv; + PFNGLVALIDATEPROGRAMPIPELINEPROC ValidateProgramPipeline; + PFNGLGETPROGRAMRESOURCEINDEXPROC GetProgramResourceIndex; + PFNGLVERTEXATTRIBI1UIVPROC VertexAttribI1uiv; + PFNGLGETTEXLEVELPARAMETERIVPROC GetTexLevelParameteriv; + PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer; + PFNGLVERTEXBINDINGDIVISORPROC VertexBindingDivisor; + PFNGLGETPROGRAMPIPELINEIVPROC GetProgramPipelineiv; + PFNGLPROGRAMUNIFORM1FPROC ProgramUniform1f; + PFNGLISBUFFERPROC IsBuffer; + PFNGLGETTEXPARAMETERIVPROC GetTexParameteriv; + PFNGLUNIFORMMATRIX2FVPROC UniformMatrix2fv; +} mg_gl_api; + +MP_API mg_gl_api* mg_gl_get_api(void); + +#define glVertexAttrib4Nbv mg_gl_get_api()->VertexAttrib4Nbv +#define glClearDepth mg_gl_get_api()->ClearDepth +#define glSamplerParameteriv mg_gl_get_api()->SamplerParameteriv +#define glUniformSubroutinesuiv mg_gl_get_api()->UniformSubroutinesuiv +#define glVertexAttrib3sv mg_gl_get_api()->VertexAttrib3sv +#define glInvalidateBufferSubData mg_gl_get_api()->InvalidateBufferSubData +#define glActiveShaderProgram mg_gl_get_api()->ActiveShaderProgram +#define glGenProgramPipelines mg_gl_get_api()->GenProgramPipelines +#define glUniformMatrix4x3fv mg_gl_get_api()->UniformMatrix4x3fv +#define glVertexAttrib1fv mg_gl_get_api()->VertexAttrib1fv +#define glGetSamplerParameteriv mg_gl_get_api()->GetSamplerParameteriv +#define glLogicOp mg_gl_get_api()->LogicOp +#define glClearBufferData mg_gl_get_api()->ClearBufferData +#define glDrawElementsInstancedBaseVertex mg_gl_get_api()->DrawElementsInstancedBaseVertex +#define glTexStorage2DMultisample mg_gl_get_api()->TexStorage2DMultisample +#define glProgramUniform2i mg_gl_get_api()->ProgramUniform2i +#define glStencilMaskSeparate mg_gl_get_api()->StencilMaskSeparate +#define glVertexAttrib1d mg_gl_get_api()->VertexAttrib1d +#define glBlendEquationSeparatei mg_gl_get_api()->BlendEquationSeparatei +#define glVertexAttrib2fv mg_gl_get_api()->VertexAttrib2fv +#define glVertexAttribI2uiv mg_gl_get_api()->VertexAttribI2uiv +#define glVertexAttrib4usv mg_gl_get_api()->VertexAttrib4usv +#define glVertexAttribL2d mg_gl_get_api()->VertexAttribL2d +#define glBindBuffer mg_gl_get_api()->BindBuffer +#define glBlendFunc mg_gl_get_api()->BlendFunc +#define glDeleteQueries mg_gl_get_api()->DeleteQueries +#define glGetProgramBinary mg_gl_get_api()->GetProgramBinary +#define glBlendEquationSeparate mg_gl_get_api()->BlendEquationSeparate +#define glGetUniformSubroutineuiv mg_gl_get_api()->GetUniformSubroutineuiv +#define glBindProgramPipeline mg_gl_get_api()->BindProgramPipeline +#define glGenSamplers mg_gl_get_api()->GenSamplers +#define glGetObjectPtrLabel mg_gl_get_api()->GetObjectPtrLabel +#define glGetRenderbufferParameteriv mg_gl_get_api()->GetRenderbufferParameteriv +#define glGetTexParameterIuiv mg_gl_get_api()->GetTexParameterIuiv +#define glProgramUniformMatrix3fv mg_gl_get_api()->ProgramUniformMatrix3fv +#define glCopyTexImage2D mg_gl_get_api()->CopyTexImage2D +#define glGetShaderiv mg_gl_get_api()->GetShaderiv +#define glClearBufferuiv mg_gl_get_api()->ClearBufferuiv +#define glVertexAttribP1uiv mg_gl_get_api()->VertexAttribP1uiv +#define glProgramUniformMatrix3x4fv mg_gl_get_api()->ProgramUniformMatrix3x4fv +#define glMemoryBarrier mg_gl_get_api()->MemoryBarrier +#define glVertexAttribL1dv mg_gl_get_api()->VertexAttribL1dv +#define glUniformBlockBinding mg_gl_get_api()->UniformBlockBinding +#define glBindTextures mg_gl_get_api()->BindTextures +#define glBlendFunci mg_gl_get_api()->BlendFunci +#define glVertexAttribL3dv mg_gl_get_api()->VertexAttribL3dv +#define glTexStorage1D mg_gl_get_api()->TexStorage1D +#define glUniform1d mg_gl_get_api()->Uniform1d +#define glUniformMatrix2x4dv mg_gl_get_api()->UniformMatrix2x4dv +#define glProgramUniform1i mg_gl_get_api()->ProgramUniform1i +#define glQueryCounter mg_gl_get_api()->QueryCounter +#define glGetDebugMessageLog mg_gl_get_api()->GetDebugMessageLog +#define glGetMultisamplefv mg_gl_get_api()->GetMultisamplefv +#define glGetFragDataLocation mg_gl_get_api()->GetFragDataLocation +#define glCheckFramebufferStatus mg_gl_get_api()->CheckFramebufferStatus +#define glIsFramebuffer mg_gl_get_api()->IsFramebuffer +#define glTexStorage3D mg_gl_get_api()->TexStorage3D +#define glVertexAttribIFormat mg_gl_get_api()->VertexAttribIFormat +#define glVertexAttrib4Nub mg_gl_get_api()->VertexAttrib4Nub +#define glVertexAttrib4Niv mg_gl_get_api()->VertexAttrib4Niv +#define glUniformMatrix3x4fv mg_gl_get_api()->UniformMatrix3x4fv +#define glGetBufferSubData mg_gl_get_api()->GetBufferSubData +#define glUniform2iv mg_gl_get_api()->Uniform2iv +#define glIsEnabledi mg_gl_get_api()->IsEnabledi +#define glGetProgramResourceLocation mg_gl_get_api()->GetProgramResourceLocation +#define glCompressedTexImage3D mg_gl_get_api()->CompressedTexImage3D +#define glCopyTexSubImage2D mg_gl_get_api()->CopyTexSubImage2D +#define glProgramUniformMatrix4x3dv mg_gl_get_api()->ProgramUniformMatrix4x3dv +#define glViewportIndexedfv mg_gl_get_api()->ViewportIndexedfv +#define glEnablei mg_gl_get_api()->Enablei +#define glProgramUniformMatrix4x2dv mg_gl_get_api()->ProgramUniformMatrix4x2dv +#define glProgramUniform4i mg_gl_get_api()->ProgramUniform4i +#define glGetSynciv mg_gl_get_api()->GetSynciv +#define glGenRenderbuffers mg_gl_get_api()->GenRenderbuffers +#define glSamplerParameterIuiv mg_gl_get_api()->SamplerParameterIuiv +#define glProgramUniform3i mg_gl_get_api()->ProgramUniform3i +#define glUniform3iv mg_gl_get_api()->Uniform3iv +#define glVertexAttrib1sv mg_gl_get_api()->VertexAttrib1sv +#define glProvokingVertex mg_gl_get_api()->ProvokingVertex +#define glPopDebugGroup mg_gl_get_api()->PopDebugGroup +#define glTexSubImage2D mg_gl_get_api()->TexSubImage2D +#define glBindBuffersRange mg_gl_get_api()->BindBuffersRange +#define glUniformMatrix3dv mg_gl_get_api()->UniformMatrix3dv +#define glProgramUniform1ui mg_gl_get_api()->ProgramUniform1ui +#define glCreateShaderProgramv mg_gl_get_api()->CreateShaderProgramv +#define glDispatchComputeIndirect mg_gl_get_api()->DispatchComputeIndirect +#define glClearTexImage mg_gl_get_api()->ClearTexImage +#define glVertexAttribP1ui mg_gl_get_api()->VertexAttribP1ui +#define glSampleMaski mg_gl_get_api()->SampleMaski +#define glUniform4i mg_gl_get_api()->Uniform4i +#define glCopyTexImage1D mg_gl_get_api()->CopyTexImage1D +#define glGetSubroutineUniformLocation mg_gl_get_api()->GetSubroutineUniformLocation +#define glGetGraphicsResetStatus mg_gl_get_api()->GetGraphicsResetStatus +#define glPolygonMode mg_gl_get_api()->PolygonMode +#define glUniform4fv mg_gl_get_api()->Uniform4fv +#define glPushDebugGroup mg_gl_get_api()->PushDebugGroup +#define glMultiDrawArraysIndirect mg_gl_get_api()->MultiDrawArraysIndirect +#define glCreateProgram mg_gl_get_api()->CreateProgram +#define glScissorIndexedv mg_gl_get_api()->ScissorIndexedv +#define glFramebufferTexture1D mg_gl_get_api()->FramebufferTexture1D +#define glProgramUniformMatrix3dv mg_gl_get_api()->ProgramUniformMatrix3dv +#define glShaderSource mg_gl_get_api()->ShaderSource +#define glUniform2f mg_gl_get_api()->Uniform2f +#define glBufferSubData mg_gl_get_api()->BufferSubData +#define glBindSamplers mg_gl_get_api()->BindSamplers +#define glClearTexSubImage mg_gl_get_api()->ClearTexSubImage +#define glBlendColor mg_gl_get_api()->BlendColor +#define glBindVertexArray mg_gl_get_api()->BindVertexArray +#define glClearBufferfv mg_gl_get_api()->ClearBufferfv +#define glTexSubImage1D mg_gl_get_api()->TexSubImage1D +#define glVertexAttribI1ui mg_gl_get_api()->VertexAttribI1ui +#define glGetBooleani_v mg_gl_get_api()->GetBooleani_v +#define glGetActiveUniformsiv mg_gl_get_api()->GetActiveUniformsiv +#define glUniform2uiv mg_gl_get_api()->Uniform2uiv +#define glGetSubroutineIndex mg_gl_get_api()->GetSubroutineIndex +#define glBeginConditionalRender mg_gl_get_api()->BeginConditionalRender +#define glGetFramebufferAttachmentParameteriv mg_gl_get_api()->GetFramebufferAttachmentParameteriv +#define glVertexAttribI4uiv mg_gl_get_api()->VertexAttribI4uiv +#define glViewportArrayv mg_gl_get_api()->ViewportArrayv +#define glUniform3f mg_gl_get_api()->Uniform3f +#define glVertexAttrib4d mg_gl_get_api()->VertexAttrib4d +#define glGetQueryiv mg_gl_get_api()->GetQueryiv +#define glCopyBufferSubData mg_gl_get_api()->CopyBufferSubData +#define glDrawTransformFeedbackStream mg_gl_get_api()->DrawTransformFeedbackStream +#define glGetPointerv mg_gl_get_api()->GetPointerv +#define glVertexAttribPointer mg_gl_get_api()->VertexAttribPointer +#define glGetActiveUniform mg_gl_get_api()->GetActiveUniform +#define glUniform3uiv mg_gl_get_api()->Uniform3uiv +#define glGetBufferParameteri64v mg_gl_get_api()->GetBufferParameteri64v +#define glTexImage1D mg_gl_get_api()->TexImage1D +#define glProgramUniformMatrix2fv mg_gl_get_api()->ProgramUniformMatrix2fv +#define glDrawTransformFeedback mg_gl_get_api()->DrawTransformFeedback +#define glTextureView mg_gl_get_api()->TextureView +#define glVertexAttrib4sv mg_gl_get_api()->VertexAttrib4sv +#define glGetProgramInfoLog mg_gl_get_api()->GetProgramInfoLog +#define glVertexAttribLPointer mg_gl_get_api()->VertexAttribLPointer +#define glProgramUniform4iv mg_gl_get_api()->ProgramUniform4iv +#define glSamplerParameterf mg_gl_get_api()->SamplerParameterf +#define glGetTexParameterfv mg_gl_get_api()->GetTexParameterfv +#define glGetUniformfv mg_gl_get_api()->GetUniformfv +#define glScissorArrayv mg_gl_get_api()->ScissorArrayv +#define glDebugMessageInsert mg_gl_get_api()->DebugMessageInsert +#define glDrawElementsInstanced mg_gl_get_api()->DrawElementsInstanced +#define glGetDoublev mg_gl_get_api()->GetDoublev +#define glGetInteger64v mg_gl_get_api()->GetInteger64v +#define glDrawArraysIndirect mg_gl_get_api()->DrawArraysIndirect +#define glLineWidth mg_gl_get_api()->LineWidth +#define glVertexAttrib2s mg_gl_get_api()->VertexAttrib2s +#define glGetBooleanv mg_gl_get_api()->GetBooleanv +#define glTransformFeedbackVaryings mg_gl_get_api()->TransformFeedbackVaryings +#define glGetTexLevelParameterfv mg_gl_get_api()->GetTexLevelParameterfv +#define glCopyTexSubImage3D mg_gl_get_api()->CopyTexSubImage3D +#define glViewportIndexedf mg_gl_get_api()->ViewportIndexedf +#define glScissor mg_gl_get_api()->Scissor +#define glTexParameterIiv mg_gl_get_api()->TexParameterIiv +#define glInvalidateTexImage mg_gl_get_api()->InvalidateTexImage +#define glBeginTransformFeedback mg_gl_get_api()->BeginTransformFeedback +#define glDrawTransformFeedbackStreamInstanced mg_gl_get_api()->DrawTransformFeedbackStreamInstanced +#define glGetQueryObjectuiv mg_gl_get_api()->GetQueryObjectuiv +#define glUniformMatrix2dv mg_gl_get_api()->UniformMatrix2dv +#define glColorMask mg_gl_get_api()->ColorMask +#define glTexImage2DMultisample mg_gl_get_api()->TexImage2DMultisample +#define glFramebufferTexture3D mg_gl_get_api()->FramebufferTexture3D +#define glGetVertexAttribIiv mg_gl_get_api()->GetVertexAttribIiv +#define glVertexAttribL3d mg_gl_get_api()->VertexAttribL3d +#define glVertexAttrib1f mg_gl_get_api()->VertexAttrib1f +#define glGetTransformFeedbackVarying mg_gl_get_api()->GetTransformFeedbackVarying +#define glIsShader mg_gl_get_api()->IsShader +#define glClearBufferfi mg_gl_get_api()->ClearBufferfi +#define glValidateProgram mg_gl_get_api()->ValidateProgram +#define glProgramUniform2f mg_gl_get_api()->ProgramUniform2f +#define glGetnUniformfv mg_gl_get_api()->GetnUniformfv +#define glTexImage3DMultisample mg_gl_get_api()->TexImage3DMultisample +#define glFrontFace mg_gl_get_api()->FrontFace +#define glVertexAttribI2iv mg_gl_get_api()->VertexAttribI2iv +#define glRenderbufferStorage mg_gl_get_api()->RenderbufferStorage +#define glProgramUniform4dv mg_gl_get_api()->ProgramUniform4dv +#define glGetShaderSource mg_gl_get_api()->GetShaderSource +#define glGetVertexAttribdv mg_gl_get_api()->GetVertexAttribdv +#define glPrimitiveRestartIndex mg_gl_get_api()->PrimitiveRestartIndex +#define glUnmapBuffer mg_gl_get_api()->UnmapBuffer +#define glVertexAttribP2uiv mg_gl_get_api()->VertexAttribP2uiv +#define glGetBufferParameteriv mg_gl_get_api()->GetBufferParameteriv +#define glUniformMatrix2x3fv mg_gl_get_api()->UniformMatrix2x3fv +#define glDebugMessageControl mg_gl_get_api()->DebugMessageControl +#define glPixelStoref mg_gl_get_api()->PixelStoref +#define glProgramUniformMatrix3x2fv mg_gl_get_api()->ProgramUniformMatrix3x2fv +#define glGetnUniformiv mg_gl_get_api()->GetnUniformiv +#define glGetIntegeri_v mg_gl_get_api()->GetIntegeri_v +#define glVertexAttribL4d mg_gl_get_api()->VertexAttribL4d +#define glReadnPixels mg_gl_get_api()->ReadnPixels +#define glUseProgram mg_gl_get_api()->UseProgram +#define glGetActiveSubroutineUniformiv mg_gl_get_api()->GetActiveSubroutineUniformiv +#define glDisable mg_gl_get_api()->Disable +#define glCullFace mg_gl_get_api()->CullFace +#define glGetVertexAttribiv mg_gl_get_api()->GetVertexAttribiv +#define glVertexAttribI4iv mg_gl_get_api()->VertexAttribI4iv +#define glViewport mg_gl_get_api()->Viewport +#define glAttachShader mg_gl_get_api()->AttachShader +#define glProgramBinary mg_gl_get_api()->ProgramBinary +#define glDepthRange mg_gl_get_api()->DepthRange +#define glProgramUniformMatrix3x2dv mg_gl_get_api()->ProgramUniformMatrix3x2dv +#define glProgramUniform3dv mg_gl_get_api()->ProgramUniform3dv +#define glFramebufferParameteri mg_gl_get_api()->FramebufferParameteri +#define glDrawBuffers mg_gl_get_api()->DrawBuffers +#define glVertexAttribI3i mg_gl_get_api()->VertexAttribI3i +#define glVertexAttribL1d mg_gl_get_api()->VertexAttribL1d +#define glBlendBarrier mg_gl_get_api()->BlendBarrier +#define glGetVertexAttribPointerv mg_gl_get_api()->GetVertexAttribPointerv +#define glUniform4uiv mg_gl_get_api()->Uniform4uiv +#define glBeginQuery mg_gl_get_api()->BeginQuery +#define glEndConditionalRender mg_gl_get_api()->EndConditionalRender +#define glShaderStorageBlockBinding mg_gl_get_api()->ShaderStorageBlockBinding +#define glGetVertexAttribIuiv mg_gl_get_api()->GetVertexAttribIuiv +#define glBindBufferRange mg_gl_get_api()->BindBufferRange +#define glCopyTexSubImage1D mg_gl_get_api()->CopyTexSubImage1D +#define glVertexAttrib3s mg_gl_get_api()->VertexAttrib3s +#define glMapBufferRange mg_gl_get_api()->MapBufferRange +#define glProgramUniform4ui mg_gl_get_api()->ProgramUniform4ui +#define glInvalidateSubFramebuffer mg_gl_get_api()->InvalidateSubFramebuffer +#define glScissorIndexed mg_gl_get_api()->ScissorIndexed +#define glDeleteSync mg_gl_get_api()->DeleteSync +#define glVertexAttribP4uiv mg_gl_get_api()->VertexAttribP4uiv +#define glEnableVertexAttribArray mg_gl_get_api()->EnableVertexAttribArray +#define glCompressedTexSubImage2D mg_gl_get_api()->CompressedTexSubImage2D +#define glGetUniformdv mg_gl_get_api()->GetUniformdv +#define glHint mg_gl_get_api()->Hint +#define glFinish mg_gl_get_api()->Finish +#define glSamplerParameteri mg_gl_get_api()->SamplerParameteri +#define glIsVertexArray mg_gl_get_api()->IsVertexArray +#define glBlendEquation mg_gl_get_api()->BlendEquation +#define glUniform2d mg_gl_get_api()->Uniform2d +#define glIsSync mg_gl_get_api()->IsSync +#define glVertexAttribL4dv mg_gl_get_api()->VertexAttribL4dv +#define glUniformMatrix4x2fv mg_gl_get_api()->UniformMatrix4x2fv +#define glVertexAttribI2i mg_gl_get_api()->VertexAttribI2i +#define glGetAttribLocation mg_gl_get_api()->GetAttribLocation +#define glVertexAttrib3d mg_gl_get_api()->VertexAttrib3d +#define glVertexAttribP3uiv mg_gl_get_api()->VertexAttribP3uiv +#define glGetFloatv mg_gl_get_api()->GetFloatv +#define glFramebufferRenderbuffer mg_gl_get_api()->FramebufferRenderbuffer +#define glGenFramebuffers mg_gl_get_api()->GenFramebuffers +#define glVertexAttrib4s mg_gl_get_api()->VertexAttrib4s +#define glVertexAttribL2dv mg_gl_get_api()->VertexAttribL2dv +#define glUniformMatrix4x3dv mg_gl_get_api()->UniformMatrix4x3dv +#define glGetActiveUniformBlockName mg_gl_get_api()->GetActiveUniformBlockName +#define glCompileShader mg_gl_get_api()->CompileShader +#define glDepthMask mg_gl_get_api()->DepthMask +#define glVertexAttribIPointer mg_gl_get_api()->VertexAttribIPointer +#define glDepthRangeIndexed mg_gl_get_api()->DepthRangeIndexed +#define glProgramUniformMatrix4dv mg_gl_get_api()->ProgramUniformMatrix4dv +#define glUniform3ui mg_gl_get_api()->Uniform3ui +#define glGetSamplerParameterfv mg_gl_get_api()->GetSamplerParameterfv +#define glReadBuffer mg_gl_get_api()->ReadBuffer +#define glVertexAttrib2f mg_gl_get_api()->VertexAttrib2f +#define glVertexAttrib2sv mg_gl_get_api()->VertexAttrib2sv +#define glVertexAttrib4bv mg_gl_get_api()->VertexAttrib4bv +#define glUniform3fv mg_gl_get_api()->Uniform3fv +#define glGetBufferPointerv mg_gl_get_api()->GetBufferPointerv +#define glGetProgramPipelineInfoLog mg_gl_get_api()->GetProgramPipelineInfoLog +#define glUniform2fv mg_gl_get_api()->Uniform2fv +#define glGetError mg_gl_get_api()->GetError +#define glProgramUniformMatrix2dv mg_gl_get_api()->ProgramUniformMatrix2dv +#define glIsEnabled mg_gl_get_api()->IsEnabled +#define glUniform4f mg_gl_get_api()->Uniform4f +#define glDrawArraysInstanced mg_gl_get_api()->DrawArraysInstanced +#define glCompressedTexImage1D mg_gl_get_api()->CompressedTexImage1D +#define glProgramUniformMatrix2x4dv mg_gl_get_api()->ProgramUniformMatrix2x4dv +#define glVertexAttrib3f mg_gl_get_api()->VertexAttrib3f +#define glVertexAttribI1i mg_gl_get_api()->VertexAttribI1i +#define glPointParameterfv mg_gl_get_api()->PointParameterfv +#define glBindTexture mg_gl_get_api()->BindTexture +#define glProgramUniform2fv mg_gl_get_api()->ProgramUniform2fv +#define glBindVertexBuffers mg_gl_get_api()->BindVertexBuffers +#define glIsTransformFeedback mg_gl_get_api()->IsTransformFeedback +#define glProgramUniformMatrix2x3dv mg_gl_get_api()->ProgramUniformMatrix2x3dv +#define glBeginQueryIndexed mg_gl_get_api()->BeginQueryIndexed +#define glSampleCoverage mg_gl_get_api()->SampleCoverage +#define glDepthFunc mg_gl_get_api()->DepthFunc +#define glGenBuffers mg_gl_get_api()->GenBuffers +#define glObjectLabel mg_gl_get_api()->ObjectLabel +#define glUniform1fv mg_gl_get_api()->Uniform1fv +#define glUniform4ui mg_gl_get_api()->Uniform4ui +#define glBindSampler mg_gl_get_api()->BindSampler +#define glDrawArrays mg_gl_get_api()->DrawArrays +#define glDeleteShader mg_gl_get_api()->DeleteShader +#define glMultiDrawArrays mg_gl_get_api()->MultiDrawArrays +#define glProgramUniformMatrix2x3fv mg_gl_get_api()->ProgramUniformMatrix2x3fv +#define glProgramUniform2ui mg_gl_get_api()->ProgramUniform2ui +#define glBufferStorage mg_gl_get_api()->BufferStorage +#define glProgramUniformMatrix4x2fv mg_gl_get_api()->ProgramUniformMatrix4x2fv +#define glDrawElementsBaseVertex mg_gl_get_api()->DrawElementsBaseVertex +#define glProgramUniform3fv mg_gl_get_api()->ProgramUniform3fv +#define glColorMaski mg_gl_get_api()->ColorMaski +#define glGetQueryObjectui64v mg_gl_get_api()->GetQueryObjectui64v +#define glGenVertexArrays mg_gl_get_api()->GenVertexArrays +#define glUniformMatrix3x4dv mg_gl_get_api()->UniformMatrix3x4dv +#define glDeleteFramebuffers mg_gl_get_api()->DeleteFramebuffers +#define glProgramUniform3uiv mg_gl_get_api()->ProgramUniform3uiv +#define glUniform2dv mg_gl_get_api()->Uniform2dv +#define glGetDoublei_v mg_gl_get_api()->GetDoublei_v +#define glUniform3i mg_gl_get_api()->Uniform3i +#define glVertexAttribP2ui mg_gl_get_api()->VertexAttribP2ui +#define glGetIntegerv mg_gl_get_api()->GetIntegerv +#define glClampColor mg_gl_get_api()->ClampColor +#define glTexStorage3DMultisample mg_gl_get_api()->TexStorage3DMultisample +#define glClearBufferSubData mg_gl_get_api()->ClearBufferSubData +#define glCopyImageSubData mg_gl_get_api()->CopyImageSubData +#define glPauseTransformFeedback mg_gl_get_api()->PauseTransformFeedback +#define glUniform3dv mg_gl_get_api()->Uniform3dv +#define glProgramUniform1d mg_gl_get_api()->ProgramUniform1d +#define glGetTexParameterIiv mg_gl_get_api()->GetTexParameterIiv +#define glTexParameterfv mg_gl_get_api()->TexParameterfv +#define glProgramUniformMatrix3x4dv mg_gl_get_api()->ProgramUniformMatrix3x4dv +#define glGetFramebufferParameteriv mg_gl_get_api()->GetFramebufferParameteriv +#define glGenQueries mg_gl_get_api()->GenQueries +#define glDeleteBuffers mg_gl_get_api()->DeleteBuffers +#define glUniform1i mg_gl_get_api()->Uniform1i +#define glProgramUniform4fv mg_gl_get_api()->ProgramUniform4fv +#define glProgramUniform4f mg_gl_get_api()->ProgramUniform4f +#define glShaderBinary mg_gl_get_api()->ShaderBinary +#define glTexParameterf mg_gl_get_api()->TexParameterf +#define glUniformMatrix3x2fv mg_gl_get_api()->UniformMatrix3x2fv +#define glGetTexImage mg_gl_get_api()->GetTexImage +#define glProgramUniformMatrix4fv mg_gl_get_api()->ProgramUniformMatrix4fv +#define glVertexAttrib4f mg_gl_get_api()->VertexAttrib4f +#define glBlendFuncSeparate mg_gl_get_api()->BlendFuncSeparate +#define glGetVertexAttribfv mg_gl_get_api()->GetVertexAttribfv +#define glVertexAttrib4dv mg_gl_get_api()->VertexAttrib4dv +#define glClearDepthf mg_gl_get_api()->ClearDepthf +#define glInvalidateFramebuffer mg_gl_get_api()->InvalidateFramebuffer +#define glPixelStorei mg_gl_get_api()->PixelStorei +#define glActiveTexture mg_gl_get_api()->ActiveTexture +#define glIsProgramPipeline mg_gl_get_api()->IsProgramPipeline +#define glUniform4iv mg_gl_get_api()->Uniform4iv +#define glBindAttribLocation mg_gl_get_api()->BindAttribLocation +#define glGetVertexAttribLdv mg_gl_get_api()->GetVertexAttribLdv +#define glGetProgramResourceName mg_gl_get_api()->GetProgramResourceName +#define glGetInteger64i_v mg_gl_get_api()->GetInteger64i_v +#define glPatchParameterfv mg_gl_get_api()->PatchParameterfv +#define glUniform1dv mg_gl_get_api()->Uniform1dv +#define glVertexAttribI1iv mg_gl_get_api()->VertexAttribI1iv +#define glVertexAttribI3uiv mg_gl_get_api()->VertexAttribI3uiv +#define glVertexAttribI4ubv mg_gl_get_api()->VertexAttribI4ubv +#define glUseProgramStages mg_gl_get_api()->UseProgramStages +#define glIsRenderbuffer mg_gl_get_api()->IsRenderbuffer +#define glBindFragDataLocation mg_gl_get_api()->BindFragDataLocation +#define glUniform1ui mg_gl_get_api()->Uniform1ui +#define glStencilMask mg_gl_get_api()->StencilMask +#define glGetShaderPrecisionFormat mg_gl_get_api()->GetShaderPrecisionFormat +#define glBindImageTexture mg_gl_get_api()->BindImageTexture +#define glVertexAttrib2dv mg_gl_get_api()->VertexAttrib2dv +#define glProgramUniform1iv mg_gl_get_api()->ProgramUniform1iv +#define glGetActiveSubroutineName mg_gl_get_api()->GetActiveSubroutineName +#define glGetFloati_v mg_gl_get_api()->GetFloati_v +#define glRenderbufferStorageMultisample mg_gl_get_api()->RenderbufferStorageMultisample +#define glGetShaderInfoLog mg_gl_get_api()->GetShaderInfoLog +#define glDrawElementsInstancedBaseInstance mg_gl_get_api()->DrawElementsInstancedBaseInstance +#define glVertexAttribP4ui mg_gl_get_api()->VertexAttribP4ui +#define glVertexAttrib4Nusv mg_gl_get_api()->VertexAttrib4Nusv +#define glGetActiveSubroutineUniformName mg_gl_get_api()->GetActiveSubroutineUniformName +#define glUniform1uiv mg_gl_get_api()->Uniform1uiv +#define glUniformMatrix4x2dv mg_gl_get_api()->UniformMatrix4x2dv +#define glVertexAttrib4Nsv mg_gl_get_api()->VertexAttrib4Nsv +#define glVertexAttrib1dv mg_gl_get_api()->VertexAttrib1dv +#define glDeleteTextures mg_gl_get_api()->DeleteTextures +#define glGenerateMipmap mg_gl_get_api()->GenerateMipmap +#define glGenTransformFeedbacks mg_gl_get_api()->GenTransformFeedbacks +#define glWaitSync mg_gl_get_api()->WaitSync +#define glUniform2ui mg_gl_get_api()->Uniform2ui +#define glBlendEquationi mg_gl_get_api()->BlendEquationi +#define glBufferData mg_gl_get_api()->BufferData +#define glGetUniformIndices mg_gl_get_api()->GetUniformIndices +#define glVertexAttrib4fv mg_gl_get_api()->VertexAttrib4fv +#define glResumeTransformFeedback mg_gl_get_api()->ResumeTransformFeedback +#define glBindTransformFeedback mg_gl_get_api()->BindTransformFeedback +#define glVertexAttrib4iv mg_gl_get_api()->VertexAttrib4iv +#define glLinkProgram mg_gl_get_api()->LinkProgram +#define glTexImage3D mg_gl_get_api()->TexImage3D +#define glClear mg_gl_get_api()->Clear +#define glVertexAttrib3fv mg_gl_get_api()->VertexAttrib3fv +#define glFenceSync mg_gl_get_api()->FenceSync +#define glGetActiveAttrib mg_gl_get_api()->GetActiveAttrib +#define glReadPixels mg_gl_get_api()->ReadPixels +#define glProgramUniform2d mg_gl_get_api()->ProgramUniform2d +#define glGetSamplerParameterIiv mg_gl_get_api()->GetSamplerParameterIiv +#define glGetProgramStageiv mg_gl_get_api()->GetProgramStageiv +#define glReleaseShaderCompiler mg_gl_get_api()->ReleaseShaderCompiler +#define glVertexAttribI4usv mg_gl_get_api()->VertexAttribI4usv +#define glGetUniformuiv mg_gl_get_api()->GetUniformuiv +#define glProgramUniform1dv mg_gl_get_api()->ProgramUniform1dv +#define glFramebufferTextureLayer mg_gl_get_api()->FramebufferTextureLayer +#define glProgramUniform3f mg_gl_get_api()->ProgramUniform3f +#define glProgramUniform3ui mg_gl_get_api()->ProgramUniform3ui +#define glDeleteProgram mg_gl_get_api()->DeleteProgram +#define glPolygonOffset mg_gl_get_api()->PolygonOffset +#define glSamplerParameterIiv mg_gl_get_api()->SamplerParameterIiv +#define glUniformMatrix3x2dv mg_gl_get_api()->UniformMatrix3x2dv +#define glUniform4dv mg_gl_get_api()->Uniform4dv +#define glDeleteVertexArrays mg_gl_get_api()->DeleteVertexArrays +#define glGetProgramResourceiv mg_gl_get_api()->GetProgramResourceiv +#define glUniformMatrix2x4fv mg_gl_get_api()->UniformMatrix2x4fv +#define glGetInternalformati64v mg_gl_get_api()->GetInternalformati64v +#define glPointParameteriv mg_gl_get_api()->PointParameteriv +#define glVertexAttribI4sv mg_gl_get_api()->VertexAttribI4sv +#define glDrawTransformFeedbackInstanced mg_gl_get_api()->DrawTransformFeedbackInstanced +#define glGetAttachedShaders mg_gl_get_api()->GetAttachedShaders +#define glVertexAttribI3iv mg_gl_get_api()->VertexAttribI3iv +#define glTexParameterIuiv mg_gl_get_api()->TexParameterIuiv +#define glVertexAttribBinding mg_gl_get_api()->VertexAttribBinding +#define glMultiDrawElements mg_gl_get_api()->MultiDrawElements +#define glTexBuffer mg_gl_get_api()->TexBuffer +#define glGetString mg_gl_get_api()->GetString +#define glGetnUniformuiv mg_gl_get_api()->GetnUniformuiv +#define glDrawElementsInstancedBaseVertexBaseInstance mg_gl_get_api()->DrawElementsInstancedBaseVertexBaseInstance +#define glGetUniformiv mg_gl_get_api()->GetUniformiv +#define glDeleteProgramPipelines mg_gl_get_api()->DeleteProgramPipelines +#define glVertexAttribI2ui mg_gl_get_api()->VertexAttribI2ui +#define glProgramUniform2dv mg_gl_get_api()->ProgramUniform2dv +#define glTexBufferRange mg_gl_get_api()->TexBufferRange +#define glTexParameteri mg_gl_get_api()->TexParameteri +#define glBindBuffersBase mg_gl_get_api()->BindBuffersBase +#define glVertexAttrib2d mg_gl_get_api()->VertexAttrib2d +#define glCreateShader mg_gl_get_api()->CreateShader +#define glBindVertexBuffer mg_gl_get_api()->BindVertexBuffer +#define glFramebufferTexture2D mg_gl_get_api()->FramebufferTexture2D +#define glDepthRangeArrayv mg_gl_get_api()->DepthRangeArrayv +#define glVertexAttrib4Nuiv mg_gl_get_api()->VertexAttrib4Nuiv +#define glUniformMatrix4fv mg_gl_get_api()->UniformMatrix4fv +#define glClearStencil mg_gl_get_api()->ClearStencil +#define glBindBufferBase mg_gl_get_api()->BindBufferBase +#define glInvalidateTexSubImage mg_gl_get_api()->InvalidateTexSubImage +#define glObjectPtrLabel mg_gl_get_api()->ObjectPtrLabel +#define glMinSampleShading mg_gl_get_api()->MinSampleShading +#define glEnable mg_gl_get_api()->Enable +#define glInvalidateBufferData mg_gl_get_api()->InvalidateBufferData +#define glProgramUniformMatrix2x4fv mg_gl_get_api()->ProgramUniformMatrix2x4fv +#define glVertexAttribLFormat mg_gl_get_api()->VertexAttribLFormat +#define glMultiDrawElementsIndirect mg_gl_get_api()->MultiDrawElementsIndirect +#define glGetObjectLabel mg_gl_get_api()->GetObjectLabel +#define glVertexAttribI3ui mg_gl_get_api()->VertexAttribI3ui +#define glFlushMappedBufferRange mg_gl_get_api()->FlushMappedBufferRange +#define glGetUniformBlockIndex mg_gl_get_api()->GetUniformBlockIndex +#define glGetUniformLocation mg_gl_get_api()->GetUniformLocation +#define glGetQueryObjecti64v mg_gl_get_api()->GetQueryObjecti64v +#define glProgramUniform1uiv mg_gl_get_api()->ProgramUniform1uiv +#define glIsSampler mg_gl_get_api()->IsSampler +#define glProgramUniform4uiv mg_gl_get_api()->ProgramUniform4uiv +#define glVertexAttrib4Nubv mg_gl_get_api()->VertexAttrib4Nubv +#define glVertexAttribI4ui mg_gl_get_api()->VertexAttribI4ui +#define glTexSubImage3D mg_gl_get_api()->TexSubImage3D +#define glFramebufferTexture mg_gl_get_api()->FramebufferTexture +#define glPointParameterf mg_gl_get_api()->PointParameterf +#define glGetInternalformativ mg_gl_get_api()->GetInternalformativ +#define glGetActiveUniformBlockiv mg_gl_get_api()->GetActiveUniformBlockiv +#define glDetachShader mg_gl_get_api()->DetachShader +#define glUniform2i mg_gl_get_api()->Uniform2i +#define glProgramParameteri mg_gl_get_api()->ProgramParameteri +#define glGetQueryObjectiv mg_gl_get_api()->GetQueryObjectiv +#define glSamplerParameterfv mg_gl_get_api()->SamplerParameterfv +#define glVertexAttrib4ubv mg_gl_get_api()->VertexAttrib4ubv +#define glClearColor mg_gl_get_api()->ClearColor +#define glTexParameteriv mg_gl_get_api()->TexParameteriv +#define glUniform3d mg_gl_get_api()->Uniform3d +#define glEndTransformFeedback mg_gl_get_api()->EndTransformFeedback +#define glDrawElements mg_gl_get_api()->DrawElements +#define glVertexAttrib4uiv mg_gl_get_api()->VertexAttrib4uiv +#define glMapBuffer mg_gl_get_api()->MapBuffer +#define glGetProgramiv mg_gl_get_api()->GetProgramiv +#define glProgramUniform2uiv mg_gl_get_api()->ProgramUniform2uiv +#define glUniformMatrix4dv mg_gl_get_api()->UniformMatrix4dv +#define glProgramUniform1fv mg_gl_get_api()->ProgramUniform1fv +#define glDrawArraysInstancedBaseInstance mg_gl_get_api()->DrawArraysInstancedBaseInstance +#define glGetQueryIndexediv mg_gl_get_api()->GetQueryIndexediv +#define glStencilFunc mg_gl_get_api()->StencilFunc +#define glGetActiveAtomicCounterBufferiv mg_gl_get_api()->GetActiveAtomicCounterBufferiv +#define glStencilFuncSeparate mg_gl_get_api()->StencilFuncSeparate +#define glStencilOp mg_gl_get_api()->StencilOp +#define glVertexAttribDivisor mg_gl_get_api()->VertexAttribDivisor +#define glDebugMessageCallback mg_gl_get_api()->DebugMessageCallback +#define glVertexAttribP3ui mg_gl_get_api()->VertexAttribP3ui +#define glBindFramebuffer mg_gl_get_api()->BindFramebuffer +#define glIsProgram mg_gl_get_api()->IsProgram +#define glProgramUniform2iv mg_gl_get_api()->ProgramUniform2iv +#define glDeleteSamplers mg_gl_get_api()->DeleteSamplers +#define glCompressedTexSubImage1D mg_gl_get_api()->CompressedTexSubImage1D +#define glFlush mg_gl_get_api()->Flush +#define glDepthRangef mg_gl_get_api()->DepthRangef +#define glMemoryBarrierByRegion mg_gl_get_api()->MemoryBarrierByRegion +#define glGetActiveUniformName mg_gl_get_api()->GetActiveUniformName +#define glGetProgramInterfaceiv mg_gl_get_api()->GetProgramInterfaceiv +#define glDisablei mg_gl_get_api()->Disablei +#define glIsTexture mg_gl_get_api()->IsTexture +#define glUniformMatrix2x3dv mg_gl_get_api()->UniformMatrix2x3dv +#define glBlendFuncSeparatei mg_gl_get_api()->BlendFuncSeparatei +#define glDisableVertexAttribArray mg_gl_get_api()->DisableVertexAttribArray +#define glCompressedTexImage2D mg_gl_get_api()->CompressedTexImage2D +#define glIsQuery mg_gl_get_api()->IsQuery +#define glTexImage2D mg_gl_get_api()->TexImage2D +#define glUniform1f mg_gl_get_api()->Uniform1f +#define glBindRenderbuffer mg_gl_get_api()->BindRenderbuffer +#define glBindFragDataLocationIndexed mg_gl_get_api()->BindFragDataLocationIndexed +#define glVertexAttribI4bv mg_gl_get_api()->VertexAttribI4bv +#define glVertexAttrib1s mg_gl_get_api()->VertexAttrib1s +#define glGetCompressedTexImage mg_gl_get_api()->GetCompressedTexImage +#define glUniformMatrix3fv mg_gl_get_api()->UniformMatrix3fv +#define glStencilOpSeparate mg_gl_get_api()->StencilOpSeparate +#define glProgramUniformMatrix4x3fv mg_gl_get_api()->ProgramUniformMatrix4x3fv +#define glGetStringi mg_gl_get_api()->GetStringi +#define glDispatchCompute mg_gl_get_api()->DispatchCompute +#define glPointParameteri mg_gl_get_api()->PointParameteri +#define glBindImageTextures mg_gl_get_api()->BindImageTextures +#define glDeleteTransformFeedbacks mg_gl_get_api()->DeleteTransformFeedbacks +#define glDrawRangeElementsBaseVertex mg_gl_get_api()->DrawRangeElementsBaseVertex +#define glProgramUniform4d mg_gl_get_api()->ProgramUniform4d +#define glVertexAttribI4i mg_gl_get_api()->VertexAttribI4i +#define glDrawBuffer mg_gl_get_api()->DrawBuffer +#define glTexStorage2D mg_gl_get_api()->TexStorage2D +#define glVertexAttribFormat mg_gl_get_api()->VertexAttribFormat +#define glEndQuery mg_gl_get_api()->EndQuery +#define glPatchParameteri mg_gl_get_api()->PatchParameteri +#define glClearBufferiv mg_gl_get_api()->ClearBufferiv +#define glEndQueryIndexed mg_gl_get_api()->EndQueryIndexed +#define glPointSize mg_gl_get_api()->PointSize +#define glVertexAttrib3dv mg_gl_get_api()->VertexAttrib3dv +#define glUniform4d mg_gl_get_api()->Uniform4d +#define glGenTextures mg_gl_get_api()->GenTextures +#define glGetProgramResourceLocationIndex mg_gl_get_api()->GetProgramResourceLocationIndex +#define glMultiDrawElementsBaseVertex mg_gl_get_api()->MultiDrawElementsBaseVertex +#define glProgramUniform3d mg_gl_get_api()->ProgramUniform3d +#define glGetFragDataIndex mg_gl_get_api()->GetFragDataIndex +#define glClientWaitSync mg_gl_get_api()->ClientWaitSync +#define glDeleteRenderbuffers mg_gl_get_api()->DeleteRenderbuffers +#define glProgramUniform3iv mg_gl_get_api()->ProgramUniform3iv +#define glDrawElementsIndirect mg_gl_get_api()->DrawElementsIndirect +#define glPrimitiveBoundingBox mg_gl_get_api()->PrimitiveBoundingBox +#define glCompressedTexSubImage3D mg_gl_get_api()->CompressedTexSubImage3D +#define glDrawRangeElements mg_gl_get_api()->DrawRangeElements +#define glUniform1iv mg_gl_get_api()->Uniform1iv +#define glGetSamplerParameterIuiv mg_gl_get_api()->GetSamplerParameterIuiv +#define glValidateProgramPipeline mg_gl_get_api()->ValidateProgramPipeline +#define glGetProgramResourceIndex mg_gl_get_api()->GetProgramResourceIndex +#define glVertexAttribI1uiv mg_gl_get_api()->VertexAttribI1uiv +#define glGetTexLevelParameteriv mg_gl_get_api()->GetTexLevelParameteriv +#define glBlitFramebuffer mg_gl_get_api()->BlitFramebuffer +#define glVertexBindingDivisor mg_gl_get_api()->VertexBindingDivisor +#define glGetProgramPipelineiv mg_gl_get_api()->GetProgramPipelineiv +#define glProgramUniform1f mg_gl_get_api()->ProgramUniform1f +#define glIsBuffer mg_gl_get_api()->IsBuffer +#define glGetTexParameteriv mg_gl_get_api()->GetTexParameteriv +#define glUniformMatrix2fv mg_gl_get_api()->UniformMatrix2fv +#endif // __GL_API_H__ diff --git a/src/gl_canvas.c b/src/gl_canvas.c index 4c0e0cf..93c02b0 100644 --- a/src/gl_canvas.c +++ b/src/gl_canvas.c @@ -98,24 +98,19 @@ typedef struct mg_gl_tile_queue //////////////////////////////////////////////////////////// -typedef struct mg_gl_encoding_context -{ - int glEltCount; - mg_gl_path* pathBufferData; - mg_gl_path_elt* elementBufferData; - int pathIndex; - mg_primitive* primitive; - vec4 pathScreenExtents; - vec4 pathUserExtents; - -} mg_gl_encoding_context; - enum { MG_GL_INPUT_BUFFERS_COUNT = 3, MG_GL_TILE_SIZE = 16, MG_GL_MSAA_COUNT = 8, }; +typedef struct mg_gl_mapped_buffer +{ + GLuint buffer; + int size; + char* contents; +} mg_gl_mapped_buffer; + typedef struct mg_gl_canvas_backend { mg_canvas_backend interface; @@ -134,8 +129,8 @@ typedef struct mg_gl_canvas_backend int bufferIndex; GLsync bufferSync[MG_GL_INPUT_BUFFERS_COUNT]; - GLuint pathBuffer[MG_GL_INPUT_BUFFERS_COUNT]; - GLuint elementBuffer[MG_GL_INPUT_BUFFERS_COUNT]; + mg_gl_mapped_buffer pathBuffer[MG_GL_INPUT_BUFFERS_COUNT]; + mg_gl_mapped_buffer elementBuffer[MG_GL_INPUT_BUFFERS_COUNT]; GLuint segmentBuffer; GLuint segmentCountBuffer; @@ -148,12 +143,21 @@ typedef struct mg_gl_canvas_backend GLuint dummyVertexBuffer; - mg_gl_path* pathBufferData; - mg_gl_path_elt* elementBufferData; - int msaaCount; vec2 frameSize; + //encoding context + int pathCount; + int eltCount; + + ///////////////// + int pathBatchStart; + int eltBatchStart; + + mg_primitive* primitive; + vec4 pathScreenExtents; + vec4 pathUserExtents; + } mg_gl_canvas_backend; static void mg_update_path_extents(vec4* extents, vec2 p) @@ -164,27 +168,28 @@ static void mg_update_path_extents(vec4* extents, vec2 p) extents->w = maximum(extents->w, p.y); } -void mg_gl_canvas_encode_element(mg_gl_encoding_context* context, mg_path_elt_type kind, vec2* p) +void mg_gl_canvas_encode_element(mg_gl_canvas_backend* backend, mg_path_elt_type kind, vec2* p) { - mg_gl_path_elt* glElt = &context->elementBufferData[context->glEltCount]; - context->glEltCount++; + mg_gl_path_elt* elementData = (mg_gl_path_elt*)backend->elementBuffer[backend->bufferIndex].contents; + mg_gl_path_elt* elt = &elementData[backend->eltCount]; + backend->eltCount++; - glElt->pathIndex = context->pathIndex; + elt->pathIndex = backend->pathCount - backend->pathBatchStart; int count = 0; switch(kind) { case MG_PATH_LINE: - glElt->kind = MG_GL_LINE; + elt->kind = MG_GL_LINE; count = 2; break; case MG_PATH_QUADRATIC: - glElt->kind = MG_GL_QUADRATIC; + elt->kind = MG_GL_QUADRATIC; count = 3; break; case MG_PATH_CUBIC: - glElt->kind = MG_GL_CUBIC; + elt->kind = MG_GL_CUBIC; count = 4; break; @@ -194,12 +199,85 @@ void mg_gl_canvas_encode_element(mg_gl_encoding_context* context, mg_path_elt_ty for(int i=0; ipathUserExtents, p[i]); + mg_update_path_extents(&backend->pathUserExtents, p[i]); - vec2 screenP = mg_mat2x3_mul(context->primitive->attributes.transform, p[i]); - glElt->p[i] = (vec2){screenP.x, screenP.y}; + vec2 screenP = mg_mat2x3_mul(backend->primitive->attributes.transform, p[i]); + elt->p[i] = (vec2){screenP.x, screenP.y}; - mg_update_path_extents(&context->pathScreenExtents, screenP); + mg_update_path_extents(&backend->pathScreenExtents, screenP); + } +} + +void mg_gl_canvas_encode_path(mg_gl_canvas_backend* backend, mg_primitive* primitive, f32 scale) +{ + mg_gl_path* pathData = (mg_gl_path*)backend->pathBuffer[backend->bufferIndex].contents; + mg_gl_path* path = &pathData[backend->pathCount]; + backend->pathCount++; + + path->cmd = (mg_gl_cmd)primitive->cmd; + + path->box = (vec4){ + backend->pathScreenExtents.x, + backend->pathScreenExtents.y, + backend->pathScreenExtents.z, + backend->pathScreenExtents.w}; + + path->clip = (vec4){ + primitive->attributes.clip.x, + primitive->attributes.clip.y, + primitive->attributes.clip.x + primitive->attributes.clip.w, + primitive->attributes.clip.y + primitive->attributes.clip.h}; + + path->color = (vec4){ + primitive->attributes.color.r, + primitive->attributes.color.g, + primitive->attributes.color.b, + primitive->attributes.color.a}; + + mp_rect srcRegion = primitive->attributes.srcRegion; + + mp_rect destRegion = { + backend->pathUserExtents.x, + backend->pathUserExtents.y, + backend->pathUserExtents.z - backend->pathUserExtents.x, + backend->pathUserExtents.w - backend->pathUserExtents.y}; + + if(!mg_image_is_nil(primitive->attributes.image)) + { + vec2 texSize = mg_image_size(primitive->attributes.image); + + mg_mat2x3 srcRegionToImage = { + 1/texSize.x, 0, srcRegion.x/texSize.x, + 0, 1/texSize.y, srcRegion.y/texSize.y}; + + mg_mat2x3 destRegionToSrcRegion = { + srcRegion.w/destRegion.w, 0, 0, + 0, srcRegion.h/destRegion.h, 0}; + + mg_mat2x3 userToDestRegion = { + 1, 0, -destRegion.x, + 0, 1, -destRegion.y}; + + mg_mat2x3 screenToUser = mg_mat2x3_inv(primitive->attributes.transform); + + mg_mat2x3 uvTransform = srcRegionToImage; + uvTransform = mg_mat2x3_mul_m(uvTransform, destRegionToSrcRegion); + uvTransform = mg_mat2x3_mul_m(uvTransform, userToDestRegion); + uvTransform = mg_mat2x3_mul_m(uvTransform, screenToUser); + + //NOTE: mat3 std430 layout is an array of vec3, which are padded to _vec4_ alignment + path->uvTransform[0] = uvTransform.m[0]/scale; + path->uvTransform[1] = uvTransform.m[3]/scale; + path->uvTransform[2] = 0; + path->uvTransform[3] = 0; + path->uvTransform[4] = uvTransform.m[1]/scale; + path->uvTransform[5] = uvTransform.m[4]/scale; + path->uvTransform[6] = 0; + path->uvTransform[7] = 0; + path->uvTransform[8] = uvTransform.m[2]; + path->uvTransform[9] = uvTransform.m[5]; + path->uvTransform[10] = 1; + path->uvTransform[11] = 0; } } @@ -391,9 +469,9 @@ void mg_cubic_split(vec2 p[4], f32 t, vec2 outLeft[4], vec2 outRight[4]) outRight[3] = p[3]; } -void mg_gl_encode_stroke_line(mg_gl_encoding_context* context, vec2* p) +void mg_gl_encode_stroke_line(mg_gl_canvas_backend* backend, vec2* p) { - f32 width = context->primitive->attributes.width; + f32 width = backend->primitive->attributes.width; vec2 v = {p[1].x-p[0].x, p[1].y-p[0].y}; vec2 n = {v.y, -v.x}; @@ -405,30 +483,30 @@ void mg_gl_encode_stroke_line(mg_gl_encoding_context* context, vec2* p) vec2 joint0[2] = {vec2_add(p[0], vec2_mul(-1, offset)), vec2_add(p[0], offset)}; vec2 joint1[2] = {vec2_add(p[1], offset), vec2_add(p[1], vec2_mul(-1, offset))}; - mg_gl_canvas_encode_element(context, MG_PATH_LINE, right); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, right); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, left); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, joint0); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, joint1); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, left); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, joint0); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, joint1); } enum { MG_HULL_CHECK_SAMPLE_COUNT = 5 }; -void mg_gl_encode_stroke_quadratic(mg_gl_encoding_context* context, vec2* p) +void mg_gl_encode_stroke_quadratic(mg_gl_canvas_backend* backend, vec2* p) { - f32 width = context->primitive->attributes.width; - f32 tolerance = minimum(context->primitive->attributes.tolerance, 0.5 * width); + f32 width = backend->primitive->attributes.width; + f32 tolerance = minimum(backend->primitive->attributes.tolerance, 0.5 * width); //NOTE: check for degenerate line case const f32 equalEps = 1e-3; if(vec2_close(p[0], p[1], equalEps)) { - mg_gl_encode_stroke_line(context, p+1); + mg_gl_encode_stroke_line(backend, p+1); return; } else if(vec2_close(p[1], p[2], equalEps)) { - mg_gl_encode_stroke_line(context, p); + mg_gl_encode_stroke_line(backend, p); return; } @@ -443,8 +521,8 @@ void mg_gl_encode_stroke_quadratic(mg_gl_encoding_context* context, vec2* p) vec2 splitLeft[3]; vec2 splitRight[3]; mg_quadratic_split(p, 0.5, splitLeft, splitRight); - mg_gl_encode_stroke_quadratic(context, splitLeft); - mg_gl_encode_stroke_quadratic(context, splitRight); + mg_gl_encode_stroke_quadratic(backend, splitLeft); + mg_gl_encode_stroke_quadratic(backend, splitRight); } else { @@ -484,8 +562,8 @@ void mg_gl_encode_stroke_quadratic(mg_gl_encoding_context* context, vec2* p) vec2 splitLeft[3]; vec2 splitRight[3]; mg_quadratic_split(p, maxOvershootParameter, splitLeft, splitRight); - mg_gl_encode_stroke_quadratic(context, splitLeft); - mg_gl_encode_stroke_quadratic(context, splitRight); + mg_gl_encode_stroke_quadratic(backend, splitLeft); + mg_gl_encode_stroke_quadratic(backend, splitRight); } else { @@ -493,21 +571,21 @@ void mg_gl_encode_stroke_quadratic(mg_gl_encoding_context* context, vec2* p) leftHull[0] = leftHull[2]; leftHull[2] = tmp; - mg_gl_canvas_encode_element(context, MG_PATH_QUADRATIC, rightHull); - mg_gl_canvas_encode_element(context, MG_PATH_QUADRATIC, leftHull); + mg_gl_canvas_encode_element(backend, MG_PATH_QUADRATIC, rightHull); + mg_gl_canvas_encode_element(backend, MG_PATH_QUADRATIC, leftHull); vec2 joint0[2] = {rightHull[2], leftHull[0]}; vec2 joint1[2] = {leftHull[2], rightHull[0]}; - mg_gl_canvas_encode_element(context, MG_PATH_LINE, joint0); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, joint1); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, joint0); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, joint1); } } } -void mg_gl_encode_stroke_cubic(mg_gl_encoding_context* context, vec2* p) +void mg_gl_encode_stroke_cubic(mg_gl_canvas_backend* backend, vec2* p) { - f32 width = context->primitive->attributes.width; - f32 tolerance = minimum(context->primitive->attributes.tolerance, 0.5 * width); + f32 width = backend->primitive->attributes.width; + f32 tolerance = minimum(backend->primitive->attributes.tolerance, 0.5 * width); //NOTE: check degenerate line cases f32 equalEps = 1e-3; @@ -517,19 +595,19 @@ void mg_gl_encode_stroke_cubic(mg_gl_encoding_context* context, vec2* p) ||(vec2_close(p[1], p[2], equalEps) && vec2_close(p[2], p[3], equalEps))) { vec2 line[2] = {p[0], p[3]}; - mg_gl_encode_stroke_line(context, line); + mg_gl_encode_stroke_line(backend, line); return; } else if(vec2_close(p[0], p[1], equalEps) && vec2_close(p[1], p[3], equalEps)) { vec2 line[2] = {p[0], vec2_add(vec2_mul(5./9, p[0]), vec2_mul(4./9, p[2]))}; - mg_gl_encode_stroke_line(context, line); + mg_gl_encode_stroke_line(backend, line); return; } else if(vec2_close(p[0], p[2], equalEps) && vec2_close(p[2], p[3], equalEps)) { vec2 line[2] = {p[0], vec2_add(vec2_mul(5./9, p[0]), vec2_mul(4./9, p[1]))}; - mg_gl_encode_stroke_line(context, line); + mg_gl_encode_stroke_line(backend, line); return; } @@ -544,8 +622,8 @@ void mg_gl_encode_stroke_cubic(mg_gl_encoding_context* context, vec2* p) vec2 splitLeft[4]; vec2 splitRight[4]; mg_cubic_split(p, 0.5, splitLeft, splitRight); - mg_gl_encode_stroke_cubic(context, splitLeft); - mg_gl_encode_stroke_cubic(context, splitRight); + mg_gl_encode_stroke_cubic(backend, splitLeft); + mg_gl_encode_stroke_cubic(backend, splitRight); } else { @@ -585,8 +663,8 @@ void mg_gl_encode_stroke_cubic(mg_gl_encoding_context* context, vec2* p) vec2 splitLeft[4]; vec2 splitRight[4]; mg_cubic_split(p, maxOvershootParameter, splitLeft, splitRight); - mg_gl_encode_stroke_cubic(context, splitLeft); - mg_gl_encode_stroke_cubic(context, splitRight); + mg_gl_encode_stroke_cubic(backend, splitLeft); + mg_gl_encode_stroke_cubic(backend, splitRight); } else { @@ -597,18 +675,18 @@ void mg_gl_encode_stroke_cubic(mg_gl_encoding_context* context, vec2* p) leftHull[1] = leftHull[2]; leftHull[2] = tmp; - mg_gl_canvas_encode_element(context, MG_PATH_CUBIC, rightHull); - mg_gl_canvas_encode_element(context, MG_PATH_CUBIC, leftHull); + mg_gl_canvas_encode_element(backend, MG_PATH_CUBIC, rightHull); + mg_gl_canvas_encode_element(backend, MG_PATH_CUBIC, leftHull); vec2 joint0[2] = {rightHull[3], leftHull[0]}; vec2 joint1[2] = {leftHull[3], rightHull[0]}; - mg_gl_canvas_encode_element(context, MG_PATH_LINE, joint0); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, joint1); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, joint0); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, joint1); } } } -void mg_gl_encode_stroke_element(mg_gl_encoding_context* context, +void mg_gl_encode_stroke_element(mg_gl_canvas_backend* backend, mg_path_elt* element, vec2 currentPoint, vec2* startTangent, @@ -621,17 +699,17 @@ void mg_gl_encode_stroke_element(mg_gl_encoding_context* context, switch(element->type) { case MG_PATH_LINE: - mg_gl_encode_stroke_line(context, controlPoints); + mg_gl_encode_stroke_line(backend, controlPoints); endPointIndex = 1; break; case MG_PATH_QUADRATIC: - mg_gl_encode_stroke_quadratic(context, controlPoints); + mg_gl_encode_stroke_quadratic(backend, controlPoints); endPointIndex = 2; break; case MG_PATH_CUBIC: - mg_gl_encode_stroke_cubic(context, controlPoints); + mg_gl_encode_stroke_cubic(backend, controlPoints); endPointIndex = 3; break; @@ -668,11 +746,11 @@ void mg_gl_encode_stroke_element(mg_gl_encoding_context* context, DEBUG_ASSERT(startTangent->x != 0 || startTangent->y != 0); } -void mg_gl_stroke_cap(mg_gl_encoding_context* context, +void mg_gl_stroke_cap(mg_gl_canvas_backend* backend, vec2 p0, vec2 direction) { - mg_attributes* attributes = &context->primitive->attributes; + mg_attributes* attributes = &backend->primitive->attributes; //NOTE(martin): compute the tangent and normal vectors (multiplied by half width) at the cap point f32 dn = sqrt(Square(direction.x) + Square(direction.y)); @@ -690,18 +768,18 @@ void mg_gl_stroke_cap(mg_gl_encoding_context* context, {p0.x - n0.x, p0.y - n0.y}, {p0.x + n0.x, p0.y + n0.y}}; - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points+1); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points+2); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points+3); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points+1); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points+2); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points+3); } -void mg_gl_stroke_joint(mg_gl_encoding_context* context, +void mg_gl_stroke_joint(mg_gl_canvas_backend* backend, vec2 p0, vec2 t0, vec2 t1) { - mg_attributes* attributes = &context->primitive->attributes; + mg_attributes* attributes = &backend->primitive->attributes; //NOTE(martin): compute the normals at the joint point f32 norm_t0 = sqrt(Square(t0.x) + Square(t0.y)); @@ -749,10 +827,10 @@ void mg_gl_stroke_joint(mg_gl_encoding_context* context, {p0.x + n1.x*halfW, p0.y + n1.y*halfW}, p0}; - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points+1); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points+2); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points+3); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points+1); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points+2); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points+3); } else { @@ -762,13 +840,13 @@ void mg_gl_stroke_joint(mg_gl_encoding_context* context, {p0.x + n1.x*halfW, p0.y + n1.y*halfW}, p0}; - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points+1); - mg_gl_canvas_encode_element(context, MG_PATH_LINE, points+2); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points+1); + mg_gl_canvas_encode_element(backend, MG_PATH_LINE, points+2); } } -u32 mg_gl_encode_stroke_subpath(mg_gl_encoding_context* context, +u32 mg_gl_encode_stroke_subpath(mg_gl_canvas_backend* backend, mg_path_elt* elements, mg_path_descriptor* path, u32 startIndex, @@ -785,7 +863,7 @@ u32 mg_gl_encode_stroke_subpath(mg_gl_encoding_context* context, vec2 endTangent = {0, 0}; //NOTE(martin): encode first element and compute first tangent - mg_gl_encode_stroke_element(context, elements + startIndex, currentPoint, &startTangent, &endTangent, &endPoint); + mg_gl_encode_stroke_element(backend, elements + startIndex, currentPoint, &startTangent, &endTangent, &endPoint); firstTangent = startTangent; previousEndTangent = endTangent; @@ -793,18 +871,18 @@ u32 mg_gl_encode_stroke_subpath(mg_gl_encoding_context* context, //NOTE(martin): encode subsequent elements along with their joints - mg_attributes* attributes = &context->primitive->attributes; + mg_attributes* attributes = &backend->primitive->attributes; u32 eltIndex = startIndex + 1; for(; eltIndexjoint != MG_JOINT_NONE) { - mg_gl_stroke_joint(context, currentPoint, previousEndTangent, startTangent); + mg_gl_stroke_joint(backend, currentPoint, previousEndTangent, startTangent); } previousEndTangent = endTangent; currentPoint = endPoint; @@ -819,19 +897,19 @@ u32 mg_gl_encode_stroke_subpath(mg_gl_encoding_context* context, if(attributes->joint != MG_JOINT_NONE) { //NOTE(martin): add a closing joint if the path is closed - mg_gl_stroke_joint(context, endPoint, endTangent, firstTangent); + mg_gl_stroke_joint(backend, endPoint, endTangent, firstTangent); } } else if(attributes->cap == MG_CAP_SQUARE) { //NOTE(martin): add start and end cap - mg_gl_stroke_cap(context, startPoint, (vec2){-startTangent.x, -startTangent.y}); - mg_gl_stroke_cap(context, endPoint, endTangent); + mg_gl_stroke_cap(backend, startPoint, (vec2){-startTangent.x, -startTangent.y}); + mg_gl_stroke_cap(backend, endPoint, endTangent); } return(eltIndex); } -void mg_gl_encode_stroke(mg_gl_encoding_context* context, +void mg_gl_encode_stroke(mg_gl_canvas_backend* backend, mg_path_elt* elements, mg_path_descriptor* path) { @@ -851,15 +929,13 @@ void mg_gl_encode_stroke(mg_gl_encoding_context* context, } if(startIndex < eltCount) { - startIndex = mg_gl_encode_stroke_subpath(context, elements, path, startIndex, startPoint); + startIndex = mg_gl_encode_stroke_subpath(backend, elements, path, startIndex, startPoint); } } } void mg_gl_render_batch(mg_gl_canvas_backend* backend, mg_wgl_surface* surface, - int pathCount, - int eltCount, mg_image_data* image, int tileSize, int nTilesX, @@ -867,15 +943,20 @@ void mg_gl_render_batch(mg_gl_canvas_backend* backend, vec2 viewportSize, f32 scale) { - //NOTE: send the buffers - GLuint pathBuffer = backend->pathBuffer[backend->bufferIndex]; - GLuint elementBuffer = backend->elementBuffer[backend->bufferIndex]; + //NOTE: make the buffers visible to gl + GLuint pathBuffer = backend->pathBuffer[backend->bufferIndex].buffer; + GLuint elementBuffer = backend->elementBuffer[backend->bufferIndex].buffer; + + int pathBufferOffset = backend->pathBatchStart * sizeof(mg_gl_path); + int elementBufferOffset = backend->eltBatchStart * sizeof(mg_gl_path_elt); + int pathCount = backend->pathCount - backend->pathBatchStart; + int eltCount = backend->eltCount - backend->eltBatchStart; glBindBuffer(GL_SHADER_STORAGE_BUFFER, pathBuffer); - glBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, LAYOUT_PATH_SIZE*pathCount, backend->pathBufferData); + glFlushMappedBufferRange(GL_SHADER_STORAGE_BUFFER, pathBufferOffset, pathCount*sizeof(mg_gl_path)); glBindBuffer(GL_SHADER_STORAGE_BUFFER, elementBuffer); - glBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, LAYOUT_PATH_ELT_SIZE*eltCount, backend->elementBufferData); + glFlushMappedBufferRange(GL_SHADER_STORAGE_BUFFER, elementBufferOffset, eltCount*sizeof(mg_gl_path_elt)); //NOTE: clear counters int zero = 0; @@ -907,7 +988,7 @@ void mg_gl_render_batch(mg_gl_canvas_backend* backend, for(int i=0; imerge); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, pathBuffer); + glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, pathBuffer, pathBufferOffset, pathCount*sizeof(mg_gl_path)); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, backend->pathQueueBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, backend->tileQueueBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, backend->tileOpCountBuffer); @@ -988,7 +1069,7 @@ void mg_gl_render_batch(mg_gl_canvas_backend* backend, //NOTE: raster pass glUseProgram(backend->raster); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, pathBuffer); + glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, pathBuffer, pathBufferOffset, pathCount*sizeof(mg_gl_path)); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, backend->segmentBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, backend->tileOpBuffer); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, backend->screenTilesBuffer); @@ -1025,6 +1106,9 @@ void mg_gl_render_batch(mg_gl_canvas_backend* backend, { log_error("gl error %i\n", err); } + + backend->pathBatchStart = backend->pathCount; + backend->eltBatchStart = backend->eltCount; } ///////////////////////////////////////////////////////////////////////// @@ -1074,14 +1158,16 @@ void mg_gl_canvas_render(mg_canvas_backend* interface, glClearColor(clearColor.r, clearColor.g, clearColor.b, clearColor.a); glClear(GL_COLOR_BUFFER_BIT); + backend->pathCount = 0; + backend->pathBatchStart = 0; + backend->eltCount = 0; + backend->eltBatchStart = 0; + //NOTE: encode and render batches - int pathCount = 0; vec2 currentPos = {0}; mg_image currentImage = mg_image_nil(); - mg_gl_encoding_context context = {.glEltCount = 0, - .elementBufferData = backend->elementBufferData, - .pathBufferData = backend->pathBufferData }; + backend->eltCount = 0; for(int primitiveIndex = 0; primitiveIndex < primitiveCount; primitiveIndex++) { @@ -1093,30 +1179,24 @@ void mg_gl_canvas_render(mg_canvas_backend* interface, mg_gl_render_batch(backend, surface, - pathCount, - context.glEltCount, imageData, tileSize, nTilesX, nTilesY, viewportSize, scale); - - pathCount = 0; - context.glEltCount = 0; } currentImage = primitive->attributes.image; if(primitive->path.count) { - context.primitive = primitive; - context.pathIndex = pathCount; - context.pathScreenExtents = (vec4){FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX}; - context.pathUserExtents = (vec4){FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX}; + backend->primitive = primitive; + backend->pathScreenExtents = (vec4){FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX}; + backend->pathUserExtents = (vec4){FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX}; if(primitive->cmd == MG_CMD_STROKE) { - mg_gl_encode_stroke(&context, pathElements + primitive->path.startIndex, &primitive->path); + mg_gl_encode_stroke(backend, pathElements + primitive->path.startIndex, &primitive->path); } else { @@ -1130,7 +1210,7 @@ void mg_gl_canvas_render(mg_canvas_backend* interface, if(elt->type != MG_PATH_MOVE) { vec2 p[4] = {currentPos, elt->p[0], elt->p[1], elt->p[2]}; - mg_gl_canvas_encode_element(&context, elt->type, p); + mg_gl_canvas_encode_element(backend, elt->type, p); segCount++; } switch(elt->type) @@ -1154,75 +1234,13 @@ void mg_gl_canvas_render(mg_canvas_backend* interface, } } //NOTE: push path - mg_gl_path* path = &context.pathBufferData[pathCount]; - pathCount++; - - path->cmd = (mg_gl_cmd)primitive->cmd; - - path->box = (vec4){context.pathScreenExtents.x, - context.pathScreenExtents.y, - context.pathScreenExtents.z, - context.pathScreenExtents.w}; - - path->clip = (vec4){primitive->attributes.clip.x, - primitive->attributes.clip.y, - primitive->attributes.clip.x + primitive->attributes.clip.w, - primitive->attributes.clip.y + primitive->attributes.clip.h}; - - path->color = (vec4){primitive->attributes.color.r, - primitive->attributes.color.g, - primitive->attributes.color.b, - primitive->attributes.color.a}; - - mp_rect srcRegion = primitive->attributes.srcRegion; - - mp_rect destRegion = {context.pathUserExtents.x, - context.pathUserExtents.y, - context.pathUserExtents.z - context.pathUserExtents.x, - context.pathUserExtents.w - context.pathUserExtents.y}; - - if(!mg_image_is_nil(primitive->attributes.image)) - { - vec2 texSize = mg_image_size(primitive->attributes.image); - - mg_mat2x3 srcRegionToImage = {1/texSize.x, 0, srcRegion.x/texSize.x, - 0, 1/texSize.y, srcRegion.y/texSize.y}; - - mg_mat2x3 destRegionToSrcRegion = {srcRegion.w/destRegion.w, 0, 0, - 0, srcRegion.h/destRegion.h, 0}; - - mg_mat2x3 userToDestRegion = {1, 0, -destRegion.x, - 0, 1, -destRegion.y}; - - mg_mat2x3 screenToUser = mg_mat2x3_inv(primitive->attributes.transform); - - mg_mat2x3 uvTransform = srcRegionToImage; - uvTransform = mg_mat2x3_mul_m(uvTransform, destRegionToSrcRegion); - uvTransform = mg_mat2x3_mul_m(uvTransform, userToDestRegion); - uvTransform = mg_mat2x3_mul_m(uvTransform, screenToUser); - - //NOTE: mat3 std430 layout is an array of vec3, which are padded to _vec4_ alignment - path->uvTransform[0] = uvTransform.m[0]/scale; - path->uvTransform[1] = uvTransform.m[3]/scale; - path->uvTransform[2] = 0; - path->uvTransform[3] = 0; - path->uvTransform[4] = uvTransform.m[1]/scale; - path->uvTransform[5] = uvTransform.m[4]/scale; - path->uvTransform[6] = 0; - path->uvTransform[7] = 0; - path->uvTransform[8] = uvTransform.m[2]; - path->uvTransform[9] = uvTransform.m[5]; - path->uvTransform[10] = 1; - path->uvTransform[11] = 0; - } + mg_gl_canvas_encode_path(backend, primitive, scale); } } mg_image_data* imageData = mg_image_data_from_handle(currentImage); mg_gl_render_batch(backend, surface, - pathCount, - context.glEltCount, imageData, tileSize, nTilesX, @@ -1257,7 +1275,7 @@ mg_image_data* mg_gl_canvas_image_create(mg_canvas_backend* interface, vec2 size void mg_gl_canvas_image_destroy(mg_canvas_backend* interface, mg_image_data* imageInterface) { - //TODO: check that this image belongs to this context + //TODO: check that this image belongs to this backend mg_gl_image* image = (mg_gl_image*)imageInterface; glDeleteTextures(1, &image->texture); free(image); @@ -1268,7 +1286,7 @@ void mg_gl_canvas_image_upload_region(mg_canvas_backend* interface, mp_rect region, u8* pixels) { - //TODO: check that this image belongs to this context + //TODO: check that this image belongs to this backend mg_gl_image* image = (mg_gl_image*)imageInterface; glBindTexture(GL_TEXTURE_2D, image->texture); glTexSubImage2D(GL_TEXTURE_2D, 0, region.x, region.y, region.w, region.h, GL_RGBA, GL_UNSIGNED_BYTE, pixels); @@ -1451,13 +1469,27 @@ mg_canvas_backend* gl_canvas_backend_create(mg_wgl_surface* surface) for(int i=0; ipathBuffer[i]); - glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->pathBuffer[i]); - glBufferData(GL_SHADER_STORAGE_BUFFER, MG_GL_PATH_BUFFER_SIZE, 0, GL_STREAM_DRAW); + glGenBuffers(1, &backend->pathBuffer[i].buffer); + glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->pathBuffer[i].buffer); + glBufferStorage(GL_SHADER_STORAGE_BUFFER, MG_GL_PATH_BUFFER_SIZE, 0, GL_MAP_WRITE_BIT|GL_MAP_PERSISTENT_BIT); + backend->pathBuffer[i].size = MG_GL_PATH_BUFFER_SIZE; + backend->pathBuffer[i].contents = glMapBufferRange(GL_SHADER_STORAGE_BUFFER, + 0, + MG_GL_PATH_BUFFER_SIZE, + GL_MAP_WRITE_BIT + |GL_MAP_PERSISTENT_BIT + |GL_MAP_FLUSH_EXPLICIT_BIT); - glGenBuffers(1, &backend->elementBuffer[i]); - glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->elementBuffer[i]); - glBufferData(GL_SHADER_STORAGE_BUFFER, MG_GL_ELEMENT_BUFFER_SIZE, 0, GL_STREAM_DRAW); + glGenBuffers(1, &backend->elementBuffer[i].buffer); + glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->elementBuffer[i].buffer); + glBufferStorage(GL_SHADER_STORAGE_BUFFER, MG_GL_ELEMENT_BUFFER_SIZE, 0, GL_MAP_WRITE_BIT|GL_MAP_PERSISTENT_BIT); + backend->elementBuffer[i].size = MG_GL_ELEMENT_BUFFER_SIZE; + backend->elementBuffer[i].contents = glMapBufferRange(GL_SHADER_STORAGE_BUFFER, + 0, + MG_GL_ELEMENT_BUFFER_SIZE, + GL_MAP_WRITE_BIT + |GL_MAP_PERSISTENT_BIT + |GL_MAP_FLUSH_EXPLICIT_BIT); } glGenBuffers(1, &backend->segmentBuffer); @@ -1496,9 +1528,6 @@ mg_canvas_backend* gl_canvas_backend_create(mg_wgl_surface* surface) glBindBuffer(GL_SHADER_STORAGE_BUFFER, backend->screenTilesBuffer); glBufferData(GL_SHADER_STORAGE_BUFFER, nTilesX*nTilesY*sizeof(int), 0, GL_DYNAMIC_COPY); - backend->pathBufferData = malloc(MG_GL_PATH_BUFFER_SIZE); - backend->elementBufferData = malloc(MG_GL_ELEMENT_BUFFER_SIZE); - if(err) { mg_gl_canvas_destroy((mg_canvas_backend*)backend); diff --git a/src/gl_loader.c b/src/gl_loader.c index dc217f6..da1301d 100644 --- a/src/gl_loader.c +++ b/src/gl_loader.c @@ -1,1723 +1,2274 @@ -/******************************************************** -* -* @file: gl_loader.c -* @note: auto-generated by glapi.py from gl.xml -* @date: 22/022023 -* -*********************************************************/ -#include"gl_loader.h" -#include"platform.h" - -mp_thread_local mg_gl_api* __mgGLAPI = 0; - -void mg_gl_load_gl41(mg_gl_api* api, mg_gl_load_proc loadProc) -{ - api->CullFace = loadProc("glCullFace"); - api->FrontFace = loadProc("glFrontFace"); - api->Hint = loadProc("glHint"); - api->LineWidth = loadProc("glLineWidth"); - api->PointSize = loadProc("glPointSize"); - api->PolygonMode = loadProc("glPolygonMode"); - api->Scissor = loadProc("glScissor"); - api->TexParameterf = loadProc("glTexParameterf"); - api->TexParameterfv = loadProc("glTexParameterfv"); - api->TexParameteri = loadProc("glTexParameteri"); - api->TexParameteriv = loadProc("glTexParameteriv"); - api->TexImage1D = loadProc("glTexImage1D"); - api->TexImage2D = loadProc("glTexImage2D"); - api->DrawBuffer = loadProc("glDrawBuffer"); - api->Clear = loadProc("glClear"); - api->ClearColor = loadProc("glClearColor"); - api->ClearStencil = loadProc("glClearStencil"); - api->ClearDepth = loadProc("glClearDepth"); - api->StencilMask = loadProc("glStencilMask"); - api->ColorMask = loadProc("glColorMask"); - api->DepthMask = loadProc("glDepthMask"); - api->Disable = loadProc("glDisable"); - api->Enable = loadProc("glEnable"); - api->Finish = loadProc("glFinish"); - api->Flush = loadProc("glFlush"); - api->BlendFunc = loadProc("glBlendFunc"); - api->LogicOp = loadProc("glLogicOp"); - api->StencilFunc = loadProc("glStencilFunc"); - api->StencilOp = loadProc("glStencilOp"); - api->DepthFunc = loadProc("glDepthFunc"); - api->PixelStoref = loadProc("glPixelStoref"); - api->PixelStorei = loadProc("glPixelStorei"); - api->ReadBuffer = loadProc("glReadBuffer"); - api->ReadPixels = loadProc("glReadPixels"); - api->GetBooleanv = loadProc("glGetBooleanv"); - api->GetDoublev = loadProc("glGetDoublev"); - api->GetError = loadProc("glGetError"); - api->GetFloatv = loadProc("glGetFloatv"); - api->GetIntegerv = loadProc("glGetIntegerv"); - api->GetString = loadProc("glGetString"); - api->GetTexImage = loadProc("glGetTexImage"); - api->GetTexParameterfv = loadProc("glGetTexParameterfv"); - api->GetTexParameteriv = loadProc("glGetTexParameteriv"); - api->GetTexLevelParameterfv = loadProc("glGetTexLevelParameterfv"); - api->GetTexLevelParameteriv = loadProc("glGetTexLevelParameteriv"); - api->IsEnabled = loadProc("glIsEnabled"); - api->DepthRange = loadProc("glDepthRange"); - api->Viewport = loadProc("glViewport"); - api->DrawArrays = loadProc("glDrawArrays"); - api->DrawElements = loadProc("glDrawElements"); - api->PolygonOffset = loadProc("glPolygonOffset"); - api->CopyTexImage1D = loadProc("glCopyTexImage1D"); - api->CopyTexImage2D = loadProc("glCopyTexImage2D"); - api->CopyTexSubImage1D = loadProc("glCopyTexSubImage1D"); - api->CopyTexSubImage2D = loadProc("glCopyTexSubImage2D"); - api->TexSubImage1D = loadProc("glTexSubImage1D"); - api->TexSubImage2D = loadProc("glTexSubImage2D"); - api->BindTexture = loadProc("glBindTexture"); - api->DeleteTextures = loadProc("glDeleteTextures"); - api->GenTextures = loadProc("glGenTextures"); - api->IsTexture = loadProc("glIsTexture"); - api->DrawRangeElements = loadProc("glDrawRangeElements"); - api->TexImage3D = loadProc("glTexImage3D"); - api->TexSubImage3D = loadProc("glTexSubImage3D"); - api->CopyTexSubImage3D = loadProc("glCopyTexSubImage3D"); - api->ActiveTexture = loadProc("glActiveTexture"); - api->SampleCoverage = loadProc("glSampleCoverage"); - api->CompressedTexImage3D = loadProc("glCompressedTexImage3D"); - api->CompressedTexImage2D = loadProc("glCompressedTexImage2D"); - api->CompressedTexImage1D = loadProc("glCompressedTexImage1D"); - api->CompressedTexSubImage3D = loadProc("glCompressedTexSubImage3D"); - api->CompressedTexSubImage2D = loadProc("glCompressedTexSubImage2D"); - api->CompressedTexSubImage1D = loadProc("glCompressedTexSubImage1D"); - api->GetCompressedTexImage = loadProc("glGetCompressedTexImage"); - api->BlendFuncSeparate = loadProc("glBlendFuncSeparate"); - api->MultiDrawArrays = loadProc("glMultiDrawArrays"); - api->MultiDrawElements = loadProc("glMultiDrawElements"); - api->PointParameterf = loadProc("glPointParameterf"); - api->PointParameterfv = loadProc("glPointParameterfv"); - api->PointParameteri = loadProc("glPointParameteri"); - api->PointParameteriv = loadProc("glPointParameteriv"); - api->BlendColor = loadProc("glBlendColor"); - api->BlendEquation = loadProc("glBlendEquation"); - api->GenQueries = loadProc("glGenQueries"); - api->DeleteQueries = loadProc("glDeleteQueries"); - api->IsQuery = loadProc("glIsQuery"); - api->BeginQuery = loadProc("glBeginQuery"); - api->EndQuery = loadProc("glEndQuery"); - api->GetQueryiv = loadProc("glGetQueryiv"); - api->GetQueryObjectiv = loadProc("glGetQueryObjectiv"); - api->GetQueryObjectuiv = loadProc("glGetQueryObjectuiv"); - api->BindBuffer = loadProc("glBindBuffer"); - api->DeleteBuffers = loadProc("glDeleteBuffers"); - api->GenBuffers = loadProc("glGenBuffers"); - api->IsBuffer = loadProc("glIsBuffer"); - api->BufferData = loadProc("glBufferData"); - api->BufferSubData = loadProc("glBufferSubData"); - api->GetBufferSubData = loadProc("glGetBufferSubData"); - api->MapBuffer = loadProc("glMapBuffer"); - api->UnmapBuffer = loadProc("glUnmapBuffer"); - api->GetBufferParameteriv = loadProc("glGetBufferParameteriv"); - api->GetBufferPointerv = loadProc("glGetBufferPointerv"); - api->BlendEquationSeparate = loadProc("glBlendEquationSeparate"); - api->DrawBuffers = loadProc("glDrawBuffers"); - api->StencilOpSeparate = loadProc("glStencilOpSeparate"); - api->StencilFuncSeparate = loadProc("glStencilFuncSeparate"); - api->StencilMaskSeparate = loadProc("glStencilMaskSeparate"); - api->AttachShader = loadProc("glAttachShader"); - api->BindAttribLocation = loadProc("glBindAttribLocation"); - api->CompileShader = loadProc("glCompileShader"); - api->CreateProgram = loadProc("glCreateProgram"); - api->CreateShader = loadProc("glCreateShader"); - api->DeleteProgram = loadProc("glDeleteProgram"); - api->DeleteShader = loadProc("glDeleteShader"); - api->DetachShader = loadProc("glDetachShader"); - api->DisableVertexAttribArray = loadProc("glDisableVertexAttribArray"); - api->EnableVertexAttribArray = loadProc("glEnableVertexAttribArray"); - api->GetActiveAttrib = loadProc("glGetActiveAttrib"); - api->GetActiveUniform = loadProc("glGetActiveUniform"); - api->GetAttachedShaders = loadProc("glGetAttachedShaders"); - api->GetAttribLocation = loadProc("glGetAttribLocation"); - api->GetProgramiv = loadProc("glGetProgramiv"); - api->GetProgramInfoLog = loadProc("glGetProgramInfoLog"); - api->GetShaderiv = loadProc("glGetShaderiv"); - api->GetShaderInfoLog = loadProc("glGetShaderInfoLog"); - api->GetShaderSource = loadProc("glGetShaderSource"); - api->GetUniformLocation = loadProc("glGetUniformLocation"); - api->GetUniformfv = loadProc("glGetUniformfv"); - api->GetUniformiv = loadProc("glGetUniformiv"); - api->GetVertexAttribdv = loadProc("glGetVertexAttribdv"); - api->GetVertexAttribfv = loadProc("glGetVertexAttribfv"); - api->GetVertexAttribiv = loadProc("glGetVertexAttribiv"); - api->GetVertexAttribPointerv = loadProc("glGetVertexAttribPointerv"); - api->IsProgram = loadProc("glIsProgram"); - api->IsShader = loadProc("glIsShader"); - api->LinkProgram = loadProc("glLinkProgram"); - api->ShaderSource = loadProc("glShaderSource"); - api->UseProgram = loadProc("glUseProgram"); - api->Uniform1f = loadProc("glUniform1f"); - api->Uniform2f = loadProc("glUniform2f"); - api->Uniform3f = loadProc("glUniform3f"); - api->Uniform4f = loadProc("glUniform4f"); - api->Uniform1i = loadProc("glUniform1i"); - api->Uniform2i = loadProc("glUniform2i"); - api->Uniform3i = loadProc("glUniform3i"); - api->Uniform4i = loadProc("glUniform4i"); - api->Uniform1fv = loadProc("glUniform1fv"); - api->Uniform2fv = loadProc("glUniform2fv"); - api->Uniform3fv = loadProc("glUniform3fv"); - api->Uniform4fv = loadProc("glUniform4fv"); - api->Uniform1iv = loadProc("glUniform1iv"); - api->Uniform2iv = loadProc("glUniform2iv"); - api->Uniform3iv = loadProc("glUniform3iv"); - api->Uniform4iv = loadProc("glUniform4iv"); - api->UniformMatrix2fv = loadProc("glUniformMatrix2fv"); - api->UniformMatrix3fv = loadProc("glUniformMatrix3fv"); - api->UniformMatrix4fv = loadProc("glUniformMatrix4fv"); - api->ValidateProgram = loadProc("glValidateProgram"); - api->VertexAttrib1d = loadProc("glVertexAttrib1d"); - api->VertexAttrib1dv = loadProc("glVertexAttrib1dv"); - api->VertexAttrib1f = loadProc("glVertexAttrib1f"); - api->VertexAttrib1fv = loadProc("glVertexAttrib1fv"); - api->VertexAttrib1s = loadProc("glVertexAttrib1s"); - api->VertexAttrib1sv = loadProc("glVertexAttrib1sv"); - api->VertexAttrib2d = loadProc("glVertexAttrib2d"); - api->VertexAttrib2dv = loadProc("glVertexAttrib2dv"); - api->VertexAttrib2f = loadProc("glVertexAttrib2f"); - api->VertexAttrib2fv = loadProc("glVertexAttrib2fv"); - api->VertexAttrib2s = loadProc("glVertexAttrib2s"); - api->VertexAttrib2sv = loadProc("glVertexAttrib2sv"); - api->VertexAttrib3d = loadProc("glVertexAttrib3d"); - api->VertexAttrib3dv = loadProc("glVertexAttrib3dv"); - api->VertexAttrib3f = loadProc("glVertexAttrib3f"); - api->VertexAttrib3fv = loadProc("glVertexAttrib3fv"); - api->VertexAttrib3s = loadProc("glVertexAttrib3s"); - api->VertexAttrib3sv = loadProc("glVertexAttrib3sv"); - api->VertexAttrib4Nbv = loadProc("glVertexAttrib4Nbv"); - api->VertexAttrib4Niv = loadProc("glVertexAttrib4Niv"); - api->VertexAttrib4Nsv = loadProc("glVertexAttrib4Nsv"); - api->VertexAttrib4Nub = loadProc("glVertexAttrib4Nub"); - api->VertexAttrib4Nubv = loadProc("glVertexAttrib4Nubv"); - api->VertexAttrib4Nuiv = loadProc("glVertexAttrib4Nuiv"); - api->VertexAttrib4Nusv = loadProc("glVertexAttrib4Nusv"); - api->VertexAttrib4bv = loadProc("glVertexAttrib4bv"); - api->VertexAttrib4d = loadProc("glVertexAttrib4d"); - api->VertexAttrib4dv = loadProc("glVertexAttrib4dv"); - api->VertexAttrib4f = loadProc("glVertexAttrib4f"); - api->VertexAttrib4fv = loadProc("glVertexAttrib4fv"); - api->VertexAttrib4iv = loadProc("glVertexAttrib4iv"); - api->VertexAttrib4s = loadProc("glVertexAttrib4s"); - api->VertexAttrib4sv = loadProc("glVertexAttrib4sv"); - api->VertexAttrib4ubv = loadProc("glVertexAttrib4ubv"); - api->VertexAttrib4uiv = loadProc("glVertexAttrib4uiv"); - api->VertexAttrib4usv = loadProc("glVertexAttrib4usv"); - api->VertexAttribPointer = loadProc("glVertexAttribPointer"); - api->UniformMatrix2x3fv = loadProc("glUniformMatrix2x3fv"); - api->UniformMatrix3x2fv = loadProc("glUniformMatrix3x2fv"); - api->UniformMatrix2x4fv = loadProc("glUniformMatrix2x4fv"); - api->UniformMatrix4x2fv = loadProc("glUniformMatrix4x2fv"); - api->UniformMatrix3x4fv = loadProc("glUniformMatrix3x4fv"); - api->UniformMatrix4x3fv = loadProc("glUniformMatrix4x3fv"); - api->ColorMaski = loadProc("glColorMaski"); - api->GetBooleani_v = loadProc("glGetBooleani_v"); - api->GetIntegeri_v = loadProc("glGetIntegeri_v"); - api->Enablei = loadProc("glEnablei"); - api->Disablei = loadProc("glDisablei"); - api->IsEnabledi = loadProc("glIsEnabledi"); - api->BeginTransformFeedback = loadProc("glBeginTransformFeedback"); - api->EndTransformFeedback = loadProc("glEndTransformFeedback"); - api->BindBufferRange = loadProc("glBindBufferRange"); - api->BindBufferBase = loadProc("glBindBufferBase"); - api->TransformFeedbackVaryings = loadProc("glTransformFeedbackVaryings"); - api->GetTransformFeedbackVarying = loadProc("glGetTransformFeedbackVarying"); - api->ClampColor = loadProc("glClampColor"); - api->BeginConditionalRender = loadProc("glBeginConditionalRender"); - api->EndConditionalRender = loadProc("glEndConditionalRender"); - api->VertexAttribIPointer = loadProc("glVertexAttribIPointer"); - api->GetVertexAttribIiv = loadProc("glGetVertexAttribIiv"); - api->GetVertexAttribIuiv = loadProc("glGetVertexAttribIuiv"); - api->VertexAttribI1i = loadProc("glVertexAttribI1i"); - api->VertexAttribI2i = loadProc("glVertexAttribI2i"); - api->VertexAttribI3i = loadProc("glVertexAttribI3i"); - api->VertexAttribI4i = loadProc("glVertexAttribI4i"); - api->VertexAttribI1ui = loadProc("glVertexAttribI1ui"); - api->VertexAttribI2ui = loadProc("glVertexAttribI2ui"); - api->VertexAttribI3ui = loadProc("glVertexAttribI3ui"); - api->VertexAttribI4ui = loadProc("glVertexAttribI4ui"); - api->VertexAttribI1iv = loadProc("glVertexAttribI1iv"); - api->VertexAttribI2iv = loadProc("glVertexAttribI2iv"); - api->VertexAttribI3iv = loadProc("glVertexAttribI3iv"); - api->VertexAttribI4iv = loadProc("glVertexAttribI4iv"); - api->VertexAttribI1uiv = loadProc("glVertexAttribI1uiv"); - api->VertexAttribI2uiv = loadProc("glVertexAttribI2uiv"); - api->VertexAttribI3uiv = loadProc("glVertexAttribI3uiv"); - api->VertexAttribI4uiv = loadProc("glVertexAttribI4uiv"); - api->VertexAttribI4bv = loadProc("glVertexAttribI4bv"); - api->VertexAttribI4sv = loadProc("glVertexAttribI4sv"); - api->VertexAttribI4ubv = loadProc("glVertexAttribI4ubv"); - api->VertexAttribI4usv = loadProc("glVertexAttribI4usv"); - api->GetUniformuiv = loadProc("glGetUniformuiv"); - api->BindFragDataLocation = loadProc("glBindFragDataLocation"); - api->GetFragDataLocation = loadProc("glGetFragDataLocation"); - api->Uniform1ui = loadProc("glUniform1ui"); - api->Uniform2ui = loadProc("glUniform2ui"); - api->Uniform3ui = loadProc("glUniform3ui"); - api->Uniform4ui = loadProc("glUniform4ui"); - api->Uniform1uiv = loadProc("glUniform1uiv"); - api->Uniform2uiv = loadProc("glUniform2uiv"); - api->Uniform3uiv = loadProc("glUniform3uiv"); - api->Uniform4uiv = loadProc("glUniform4uiv"); - api->TexParameterIiv = loadProc("glTexParameterIiv"); - api->TexParameterIuiv = loadProc("glTexParameterIuiv"); - api->GetTexParameterIiv = loadProc("glGetTexParameterIiv"); - api->GetTexParameterIuiv = loadProc("glGetTexParameterIuiv"); - api->ClearBufferiv = loadProc("glClearBufferiv"); - api->ClearBufferuiv = loadProc("glClearBufferuiv"); - api->ClearBufferfv = loadProc("glClearBufferfv"); - api->ClearBufferfi = loadProc("glClearBufferfi"); - api->GetStringi = loadProc("glGetStringi"); - api->IsRenderbuffer = loadProc("glIsRenderbuffer"); - api->BindRenderbuffer = loadProc("glBindRenderbuffer"); - api->DeleteRenderbuffers = loadProc("glDeleteRenderbuffers"); - api->GenRenderbuffers = loadProc("glGenRenderbuffers"); - api->RenderbufferStorage = loadProc("glRenderbufferStorage"); - api->GetRenderbufferParameteriv = loadProc("glGetRenderbufferParameteriv"); - api->IsFramebuffer = loadProc("glIsFramebuffer"); - api->BindFramebuffer = loadProc("glBindFramebuffer"); - api->DeleteFramebuffers = loadProc("glDeleteFramebuffers"); - api->GenFramebuffers = loadProc("glGenFramebuffers"); - api->CheckFramebufferStatus = loadProc("glCheckFramebufferStatus"); - api->FramebufferTexture1D = loadProc("glFramebufferTexture1D"); - api->FramebufferTexture2D = loadProc("glFramebufferTexture2D"); - api->FramebufferTexture3D = loadProc("glFramebufferTexture3D"); - api->FramebufferRenderbuffer = loadProc("glFramebufferRenderbuffer"); - api->GetFramebufferAttachmentParameteriv = loadProc("glGetFramebufferAttachmentParameteriv"); - api->GenerateMipmap = loadProc("glGenerateMipmap"); - api->BlitFramebuffer = loadProc("glBlitFramebuffer"); - api->RenderbufferStorageMultisample = loadProc("glRenderbufferStorageMultisample"); - api->FramebufferTextureLayer = loadProc("glFramebufferTextureLayer"); - api->MapBufferRange = loadProc("glMapBufferRange"); - api->FlushMappedBufferRange = loadProc("glFlushMappedBufferRange"); - api->BindVertexArray = loadProc("glBindVertexArray"); - api->DeleteVertexArrays = loadProc("glDeleteVertexArrays"); - api->GenVertexArrays = loadProc("glGenVertexArrays"); - api->IsVertexArray = loadProc("glIsVertexArray"); - api->DrawArraysInstanced = loadProc("glDrawArraysInstanced"); - api->DrawElementsInstanced = loadProc("glDrawElementsInstanced"); - api->TexBuffer = loadProc("glTexBuffer"); - api->PrimitiveRestartIndex = loadProc("glPrimitiveRestartIndex"); - api->CopyBufferSubData = loadProc("glCopyBufferSubData"); - api->GetUniformIndices = loadProc("glGetUniformIndices"); - api->GetActiveUniformsiv = loadProc("glGetActiveUniformsiv"); - api->GetActiveUniformName = loadProc("glGetActiveUniformName"); - api->GetUniformBlockIndex = loadProc("glGetUniformBlockIndex"); - api->GetActiveUniformBlockiv = loadProc("glGetActiveUniformBlockiv"); - api->GetActiveUniformBlockName = loadProc("glGetActiveUniformBlockName"); - api->UniformBlockBinding = loadProc("glUniformBlockBinding"); - api->BindBufferRange = loadProc("glBindBufferRange"); - api->BindBufferBase = loadProc("glBindBufferBase"); - api->GetIntegeri_v = loadProc("glGetIntegeri_v"); - api->DrawElementsBaseVertex = loadProc("glDrawElementsBaseVertex"); - api->DrawRangeElementsBaseVertex = loadProc("glDrawRangeElementsBaseVertex"); - api->DrawElementsInstancedBaseVertex = loadProc("glDrawElementsInstancedBaseVertex"); - api->MultiDrawElementsBaseVertex = loadProc("glMultiDrawElementsBaseVertex"); - api->ProvokingVertex = loadProc("glProvokingVertex"); - api->FenceSync = loadProc("glFenceSync"); - api->IsSync = loadProc("glIsSync"); - api->DeleteSync = loadProc("glDeleteSync"); - api->ClientWaitSync = loadProc("glClientWaitSync"); - api->WaitSync = loadProc("glWaitSync"); - api->GetInteger64v = loadProc("glGetInteger64v"); - api->GetSynciv = loadProc("glGetSynciv"); - api->GetInteger64i_v = loadProc("glGetInteger64i_v"); - api->GetBufferParameteri64v = loadProc("glGetBufferParameteri64v"); - api->FramebufferTexture = loadProc("glFramebufferTexture"); - api->TexImage2DMultisample = loadProc("glTexImage2DMultisample"); - api->TexImage3DMultisample = loadProc("glTexImage3DMultisample"); - api->GetMultisamplefv = loadProc("glGetMultisamplefv"); - api->SampleMaski = loadProc("glSampleMaski"); - api->BindFragDataLocationIndexed = loadProc("glBindFragDataLocationIndexed"); - api->GetFragDataIndex = loadProc("glGetFragDataIndex"); - api->GenSamplers = loadProc("glGenSamplers"); - api->DeleteSamplers = loadProc("glDeleteSamplers"); - api->IsSampler = loadProc("glIsSampler"); - api->BindSampler = loadProc("glBindSampler"); - api->SamplerParameteri = loadProc("glSamplerParameteri"); - api->SamplerParameteriv = loadProc("glSamplerParameteriv"); - api->SamplerParameterf = loadProc("glSamplerParameterf"); - api->SamplerParameterfv = loadProc("glSamplerParameterfv"); - api->SamplerParameterIiv = loadProc("glSamplerParameterIiv"); - api->SamplerParameterIuiv = loadProc("glSamplerParameterIuiv"); - api->GetSamplerParameteriv = loadProc("glGetSamplerParameteriv"); - api->GetSamplerParameterIiv = loadProc("glGetSamplerParameterIiv"); - api->GetSamplerParameterfv = loadProc("glGetSamplerParameterfv"); - api->GetSamplerParameterIuiv = loadProc("glGetSamplerParameterIuiv"); - api->QueryCounter = loadProc("glQueryCounter"); - api->GetQueryObjecti64v = loadProc("glGetQueryObjecti64v"); - api->GetQueryObjectui64v = loadProc("glGetQueryObjectui64v"); - api->VertexAttribDivisor = loadProc("glVertexAttribDivisor"); - api->VertexAttribP1ui = loadProc("glVertexAttribP1ui"); - api->VertexAttribP1uiv = loadProc("glVertexAttribP1uiv"); - api->VertexAttribP2ui = loadProc("glVertexAttribP2ui"); - api->VertexAttribP2uiv = loadProc("glVertexAttribP2uiv"); - api->VertexAttribP3ui = loadProc("glVertexAttribP3ui"); - api->VertexAttribP3uiv = loadProc("glVertexAttribP3uiv"); - api->VertexAttribP4ui = loadProc("glVertexAttribP4ui"); - api->VertexAttribP4uiv = loadProc("glVertexAttribP4uiv"); - api->MinSampleShading = loadProc("glMinSampleShading"); - api->BlendEquationi = loadProc("glBlendEquationi"); - api->BlendEquationSeparatei = loadProc("glBlendEquationSeparatei"); - api->BlendFunci = loadProc("glBlendFunci"); - api->BlendFuncSeparatei = loadProc("glBlendFuncSeparatei"); - api->DrawArraysIndirect = loadProc("glDrawArraysIndirect"); - api->DrawElementsIndirect = loadProc("glDrawElementsIndirect"); - api->Uniform1d = loadProc("glUniform1d"); - api->Uniform2d = loadProc("glUniform2d"); - api->Uniform3d = loadProc("glUniform3d"); - api->Uniform4d = loadProc("glUniform4d"); - api->Uniform1dv = loadProc("glUniform1dv"); - api->Uniform2dv = loadProc("glUniform2dv"); - api->Uniform3dv = loadProc("glUniform3dv"); - api->Uniform4dv = loadProc("glUniform4dv"); - api->UniformMatrix2dv = loadProc("glUniformMatrix2dv"); - api->UniformMatrix3dv = loadProc("glUniformMatrix3dv"); - api->UniformMatrix4dv = loadProc("glUniformMatrix4dv"); - api->UniformMatrix2x3dv = loadProc("glUniformMatrix2x3dv"); - api->UniformMatrix2x4dv = loadProc("glUniformMatrix2x4dv"); - api->UniformMatrix3x2dv = loadProc("glUniformMatrix3x2dv"); - api->UniformMatrix3x4dv = loadProc("glUniformMatrix3x4dv"); - api->UniformMatrix4x2dv = loadProc("glUniformMatrix4x2dv"); - api->UniformMatrix4x3dv = loadProc("glUniformMatrix4x3dv"); - api->GetUniformdv = loadProc("glGetUniformdv"); - api->GetSubroutineUniformLocation = loadProc("glGetSubroutineUniformLocation"); - api->GetSubroutineIndex = loadProc("glGetSubroutineIndex"); - api->GetActiveSubroutineUniformiv = loadProc("glGetActiveSubroutineUniformiv"); - api->GetActiveSubroutineUniformName = loadProc("glGetActiveSubroutineUniformName"); - api->GetActiveSubroutineName = loadProc("glGetActiveSubroutineName"); - api->UniformSubroutinesuiv = loadProc("glUniformSubroutinesuiv"); - api->GetUniformSubroutineuiv = loadProc("glGetUniformSubroutineuiv"); - api->GetProgramStageiv = loadProc("glGetProgramStageiv"); - api->PatchParameteri = loadProc("glPatchParameteri"); - api->PatchParameterfv = loadProc("glPatchParameterfv"); - api->BindTransformFeedback = loadProc("glBindTransformFeedback"); - api->DeleteTransformFeedbacks = loadProc("glDeleteTransformFeedbacks"); - api->GenTransformFeedbacks = loadProc("glGenTransformFeedbacks"); - api->IsTransformFeedback = loadProc("glIsTransformFeedback"); - api->PauseTransformFeedback = loadProc("glPauseTransformFeedback"); - api->ResumeTransformFeedback = loadProc("glResumeTransformFeedback"); - api->DrawTransformFeedback = loadProc("glDrawTransformFeedback"); - api->DrawTransformFeedbackStream = loadProc("glDrawTransformFeedbackStream"); - api->BeginQueryIndexed = loadProc("glBeginQueryIndexed"); - api->EndQueryIndexed = loadProc("glEndQueryIndexed"); - api->GetQueryIndexediv = loadProc("glGetQueryIndexediv"); - api->ReleaseShaderCompiler = loadProc("glReleaseShaderCompiler"); - api->ShaderBinary = loadProc("glShaderBinary"); - api->GetShaderPrecisionFormat = loadProc("glGetShaderPrecisionFormat"); - api->DepthRangef = loadProc("glDepthRangef"); - api->ClearDepthf = loadProc("glClearDepthf"); - api->GetProgramBinary = loadProc("glGetProgramBinary"); - api->ProgramBinary = loadProc("glProgramBinary"); - api->ProgramParameteri = loadProc("glProgramParameteri"); - api->UseProgramStages = loadProc("glUseProgramStages"); - api->ActiveShaderProgram = loadProc("glActiveShaderProgram"); - api->CreateShaderProgramv = loadProc("glCreateShaderProgramv"); - api->BindProgramPipeline = loadProc("glBindProgramPipeline"); - api->DeleteProgramPipelines = loadProc("glDeleteProgramPipelines"); - api->GenProgramPipelines = loadProc("glGenProgramPipelines"); - api->IsProgramPipeline = loadProc("glIsProgramPipeline"); - api->GetProgramPipelineiv = loadProc("glGetProgramPipelineiv"); - api->ProgramParameteri = loadProc("glProgramParameteri"); - api->ProgramUniform1i = loadProc("glProgramUniform1i"); - api->ProgramUniform1iv = loadProc("glProgramUniform1iv"); - api->ProgramUniform1f = loadProc("glProgramUniform1f"); - api->ProgramUniform1fv = loadProc("glProgramUniform1fv"); - api->ProgramUniform1d = loadProc("glProgramUniform1d"); - api->ProgramUniform1dv = loadProc("glProgramUniform1dv"); - api->ProgramUniform1ui = loadProc("glProgramUniform1ui"); - api->ProgramUniform1uiv = loadProc("glProgramUniform1uiv"); - api->ProgramUniform2i = loadProc("glProgramUniform2i"); - api->ProgramUniform2iv = loadProc("glProgramUniform2iv"); - api->ProgramUniform2f = loadProc("glProgramUniform2f"); - api->ProgramUniform2fv = loadProc("glProgramUniform2fv"); - api->ProgramUniform2d = loadProc("glProgramUniform2d"); - api->ProgramUniform2dv = loadProc("glProgramUniform2dv"); - api->ProgramUniform2ui = loadProc("glProgramUniform2ui"); - api->ProgramUniform2uiv = loadProc("glProgramUniform2uiv"); - api->ProgramUniform3i = loadProc("glProgramUniform3i"); - api->ProgramUniform3iv = loadProc("glProgramUniform3iv"); - api->ProgramUniform3f = loadProc("glProgramUniform3f"); - api->ProgramUniform3fv = loadProc("glProgramUniform3fv"); - api->ProgramUniform3d = loadProc("glProgramUniform3d"); - api->ProgramUniform3dv = loadProc("glProgramUniform3dv"); - api->ProgramUniform3ui = loadProc("glProgramUniform3ui"); - api->ProgramUniform3uiv = loadProc("glProgramUniform3uiv"); - api->ProgramUniform4i = loadProc("glProgramUniform4i"); - api->ProgramUniform4iv = loadProc("glProgramUniform4iv"); - api->ProgramUniform4f = loadProc("glProgramUniform4f"); - api->ProgramUniform4fv = loadProc("glProgramUniform4fv"); - api->ProgramUniform4d = loadProc("glProgramUniform4d"); - api->ProgramUniform4dv = loadProc("glProgramUniform4dv"); - api->ProgramUniform4ui = loadProc("glProgramUniform4ui"); - api->ProgramUniform4uiv = loadProc("glProgramUniform4uiv"); - api->ProgramUniformMatrix2fv = loadProc("glProgramUniformMatrix2fv"); - api->ProgramUniformMatrix3fv = loadProc("glProgramUniformMatrix3fv"); - api->ProgramUniformMatrix4fv = loadProc("glProgramUniformMatrix4fv"); - api->ProgramUniformMatrix2dv = loadProc("glProgramUniformMatrix2dv"); - api->ProgramUniformMatrix3dv = loadProc("glProgramUniformMatrix3dv"); - api->ProgramUniformMatrix4dv = loadProc("glProgramUniformMatrix4dv"); - api->ProgramUniformMatrix2x3fv = loadProc("glProgramUniformMatrix2x3fv"); - api->ProgramUniformMatrix3x2fv = loadProc("glProgramUniformMatrix3x2fv"); - api->ProgramUniformMatrix2x4fv = loadProc("glProgramUniformMatrix2x4fv"); - api->ProgramUniformMatrix4x2fv = loadProc("glProgramUniformMatrix4x2fv"); - api->ProgramUniformMatrix3x4fv = loadProc("glProgramUniformMatrix3x4fv"); - api->ProgramUniformMatrix4x3fv = loadProc("glProgramUniformMatrix4x3fv"); - api->ProgramUniformMatrix2x3dv = loadProc("glProgramUniformMatrix2x3dv"); - api->ProgramUniformMatrix3x2dv = loadProc("glProgramUniformMatrix3x2dv"); - api->ProgramUniformMatrix2x4dv = loadProc("glProgramUniformMatrix2x4dv"); - api->ProgramUniformMatrix4x2dv = loadProc("glProgramUniformMatrix4x2dv"); - api->ProgramUniformMatrix3x4dv = loadProc("glProgramUniformMatrix3x4dv"); - api->ProgramUniformMatrix4x3dv = loadProc("glProgramUniformMatrix4x3dv"); - api->ValidateProgramPipeline = loadProc("glValidateProgramPipeline"); - api->GetProgramPipelineInfoLog = loadProc("glGetProgramPipelineInfoLog"); - api->VertexAttribL1d = loadProc("glVertexAttribL1d"); - api->VertexAttribL2d = loadProc("glVertexAttribL2d"); - api->VertexAttribL3d = loadProc("glVertexAttribL3d"); - api->VertexAttribL4d = loadProc("glVertexAttribL4d"); - api->VertexAttribL1dv = loadProc("glVertexAttribL1dv"); - api->VertexAttribL2dv = loadProc("glVertexAttribL2dv"); - api->VertexAttribL3dv = loadProc("glVertexAttribL3dv"); - api->VertexAttribL4dv = loadProc("glVertexAttribL4dv"); - api->VertexAttribLPointer = loadProc("glVertexAttribLPointer"); - api->GetVertexAttribLdv = loadProc("glGetVertexAttribLdv"); - api->ViewportArrayv = loadProc("glViewportArrayv"); - api->ViewportIndexedf = loadProc("glViewportIndexedf"); - api->ViewportIndexedfv = loadProc("glViewportIndexedfv"); - api->ScissorArrayv = loadProc("glScissorArrayv"); - api->ScissorIndexed = loadProc("glScissorIndexed"); - api->ScissorIndexedv = loadProc("glScissorIndexedv"); - api->DepthRangeArrayv = loadProc("glDepthRangeArrayv"); - api->DepthRangeIndexed = loadProc("glDepthRangeIndexed"); - api->GetFloati_v = loadProc("glGetFloati_v"); - api->GetDoublei_v = loadProc("glGetDoublei_v"); -} - -void mg_gl_load_gl43(mg_gl_api* api, mg_gl_load_proc loadProc) -{ - api->CullFace = loadProc("glCullFace"); - api->FrontFace = loadProc("glFrontFace"); - api->Hint = loadProc("glHint"); - api->LineWidth = loadProc("glLineWidth"); - api->PointSize = loadProc("glPointSize"); - api->PolygonMode = loadProc("glPolygonMode"); - api->Scissor = loadProc("glScissor"); - api->TexParameterf = loadProc("glTexParameterf"); - api->TexParameterfv = loadProc("glTexParameterfv"); - api->TexParameteri = loadProc("glTexParameteri"); - api->TexParameteriv = loadProc("glTexParameteriv"); - api->TexImage1D = loadProc("glTexImage1D"); - api->TexImage2D = loadProc("glTexImage2D"); - api->DrawBuffer = loadProc("glDrawBuffer"); - api->Clear = loadProc("glClear"); - api->ClearColor = loadProc("glClearColor"); - api->ClearStencil = loadProc("glClearStencil"); - api->ClearDepth = loadProc("glClearDepth"); - api->StencilMask = loadProc("glStencilMask"); - api->ColorMask = loadProc("glColorMask"); - api->DepthMask = loadProc("glDepthMask"); - api->Disable = loadProc("glDisable"); - api->Enable = loadProc("glEnable"); - api->Finish = loadProc("glFinish"); - api->Flush = loadProc("glFlush"); - api->BlendFunc = loadProc("glBlendFunc"); - api->LogicOp = loadProc("glLogicOp"); - api->StencilFunc = loadProc("glStencilFunc"); - api->StencilOp = loadProc("glStencilOp"); - api->DepthFunc = loadProc("glDepthFunc"); - api->PixelStoref = loadProc("glPixelStoref"); - api->PixelStorei = loadProc("glPixelStorei"); - api->ReadBuffer = loadProc("glReadBuffer"); - api->ReadPixels = loadProc("glReadPixels"); - api->GetBooleanv = loadProc("glGetBooleanv"); - api->GetDoublev = loadProc("glGetDoublev"); - api->GetError = loadProc("glGetError"); - api->GetFloatv = loadProc("glGetFloatv"); - api->GetIntegerv = loadProc("glGetIntegerv"); - api->GetString = loadProc("glGetString"); - api->GetTexImage = loadProc("glGetTexImage"); - api->GetTexParameterfv = loadProc("glGetTexParameterfv"); - api->GetTexParameteriv = loadProc("glGetTexParameteriv"); - api->GetTexLevelParameterfv = loadProc("glGetTexLevelParameterfv"); - api->GetTexLevelParameteriv = loadProc("glGetTexLevelParameteriv"); - api->IsEnabled = loadProc("glIsEnabled"); - api->DepthRange = loadProc("glDepthRange"); - api->Viewport = loadProc("glViewport"); - api->DrawArrays = loadProc("glDrawArrays"); - api->DrawElements = loadProc("glDrawElements"); - api->PolygonOffset = loadProc("glPolygonOffset"); - api->CopyTexImage1D = loadProc("glCopyTexImage1D"); - api->CopyTexImage2D = loadProc("glCopyTexImage2D"); - api->CopyTexSubImage1D = loadProc("glCopyTexSubImage1D"); - api->CopyTexSubImage2D = loadProc("glCopyTexSubImage2D"); - api->TexSubImage1D = loadProc("glTexSubImage1D"); - api->TexSubImage2D = loadProc("glTexSubImage2D"); - api->BindTexture = loadProc("glBindTexture"); - api->DeleteTextures = loadProc("glDeleteTextures"); - api->GenTextures = loadProc("glGenTextures"); - api->IsTexture = loadProc("glIsTexture"); - api->DrawRangeElements = loadProc("glDrawRangeElements"); - api->TexImage3D = loadProc("glTexImage3D"); - api->TexSubImage3D = loadProc("glTexSubImage3D"); - api->CopyTexSubImage3D = loadProc("glCopyTexSubImage3D"); - api->ActiveTexture = loadProc("glActiveTexture"); - api->SampleCoverage = loadProc("glSampleCoverage"); - api->CompressedTexImage3D = loadProc("glCompressedTexImage3D"); - api->CompressedTexImage2D = loadProc("glCompressedTexImage2D"); - api->CompressedTexImage1D = loadProc("glCompressedTexImage1D"); - api->CompressedTexSubImage3D = loadProc("glCompressedTexSubImage3D"); - api->CompressedTexSubImage2D = loadProc("glCompressedTexSubImage2D"); - api->CompressedTexSubImage1D = loadProc("glCompressedTexSubImage1D"); - api->GetCompressedTexImage = loadProc("glGetCompressedTexImage"); - api->BlendFuncSeparate = loadProc("glBlendFuncSeparate"); - api->MultiDrawArrays = loadProc("glMultiDrawArrays"); - api->MultiDrawElements = loadProc("glMultiDrawElements"); - api->PointParameterf = loadProc("glPointParameterf"); - api->PointParameterfv = loadProc("glPointParameterfv"); - api->PointParameteri = loadProc("glPointParameteri"); - api->PointParameteriv = loadProc("glPointParameteriv"); - api->BlendColor = loadProc("glBlendColor"); - api->BlendEquation = loadProc("glBlendEquation"); - api->GenQueries = loadProc("glGenQueries"); - api->DeleteQueries = loadProc("glDeleteQueries"); - api->IsQuery = loadProc("glIsQuery"); - api->BeginQuery = loadProc("glBeginQuery"); - api->EndQuery = loadProc("glEndQuery"); - api->GetQueryiv = loadProc("glGetQueryiv"); - api->GetQueryObjectiv = loadProc("glGetQueryObjectiv"); - api->GetQueryObjectuiv = loadProc("glGetQueryObjectuiv"); - api->BindBuffer = loadProc("glBindBuffer"); - api->DeleteBuffers = loadProc("glDeleteBuffers"); - api->GenBuffers = loadProc("glGenBuffers"); - api->IsBuffer = loadProc("glIsBuffer"); - api->BufferData = loadProc("glBufferData"); - api->BufferSubData = loadProc("glBufferSubData"); - api->GetBufferSubData = loadProc("glGetBufferSubData"); - api->MapBuffer = loadProc("glMapBuffer"); - api->UnmapBuffer = loadProc("glUnmapBuffer"); - api->GetBufferParameteriv = loadProc("glGetBufferParameteriv"); - api->GetBufferPointerv = loadProc("glGetBufferPointerv"); - api->BlendEquationSeparate = loadProc("glBlendEquationSeparate"); - api->DrawBuffers = loadProc("glDrawBuffers"); - api->StencilOpSeparate = loadProc("glStencilOpSeparate"); - api->StencilFuncSeparate = loadProc("glStencilFuncSeparate"); - api->StencilMaskSeparate = loadProc("glStencilMaskSeparate"); - api->AttachShader = loadProc("glAttachShader"); - api->BindAttribLocation = loadProc("glBindAttribLocation"); - api->CompileShader = loadProc("glCompileShader"); - api->CreateProgram = loadProc("glCreateProgram"); - api->CreateShader = loadProc("glCreateShader"); - api->DeleteProgram = loadProc("glDeleteProgram"); - api->DeleteShader = loadProc("glDeleteShader"); - api->DetachShader = loadProc("glDetachShader"); - api->DisableVertexAttribArray = loadProc("glDisableVertexAttribArray"); - api->EnableVertexAttribArray = loadProc("glEnableVertexAttribArray"); - api->GetActiveAttrib = loadProc("glGetActiveAttrib"); - api->GetActiveUniform = loadProc("glGetActiveUniform"); - api->GetAttachedShaders = loadProc("glGetAttachedShaders"); - api->GetAttribLocation = loadProc("glGetAttribLocation"); - api->GetProgramiv = loadProc("glGetProgramiv"); - api->GetProgramInfoLog = loadProc("glGetProgramInfoLog"); - api->GetShaderiv = loadProc("glGetShaderiv"); - api->GetShaderInfoLog = loadProc("glGetShaderInfoLog"); - api->GetShaderSource = loadProc("glGetShaderSource"); - api->GetUniformLocation = loadProc("glGetUniformLocation"); - api->GetUniformfv = loadProc("glGetUniformfv"); - api->GetUniformiv = loadProc("glGetUniformiv"); - api->GetVertexAttribdv = loadProc("glGetVertexAttribdv"); - api->GetVertexAttribfv = loadProc("glGetVertexAttribfv"); - api->GetVertexAttribiv = loadProc("glGetVertexAttribiv"); - api->GetVertexAttribPointerv = loadProc("glGetVertexAttribPointerv"); - api->IsProgram = loadProc("glIsProgram"); - api->IsShader = loadProc("glIsShader"); - api->LinkProgram = loadProc("glLinkProgram"); - api->ShaderSource = loadProc("glShaderSource"); - api->UseProgram = loadProc("glUseProgram"); - api->Uniform1f = loadProc("glUniform1f"); - api->Uniform2f = loadProc("glUniform2f"); - api->Uniform3f = loadProc("glUniform3f"); - api->Uniform4f = loadProc("glUniform4f"); - api->Uniform1i = loadProc("glUniform1i"); - api->Uniform2i = loadProc("glUniform2i"); - api->Uniform3i = loadProc("glUniform3i"); - api->Uniform4i = loadProc("glUniform4i"); - api->Uniform1fv = loadProc("glUniform1fv"); - api->Uniform2fv = loadProc("glUniform2fv"); - api->Uniform3fv = loadProc("glUniform3fv"); - api->Uniform4fv = loadProc("glUniform4fv"); - api->Uniform1iv = loadProc("glUniform1iv"); - api->Uniform2iv = loadProc("glUniform2iv"); - api->Uniform3iv = loadProc("glUniform3iv"); - api->Uniform4iv = loadProc("glUniform4iv"); - api->UniformMatrix2fv = loadProc("glUniformMatrix2fv"); - api->UniformMatrix3fv = loadProc("glUniformMatrix3fv"); - api->UniformMatrix4fv = loadProc("glUniformMatrix4fv"); - api->ValidateProgram = loadProc("glValidateProgram"); - api->VertexAttrib1d = loadProc("glVertexAttrib1d"); - api->VertexAttrib1dv = loadProc("glVertexAttrib1dv"); - api->VertexAttrib1f = loadProc("glVertexAttrib1f"); - api->VertexAttrib1fv = loadProc("glVertexAttrib1fv"); - api->VertexAttrib1s = loadProc("glVertexAttrib1s"); - api->VertexAttrib1sv = loadProc("glVertexAttrib1sv"); - api->VertexAttrib2d = loadProc("glVertexAttrib2d"); - api->VertexAttrib2dv = loadProc("glVertexAttrib2dv"); - api->VertexAttrib2f = loadProc("glVertexAttrib2f"); - api->VertexAttrib2fv = loadProc("glVertexAttrib2fv"); - api->VertexAttrib2s = loadProc("glVertexAttrib2s"); - api->VertexAttrib2sv = loadProc("glVertexAttrib2sv"); - api->VertexAttrib3d = loadProc("glVertexAttrib3d"); - api->VertexAttrib3dv = loadProc("glVertexAttrib3dv"); - api->VertexAttrib3f = loadProc("glVertexAttrib3f"); - api->VertexAttrib3fv = loadProc("glVertexAttrib3fv"); - api->VertexAttrib3s = loadProc("glVertexAttrib3s"); - api->VertexAttrib3sv = loadProc("glVertexAttrib3sv"); - api->VertexAttrib4Nbv = loadProc("glVertexAttrib4Nbv"); - api->VertexAttrib4Niv = loadProc("glVertexAttrib4Niv"); - api->VertexAttrib4Nsv = loadProc("glVertexAttrib4Nsv"); - api->VertexAttrib4Nub = loadProc("glVertexAttrib4Nub"); - api->VertexAttrib4Nubv = loadProc("glVertexAttrib4Nubv"); - api->VertexAttrib4Nuiv = loadProc("glVertexAttrib4Nuiv"); - api->VertexAttrib4Nusv = loadProc("glVertexAttrib4Nusv"); - api->VertexAttrib4bv = loadProc("glVertexAttrib4bv"); - api->VertexAttrib4d = loadProc("glVertexAttrib4d"); - api->VertexAttrib4dv = loadProc("glVertexAttrib4dv"); - api->VertexAttrib4f = loadProc("glVertexAttrib4f"); - api->VertexAttrib4fv = loadProc("glVertexAttrib4fv"); - api->VertexAttrib4iv = loadProc("glVertexAttrib4iv"); - api->VertexAttrib4s = loadProc("glVertexAttrib4s"); - api->VertexAttrib4sv = loadProc("glVertexAttrib4sv"); - api->VertexAttrib4ubv = loadProc("glVertexAttrib4ubv"); - api->VertexAttrib4uiv = loadProc("glVertexAttrib4uiv"); - api->VertexAttrib4usv = loadProc("glVertexAttrib4usv"); - api->VertexAttribPointer = loadProc("glVertexAttribPointer"); - api->UniformMatrix2x3fv = loadProc("glUniformMatrix2x3fv"); - api->UniformMatrix3x2fv = loadProc("glUniformMatrix3x2fv"); - api->UniformMatrix2x4fv = loadProc("glUniformMatrix2x4fv"); - api->UniformMatrix4x2fv = loadProc("glUniformMatrix4x2fv"); - api->UniformMatrix3x4fv = loadProc("glUniformMatrix3x4fv"); - api->UniformMatrix4x3fv = loadProc("glUniformMatrix4x3fv"); - api->ColorMaski = loadProc("glColorMaski"); - api->GetBooleani_v = loadProc("glGetBooleani_v"); - api->GetIntegeri_v = loadProc("glGetIntegeri_v"); - api->Enablei = loadProc("glEnablei"); - api->Disablei = loadProc("glDisablei"); - api->IsEnabledi = loadProc("glIsEnabledi"); - api->BeginTransformFeedback = loadProc("glBeginTransformFeedback"); - api->EndTransformFeedback = loadProc("glEndTransformFeedback"); - api->BindBufferRange = loadProc("glBindBufferRange"); - api->BindBufferBase = loadProc("glBindBufferBase"); - api->TransformFeedbackVaryings = loadProc("glTransformFeedbackVaryings"); - api->GetTransformFeedbackVarying = loadProc("glGetTransformFeedbackVarying"); - api->ClampColor = loadProc("glClampColor"); - api->BeginConditionalRender = loadProc("glBeginConditionalRender"); - api->EndConditionalRender = loadProc("glEndConditionalRender"); - api->VertexAttribIPointer = loadProc("glVertexAttribIPointer"); - api->GetVertexAttribIiv = loadProc("glGetVertexAttribIiv"); - api->GetVertexAttribIuiv = loadProc("glGetVertexAttribIuiv"); - api->VertexAttribI1i = loadProc("glVertexAttribI1i"); - api->VertexAttribI2i = loadProc("glVertexAttribI2i"); - api->VertexAttribI3i = loadProc("glVertexAttribI3i"); - api->VertexAttribI4i = loadProc("glVertexAttribI4i"); - api->VertexAttribI1ui = loadProc("glVertexAttribI1ui"); - api->VertexAttribI2ui = loadProc("glVertexAttribI2ui"); - api->VertexAttribI3ui = loadProc("glVertexAttribI3ui"); - api->VertexAttribI4ui = loadProc("glVertexAttribI4ui"); - api->VertexAttribI1iv = loadProc("glVertexAttribI1iv"); - api->VertexAttribI2iv = loadProc("glVertexAttribI2iv"); - api->VertexAttribI3iv = loadProc("glVertexAttribI3iv"); - api->VertexAttribI4iv = loadProc("glVertexAttribI4iv"); - api->VertexAttribI1uiv = loadProc("glVertexAttribI1uiv"); - api->VertexAttribI2uiv = loadProc("glVertexAttribI2uiv"); - api->VertexAttribI3uiv = loadProc("glVertexAttribI3uiv"); - api->VertexAttribI4uiv = loadProc("glVertexAttribI4uiv"); - api->VertexAttribI4bv = loadProc("glVertexAttribI4bv"); - api->VertexAttribI4sv = loadProc("glVertexAttribI4sv"); - api->VertexAttribI4ubv = loadProc("glVertexAttribI4ubv"); - api->VertexAttribI4usv = loadProc("glVertexAttribI4usv"); - api->GetUniformuiv = loadProc("glGetUniformuiv"); - api->BindFragDataLocation = loadProc("glBindFragDataLocation"); - api->GetFragDataLocation = loadProc("glGetFragDataLocation"); - api->Uniform1ui = loadProc("glUniform1ui"); - api->Uniform2ui = loadProc("glUniform2ui"); - api->Uniform3ui = loadProc("glUniform3ui"); - api->Uniform4ui = loadProc("glUniform4ui"); - api->Uniform1uiv = loadProc("glUniform1uiv"); - api->Uniform2uiv = loadProc("glUniform2uiv"); - api->Uniform3uiv = loadProc("glUniform3uiv"); - api->Uniform4uiv = loadProc("glUniform4uiv"); - api->TexParameterIiv = loadProc("glTexParameterIiv"); - api->TexParameterIuiv = loadProc("glTexParameterIuiv"); - api->GetTexParameterIiv = loadProc("glGetTexParameterIiv"); - api->GetTexParameterIuiv = loadProc("glGetTexParameterIuiv"); - api->ClearBufferiv = loadProc("glClearBufferiv"); - api->ClearBufferuiv = loadProc("glClearBufferuiv"); - api->ClearBufferfv = loadProc("glClearBufferfv"); - api->ClearBufferfi = loadProc("glClearBufferfi"); - api->GetStringi = loadProc("glGetStringi"); - api->IsRenderbuffer = loadProc("glIsRenderbuffer"); - api->BindRenderbuffer = loadProc("glBindRenderbuffer"); - api->DeleteRenderbuffers = loadProc("glDeleteRenderbuffers"); - api->GenRenderbuffers = loadProc("glGenRenderbuffers"); - api->RenderbufferStorage = loadProc("glRenderbufferStorage"); - api->GetRenderbufferParameteriv = loadProc("glGetRenderbufferParameteriv"); - api->IsFramebuffer = loadProc("glIsFramebuffer"); - api->BindFramebuffer = loadProc("glBindFramebuffer"); - api->DeleteFramebuffers = loadProc("glDeleteFramebuffers"); - api->GenFramebuffers = loadProc("glGenFramebuffers"); - api->CheckFramebufferStatus = loadProc("glCheckFramebufferStatus"); - api->FramebufferTexture1D = loadProc("glFramebufferTexture1D"); - api->FramebufferTexture2D = loadProc("glFramebufferTexture2D"); - api->FramebufferTexture3D = loadProc("glFramebufferTexture3D"); - api->FramebufferRenderbuffer = loadProc("glFramebufferRenderbuffer"); - api->GetFramebufferAttachmentParameteriv = loadProc("glGetFramebufferAttachmentParameteriv"); - api->GenerateMipmap = loadProc("glGenerateMipmap"); - api->BlitFramebuffer = loadProc("glBlitFramebuffer"); - api->RenderbufferStorageMultisample = loadProc("glRenderbufferStorageMultisample"); - api->FramebufferTextureLayer = loadProc("glFramebufferTextureLayer"); - api->MapBufferRange = loadProc("glMapBufferRange"); - api->FlushMappedBufferRange = loadProc("glFlushMappedBufferRange"); - api->BindVertexArray = loadProc("glBindVertexArray"); - api->DeleteVertexArrays = loadProc("glDeleteVertexArrays"); - api->GenVertexArrays = loadProc("glGenVertexArrays"); - api->IsVertexArray = loadProc("glIsVertexArray"); - api->DrawArraysInstanced = loadProc("glDrawArraysInstanced"); - api->DrawElementsInstanced = loadProc("glDrawElementsInstanced"); - api->TexBuffer = loadProc("glTexBuffer"); - api->PrimitiveRestartIndex = loadProc("glPrimitiveRestartIndex"); - api->CopyBufferSubData = loadProc("glCopyBufferSubData"); - api->GetUniformIndices = loadProc("glGetUniformIndices"); - api->GetActiveUniformsiv = loadProc("glGetActiveUniformsiv"); - api->GetActiveUniformName = loadProc("glGetActiveUniformName"); - api->GetUniformBlockIndex = loadProc("glGetUniformBlockIndex"); - api->GetActiveUniformBlockiv = loadProc("glGetActiveUniformBlockiv"); - api->GetActiveUniformBlockName = loadProc("glGetActiveUniformBlockName"); - api->UniformBlockBinding = loadProc("glUniformBlockBinding"); - api->BindBufferRange = loadProc("glBindBufferRange"); - api->BindBufferBase = loadProc("glBindBufferBase"); - api->GetIntegeri_v = loadProc("glGetIntegeri_v"); - api->DrawElementsBaseVertex = loadProc("glDrawElementsBaseVertex"); - api->DrawRangeElementsBaseVertex = loadProc("glDrawRangeElementsBaseVertex"); - api->DrawElementsInstancedBaseVertex = loadProc("glDrawElementsInstancedBaseVertex"); - api->MultiDrawElementsBaseVertex = loadProc("glMultiDrawElementsBaseVertex"); - api->ProvokingVertex = loadProc("glProvokingVertex"); - api->FenceSync = loadProc("glFenceSync"); - api->IsSync = loadProc("glIsSync"); - api->DeleteSync = loadProc("glDeleteSync"); - api->ClientWaitSync = loadProc("glClientWaitSync"); - api->WaitSync = loadProc("glWaitSync"); - api->GetInteger64v = loadProc("glGetInteger64v"); - api->GetSynciv = loadProc("glGetSynciv"); - api->GetInteger64i_v = loadProc("glGetInteger64i_v"); - api->GetBufferParameteri64v = loadProc("glGetBufferParameteri64v"); - api->FramebufferTexture = loadProc("glFramebufferTexture"); - api->TexImage2DMultisample = loadProc("glTexImage2DMultisample"); - api->TexImage3DMultisample = loadProc("glTexImage3DMultisample"); - api->GetMultisamplefv = loadProc("glGetMultisamplefv"); - api->SampleMaski = loadProc("glSampleMaski"); - api->BindFragDataLocationIndexed = loadProc("glBindFragDataLocationIndexed"); - api->GetFragDataIndex = loadProc("glGetFragDataIndex"); - api->GenSamplers = loadProc("glGenSamplers"); - api->DeleteSamplers = loadProc("glDeleteSamplers"); - api->IsSampler = loadProc("glIsSampler"); - api->BindSampler = loadProc("glBindSampler"); - api->SamplerParameteri = loadProc("glSamplerParameteri"); - api->SamplerParameteriv = loadProc("glSamplerParameteriv"); - api->SamplerParameterf = loadProc("glSamplerParameterf"); - api->SamplerParameterfv = loadProc("glSamplerParameterfv"); - api->SamplerParameterIiv = loadProc("glSamplerParameterIiv"); - api->SamplerParameterIuiv = loadProc("glSamplerParameterIuiv"); - api->GetSamplerParameteriv = loadProc("glGetSamplerParameteriv"); - api->GetSamplerParameterIiv = loadProc("glGetSamplerParameterIiv"); - api->GetSamplerParameterfv = loadProc("glGetSamplerParameterfv"); - api->GetSamplerParameterIuiv = loadProc("glGetSamplerParameterIuiv"); - api->QueryCounter = loadProc("glQueryCounter"); - api->GetQueryObjecti64v = loadProc("glGetQueryObjecti64v"); - api->GetQueryObjectui64v = loadProc("glGetQueryObjectui64v"); - api->VertexAttribDivisor = loadProc("glVertexAttribDivisor"); - api->VertexAttribP1ui = loadProc("glVertexAttribP1ui"); - api->VertexAttribP1uiv = loadProc("glVertexAttribP1uiv"); - api->VertexAttribP2ui = loadProc("glVertexAttribP2ui"); - api->VertexAttribP2uiv = loadProc("glVertexAttribP2uiv"); - api->VertexAttribP3ui = loadProc("glVertexAttribP3ui"); - api->VertexAttribP3uiv = loadProc("glVertexAttribP3uiv"); - api->VertexAttribP4ui = loadProc("glVertexAttribP4ui"); - api->VertexAttribP4uiv = loadProc("glVertexAttribP4uiv"); - api->MinSampleShading = loadProc("glMinSampleShading"); - api->BlendEquationi = loadProc("glBlendEquationi"); - api->BlendEquationSeparatei = loadProc("glBlendEquationSeparatei"); - api->BlendFunci = loadProc("glBlendFunci"); - api->BlendFuncSeparatei = loadProc("glBlendFuncSeparatei"); - api->DrawArraysIndirect = loadProc("glDrawArraysIndirect"); - api->DrawElementsIndirect = loadProc("glDrawElementsIndirect"); - api->Uniform1d = loadProc("glUniform1d"); - api->Uniform2d = loadProc("glUniform2d"); - api->Uniform3d = loadProc("glUniform3d"); - api->Uniform4d = loadProc("glUniform4d"); - api->Uniform1dv = loadProc("glUniform1dv"); - api->Uniform2dv = loadProc("glUniform2dv"); - api->Uniform3dv = loadProc("glUniform3dv"); - api->Uniform4dv = loadProc("glUniform4dv"); - api->UniformMatrix2dv = loadProc("glUniformMatrix2dv"); - api->UniformMatrix3dv = loadProc("glUniformMatrix3dv"); - api->UniformMatrix4dv = loadProc("glUniformMatrix4dv"); - api->UniformMatrix2x3dv = loadProc("glUniformMatrix2x3dv"); - api->UniformMatrix2x4dv = loadProc("glUniformMatrix2x4dv"); - api->UniformMatrix3x2dv = loadProc("glUniformMatrix3x2dv"); - api->UniformMatrix3x4dv = loadProc("glUniformMatrix3x4dv"); - api->UniformMatrix4x2dv = loadProc("glUniformMatrix4x2dv"); - api->UniformMatrix4x3dv = loadProc("glUniformMatrix4x3dv"); - api->GetUniformdv = loadProc("glGetUniformdv"); - api->GetSubroutineUniformLocation = loadProc("glGetSubroutineUniformLocation"); - api->GetSubroutineIndex = loadProc("glGetSubroutineIndex"); - api->GetActiveSubroutineUniformiv = loadProc("glGetActiveSubroutineUniformiv"); - api->GetActiveSubroutineUniformName = loadProc("glGetActiveSubroutineUniformName"); - api->GetActiveSubroutineName = loadProc("glGetActiveSubroutineName"); - api->UniformSubroutinesuiv = loadProc("glUniformSubroutinesuiv"); - api->GetUniformSubroutineuiv = loadProc("glGetUniformSubroutineuiv"); - api->GetProgramStageiv = loadProc("glGetProgramStageiv"); - api->PatchParameteri = loadProc("glPatchParameteri"); - api->PatchParameterfv = loadProc("glPatchParameterfv"); - api->BindTransformFeedback = loadProc("glBindTransformFeedback"); - api->DeleteTransformFeedbacks = loadProc("glDeleteTransformFeedbacks"); - api->GenTransformFeedbacks = loadProc("glGenTransformFeedbacks"); - api->IsTransformFeedback = loadProc("glIsTransformFeedback"); - api->PauseTransformFeedback = loadProc("glPauseTransformFeedback"); - api->ResumeTransformFeedback = loadProc("glResumeTransformFeedback"); - api->DrawTransformFeedback = loadProc("glDrawTransformFeedback"); - api->DrawTransformFeedbackStream = loadProc("glDrawTransformFeedbackStream"); - api->BeginQueryIndexed = loadProc("glBeginQueryIndexed"); - api->EndQueryIndexed = loadProc("glEndQueryIndexed"); - api->GetQueryIndexediv = loadProc("glGetQueryIndexediv"); - api->ReleaseShaderCompiler = loadProc("glReleaseShaderCompiler"); - api->ShaderBinary = loadProc("glShaderBinary"); - api->GetShaderPrecisionFormat = loadProc("glGetShaderPrecisionFormat"); - api->DepthRangef = loadProc("glDepthRangef"); - api->ClearDepthf = loadProc("glClearDepthf"); - api->GetProgramBinary = loadProc("glGetProgramBinary"); - api->ProgramBinary = loadProc("glProgramBinary"); - api->ProgramParameteri = loadProc("glProgramParameteri"); - api->UseProgramStages = loadProc("glUseProgramStages"); - api->ActiveShaderProgram = loadProc("glActiveShaderProgram"); - api->CreateShaderProgramv = loadProc("glCreateShaderProgramv"); - api->BindProgramPipeline = loadProc("glBindProgramPipeline"); - api->DeleteProgramPipelines = loadProc("glDeleteProgramPipelines"); - api->GenProgramPipelines = loadProc("glGenProgramPipelines"); - api->IsProgramPipeline = loadProc("glIsProgramPipeline"); - api->GetProgramPipelineiv = loadProc("glGetProgramPipelineiv"); - api->ProgramParameteri = loadProc("glProgramParameteri"); - api->ProgramUniform1i = loadProc("glProgramUniform1i"); - api->ProgramUniform1iv = loadProc("glProgramUniform1iv"); - api->ProgramUniform1f = loadProc("glProgramUniform1f"); - api->ProgramUniform1fv = loadProc("glProgramUniform1fv"); - api->ProgramUniform1d = loadProc("glProgramUniform1d"); - api->ProgramUniform1dv = loadProc("glProgramUniform1dv"); - api->ProgramUniform1ui = loadProc("glProgramUniform1ui"); - api->ProgramUniform1uiv = loadProc("glProgramUniform1uiv"); - api->ProgramUniform2i = loadProc("glProgramUniform2i"); - api->ProgramUniform2iv = loadProc("glProgramUniform2iv"); - api->ProgramUniform2f = loadProc("glProgramUniform2f"); - api->ProgramUniform2fv = loadProc("glProgramUniform2fv"); - api->ProgramUniform2d = loadProc("glProgramUniform2d"); - api->ProgramUniform2dv = loadProc("glProgramUniform2dv"); - api->ProgramUniform2ui = loadProc("glProgramUniform2ui"); - api->ProgramUniform2uiv = loadProc("glProgramUniform2uiv"); - api->ProgramUniform3i = loadProc("glProgramUniform3i"); - api->ProgramUniform3iv = loadProc("glProgramUniform3iv"); - api->ProgramUniform3f = loadProc("glProgramUniform3f"); - api->ProgramUniform3fv = loadProc("glProgramUniform3fv"); - api->ProgramUniform3d = loadProc("glProgramUniform3d"); - api->ProgramUniform3dv = loadProc("glProgramUniform3dv"); - api->ProgramUniform3ui = loadProc("glProgramUniform3ui"); - api->ProgramUniform3uiv = loadProc("glProgramUniform3uiv"); - api->ProgramUniform4i = loadProc("glProgramUniform4i"); - api->ProgramUniform4iv = loadProc("glProgramUniform4iv"); - api->ProgramUniform4f = loadProc("glProgramUniform4f"); - api->ProgramUniform4fv = loadProc("glProgramUniform4fv"); - api->ProgramUniform4d = loadProc("glProgramUniform4d"); - api->ProgramUniform4dv = loadProc("glProgramUniform4dv"); - api->ProgramUniform4ui = loadProc("glProgramUniform4ui"); - api->ProgramUniform4uiv = loadProc("glProgramUniform4uiv"); - api->ProgramUniformMatrix2fv = loadProc("glProgramUniformMatrix2fv"); - api->ProgramUniformMatrix3fv = loadProc("glProgramUniformMatrix3fv"); - api->ProgramUniformMatrix4fv = loadProc("glProgramUniformMatrix4fv"); - api->ProgramUniformMatrix2dv = loadProc("glProgramUniformMatrix2dv"); - api->ProgramUniformMatrix3dv = loadProc("glProgramUniformMatrix3dv"); - api->ProgramUniformMatrix4dv = loadProc("glProgramUniformMatrix4dv"); - api->ProgramUniformMatrix2x3fv = loadProc("glProgramUniformMatrix2x3fv"); - api->ProgramUniformMatrix3x2fv = loadProc("glProgramUniformMatrix3x2fv"); - api->ProgramUniformMatrix2x4fv = loadProc("glProgramUniformMatrix2x4fv"); - api->ProgramUniformMatrix4x2fv = loadProc("glProgramUniformMatrix4x2fv"); - api->ProgramUniformMatrix3x4fv = loadProc("glProgramUniformMatrix3x4fv"); - api->ProgramUniformMatrix4x3fv = loadProc("glProgramUniformMatrix4x3fv"); - api->ProgramUniformMatrix2x3dv = loadProc("glProgramUniformMatrix2x3dv"); - api->ProgramUniformMatrix3x2dv = loadProc("glProgramUniformMatrix3x2dv"); - api->ProgramUniformMatrix2x4dv = loadProc("glProgramUniformMatrix2x4dv"); - api->ProgramUniformMatrix4x2dv = loadProc("glProgramUniformMatrix4x2dv"); - api->ProgramUniformMatrix3x4dv = loadProc("glProgramUniformMatrix3x4dv"); - api->ProgramUniformMatrix4x3dv = loadProc("glProgramUniformMatrix4x3dv"); - api->ValidateProgramPipeline = loadProc("glValidateProgramPipeline"); - api->GetProgramPipelineInfoLog = loadProc("glGetProgramPipelineInfoLog"); - api->VertexAttribL1d = loadProc("glVertexAttribL1d"); - api->VertexAttribL2d = loadProc("glVertexAttribL2d"); - api->VertexAttribL3d = loadProc("glVertexAttribL3d"); - api->VertexAttribL4d = loadProc("glVertexAttribL4d"); - api->VertexAttribL1dv = loadProc("glVertexAttribL1dv"); - api->VertexAttribL2dv = loadProc("glVertexAttribL2dv"); - api->VertexAttribL3dv = loadProc("glVertexAttribL3dv"); - api->VertexAttribL4dv = loadProc("glVertexAttribL4dv"); - api->VertexAttribLPointer = loadProc("glVertexAttribLPointer"); - api->GetVertexAttribLdv = loadProc("glGetVertexAttribLdv"); - api->ViewportArrayv = loadProc("glViewportArrayv"); - api->ViewportIndexedf = loadProc("glViewportIndexedf"); - api->ViewportIndexedfv = loadProc("glViewportIndexedfv"); - api->ScissorArrayv = loadProc("glScissorArrayv"); - api->ScissorIndexed = loadProc("glScissorIndexed"); - api->ScissorIndexedv = loadProc("glScissorIndexedv"); - api->DepthRangeArrayv = loadProc("glDepthRangeArrayv"); - api->DepthRangeIndexed = loadProc("glDepthRangeIndexed"); - api->GetFloati_v = loadProc("glGetFloati_v"); - api->GetDoublei_v = loadProc("glGetDoublei_v"); - api->DrawArraysInstancedBaseInstance = loadProc("glDrawArraysInstancedBaseInstance"); - api->DrawElementsInstancedBaseInstance = loadProc("glDrawElementsInstancedBaseInstance"); - api->DrawElementsInstancedBaseVertexBaseInstance = loadProc("glDrawElementsInstancedBaseVertexBaseInstance"); - api->GetInternalformativ = loadProc("glGetInternalformativ"); - api->GetActiveAtomicCounterBufferiv = loadProc("glGetActiveAtomicCounterBufferiv"); - api->BindImageTexture = loadProc("glBindImageTexture"); - api->MemoryBarrier = loadProc("glMemoryBarrier"); - api->TexStorage1D = loadProc("glTexStorage1D"); - api->TexStorage2D = loadProc("glTexStorage2D"); - api->TexStorage3D = loadProc("glTexStorage3D"); - api->DrawTransformFeedbackInstanced = loadProc("glDrawTransformFeedbackInstanced"); - api->DrawTransformFeedbackStreamInstanced = loadProc("glDrawTransformFeedbackStreamInstanced"); - api->ClearBufferData = loadProc("glClearBufferData"); - api->ClearBufferSubData = loadProc("glClearBufferSubData"); - api->DispatchCompute = loadProc("glDispatchCompute"); - api->DispatchComputeIndirect = loadProc("glDispatchComputeIndirect"); - api->CopyImageSubData = loadProc("glCopyImageSubData"); - api->FramebufferParameteri = loadProc("glFramebufferParameteri"); - api->GetFramebufferParameteriv = loadProc("glGetFramebufferParameteriv"); - api->GetInternalformati64v = loadProc("glGetInternalformati64v"); - api->InvalidateTexSubImage = loadProc("glInvalidateTexSubImage"); - api->InvalidateTexImage = loadProc("glInvalidateTexImage"); - api->InvalidateBufferSubData = loadProc("glInvalidateBufferSubData"); - api->InvalidateBufferData = loadProc("glInvalidateBufferData"); - api->InvalidateFramebuffer = loadProc("glInvalidateFramebuffer"); - api->InvalidateSubFramebuffer = loadProc("glInvalidateSubFramebuffer"); - api->MultiDrawArraysIndirect = loadProc("glMultiDrawArraysIndirect"); - api->MultiDrawElementsIndirect = loadProc("glMultiDrawElementsIndirect"); - api->GetProgramInterfaceiv = loadProc("glGetProgramInterfaceiv"); - api->GetProgramResourceIndex = loadProc("glGetProgramResourceIndex"); - api->GetProgramResourceName = loadProc("glGetProgramResourceName"); - api->GetProgramResourceiv = loadProc("glGetProgramResourceiv"); - api->GetProgramResourceLocation = loadProc("glGetProgramResourceLocation"); - api->GetProgramResourceLocationIndex = loadProc("glGetProgramResourceLocationIndex"); - api->ShaderStorageBlockBinding = loadProc("glShaderStorageBlockBinding"); - api->TexBufferRange = loadProc("glTexBufferRange"); - api->TexStorage2DMultisample = loadProc("glTexStorage2DMultisample"); - api->TexStorage3DMultisample = loadProc("glTexStorage3DMultisample"); - api->TextureView = loadProc("glTextureView"); - api->BindVertexBuffer = loadProc("glBindVertexBuffer"); - api->VertexAttribFormat = loadProc("glVertexAttribFormat"); - api->VertexAttribIFormat = loadProc("glVertexAttribIFormat"); - api->VertexAttribLFormat = loadProc("glVertexAttribLFormat"); - api->VertexAttribBinding = loadProc("glVertexAttribBinding"); - api->VertexBindingDivisor = loadProc("glVertexBindingDivisor"); - api->DebugMessageControl = loadProc("glDebugMessageControl"); - api->DebugMessageInsert = loadProc("glDebugMessageInsert"); - api->DebugMessageCallback = loadProc("glDebugMessageCallback"); - api->GetDebugMessageLog = loadProc("glGetDebugMessageLog"); - api->PushDebugGroup = loadProc("glPushDebugGroup"); - api->PopDebugGroup = loadProc("glPopDebugGroup"); - api->ObjectLabel = loadProc("glObjectLabel"); - api->GetObjectLabel = loadProc("glGetObjectLabel"); - api->ObjectPtrLabel = loadProc("glObjectPtrLabel"); - api->GetObjectPtrLabel = loadProc("glGetObjectPtrLabel"); - api->GetPointerv = loadProc("glGetPointerv"); -} - -void mg_gl_load_gles30(mg_gl_api* api, mg_gl_load_proc loadProc) -{ - api->ActiveTexture = loadProc("glActiveTexture"); - api->AttachShader = loadProc("glAttachShader"); - api->BindAttribLocation = loadProc("glBindAttribLocation"); - api->BindBuffer = loadProc("glBindBuffer"); - api->BindFramebuffer = loadProc("glBindFramebuffer"); - api->BindRenderbuffer = loadProc("glBindRenderbuffer"); - api->BindTexture = loadProc("glBindTexture"); - api->BlendColor = loadProc("glBlendColor"); - api->BlendEquation = loadProc("glBlendEquation"); - api->BlendEquationSeparate = loadProc("glBlendEquationSeparate"); - api->BlendFunc = loadProc("glBlendFunc"); - api->BlendFuncSeparate = loadProc("glBlendFuncSeparate"); - api->BufferData = loadProc("glBufferData"); - api->BufferSubData = loadProc("glBufferSubData"); - api->CheckFramebufferStatus = loadProc("glCheckFramebufferStatus"); - api->Clear = loadProc("glClear"); - api->ClearColor = loadProc("glClearColor"); - api->ClearDepthf = loadProc("glClearDepthf"); - api->ClearStencil = loadProc("glClearStencil"); - api->ColorMask = loadProc("glColorMask"); - api->CompileShader = loadProc("glCompileShader"); - api->CompressedTexImage2D = loadProc("glCompressedTexImage2D"); - api->CompressedTexSubImage2D = loadProc("glCompressedTexSubImage2D"); - api->CopyTexImage2D = loadProc("glCopyTexImage2D"); - api->CopyTexSubImage2D = loadProc("glCopyTexSubImage2D"); - api->CreateProgram = loadProc("glCreateProgram"); - api->CreateShader = loadProc("glCreateShader"); - api->CullFace = loadProc("glCullFace"); - api->DeleteBuffers = loadProc("glDeleteBuffers"); - api->DeleteFramebuffers = loadProc("glDeleteFramebuffers"); - api->DeleteProgram = loadProc("glDeleteProgram"); - api->DeleteRenderbuffers = loadProc("glDeleteRenderbuffers"); - api->DeleteShader = loadProc("glDeleteShader"); - api->DeleteTextures = loadProc("glDeleteTextures"); - api->DepthFunc = loadProc("glDepthFunc"); - api->DepthMask = loadProc("glDepthMask"); - api->DepthRangef = loadProc("glDepthRangef"); - api->DetachShader = loadProc("glDetachShader"); - api->Disable = loadProc("glDisable"); - api->DisableVertexAttribArray = loadProc("glDisableVertexAttribArray"); - api->DrawArrays = loadProc("glDrawArrays"); - api->DrawElements = loadProc("glDrawElements"); - api->Enable = loadProc("glEnable"); - api->EnableVertexAttribArray = loadProc("glEnableVertexAttribArray"); - api->Finish = loadProc("glFinish"); - api->Flush = loadProc("glFlush"); - api->FramebufferRenderbuffer = loadProc("glFramebufferRenderbuffer"); - api->FramebufferTexture2D = loadProc("glFramebufferTexture2D"); - api->FrontFace = loadProc("glFrontFace"); - api->GenBuffers = loadProc("glGenBuffers"); - api->GenerateMipmap = loadProc("glGenerateMipmap"); - api->GenFramebuffers = loadProc("glGenFramebuffers"); - api->GenRenderbuffers = loadProc("glGenRenderbuffers"); - api->GenTextures = loadProc("glGenTextures"); - api->GetActiveAttrib = loadProc("glGetActiveAttrib"); - api->GetActiveUniform = loadProc("glGetActiveUniform"); - api->GetAttachedShaders = loadProc("glGetAttachedShaders"); - api->GetAttribLocation = loadProc("glGetAttribLocation"); - api->GetBooleanv = loadProc("glGetBooleanv"); - api->GetBufferParameteriv = loadProc("glGetBufferParameteriv"); - api->GetError = loadProc("glGetError"); - api->GetFloatv = loadProc("glGetFloatv"); - api->GetFramebufferAttachmentParameteriv = loadProc("glGetFramebufferAttachmentParameteriv"); - api->GetIntegerv = loadProc("glGetIntegerv"); - api->GetProgramiv = loadProc("glGetProgramiv"); - api->GetProgramInfoLog = loadProc("glGetProgramInfoLog"); - api->GetRenderbufferParameteriv = loadProc("glGetRenderbufferParameteriv"); - api->GetShaderiv = loadProc("glGetShaderiv"); - api->GetShaderInfoLog = loadProc("glGetShaderInfoLog"); - api->GetShaderPrecisionFormat = loadProc("glGetShaderPrecisionFormat"); - api->GetShaderSource = loadProc("glGetShaderSource"); - api->GetString = loadProc("glGetString"); - api->GetTexParameterfv = loadProc("glGetTexParameterfv"); - api->GetTexParameteriv = loadProc("glGetTexParameteriv"); - api->GetUniformfv = loadProc("glGetUniformfv"); - api->GetUniformiv = loadProc("glGetUniformiv"); - api->GetUniformLocation = loadProc("glGetUniformLocation"); - api->GetVertexAttribfv = loadProc("glGetVertexAttribfv"); - api->GetVertexAttribiv = loadProc("glGetVertexAttribiv"); - api->GetVertexAttribPointerv = loadProc("glGetVertexAttribPointerv"); - api->Hint = loadProc("glHint"); - api->IsBuffer = loadProc("glIsBuffer"); - api->IsEnabled = loadProc("glIsEnabled"); - api->IsFramebuffer = loadProc("glIsFramebuffer"); - api->IsProgram = loadProc("glIsProgram"); - api->IsRenderbuffer = loadProc("glIsRenderbuffer"); - api->IsShader = loadProc("glIsShader"); - api->IsTexture = loadProc("glIsTexture"); - api->LineWidth = loadProc("glLineWidth"); - api->LinkProgram = loadProc("glLinkProgram"); - api->PixelStorei = loadProc("glPixelStorei"); - api->PolygonOffset = loadProc("glPolygonOffset"); - api->ReadPixels = loadProc("glReadPixels"); - api->ReleaseShaderCompiler = loadProc("glReleaseShaderCompiler"); - api->RenderbufferStorage = loadProc("glRenderbufferStorage"); - api->SampleCoverage = loadProc("glSampleCoverage"); - api->Scissor = loadProc("glScissor"); - api->ShaderBinary = loadProc("glShaderBinary"); - api->ShaderSource = loadProc("glShaderSource"); - api->StencilFunc = loadProc("glStencilFunc"); - api->StencilFuncSeparate = loadProc("glStencilFuncSeparate"); - api->StencilMask = loadProc("glStencilMask"); - api->StencilMaskSeparate = loadProc("glStencilMaskSeparate"); - api->StencilOp = loadProc("glStencilOp"); - api->StencilOpSeparate = loadProc("glStencilOpSeparate"); - api->TexImage2D = loadProc("glTexImage2D"); - api->TexParameterf = loadProc("glTexParameterf"); - api->TexParameterfv = loadProc("glTexParameterfv"); - api->TexParameteri = loadProc("glTexParameteri"); - api->TexParameteriv = loadProc("glTexParameteriv"); - api->TexSubImage2D = loadProc("glTexSubImage2D"); - api->Uniform1f = loadProc("glUniform1f"); - api->Uniform1fv = loadProc("glUniform1fv"); - api->Uniform1i = loadProc("glUniform1i"); - api->Uniform1iv = loadProc("glUniform1iv"); - api->Uniform2f = loadProc("glUniform2f"); - api->Uniform2fv = loadProc("glUniform2fv"); - api->Uniform2i = loadProc("glUniform2i"); - api->Uniform2iv = loadProc("glUniform2iv"); - api->Uniform3f = loadProc("glUniform3f"); - api->Uniform3fv = loadProc("glUniform3fv"); - api->Uniform3i = loadProc("glUniform3i"); - api->Uniform3iv = loadProc("glUniform3iv"); - api->Uniform4f = loadProc("glUniform4f"); - api->Uniform4fv = loadProc("glUniform4fv"); - api->Uniform4i = loadProc("glUniform4i"); - api->Uniform4iv = loadProc("glUniform4iv"); - api->UniformMatrix2fv = loadProc("glUniformMatrix2fv"); - api->UniformMatrix3fv = loadProc("glUniformMatrix3fv"); - api->UniformMatrix4fv = loadProc("glUniformMatrix4fv"); - api->UseProgram = loadProc("glUseProgram"); - api->ValidateProgram = loadProc("glValidateProgram"); - api->VertexAttrib1f = loadProc("glVertexAttrib1f"); - api->VertexAttrib1fv = loadProc("glVertexAttrib1fv"); - api->VertexAttrib2f = loadProc("glVertexAttrib2f"); - api->VertexAttrib2fv = loadProc("glVertexAttrib2fv"); - api->VertexAttrib3f = loadProc("glVertexAttrib3f"); - api->VertexAttrib3fv = loadProc("glVertexAttrib3fv"); - api->VertexAttrib4f = loadProc("glVertexAttrib4f"); - api->VertexAttrib4fv = loadProc("glVertexAttrib4fv"); - api->VertexAttribPointer = loadProc("glVertexAttribPointer"); - api->Viewport = loadProc("glViewport"); - api->ReadBuffer = loadProc("glReadBuffer"); - api->DrawRangeElements = loadProc("glDrawRangeElements"); - api->TexImage3D = loadProc("glTexImage3D"); - api->TexSubImage3D = loadProc("glTexSubImage3D"); - api->CopyTexSubImage3D = loadProc("glCopyTexSubImage3D"); - api->CompressedTexImage3D = loadProc("glCompressedTexImage3D"); - api->CompressedTexSubImage3D = loadProc("glCompressedTexSubImage3D"); - api->GenQueries = loadProc("glGenQueries"); - api->DeleteQueries = loadProc("glDeleteQueries"); - api->IsQuery = loadProc("glIsQuery"); - api->BeginQuery = loadProc("glBeginQuery"); - api->EndQuery = loadProc("glEndQuery"); - api->GetQueryiv = loadProc("glGetQueryiv"); - api->GetQueryObjectuiv = loadProc("glGetQueryObjectuiv"); - api->UnmapBuffer = loadProc("glUnmapBuffer"); - api->GetBufferPointerv = loadProc("glGetBufferPointerv"); - api->DrawBuffers = loadProc("glDrawBuffers"); - api->UniformMatrix2x3fv = loadProc("glUniformMatrix2x3fv"); - api->UniformMatrix3x2fv = loadProc("glUniformMatrix3x2fv"); - api->UniformMatrix2x4fv = loadProc("glUniformMatrix2x4fv"); - api->UniformMatrix4x2fv = loadProc("glUniformMatrix4x2fv"); - api->UniformMatrix3x4fv = loadProc("glUniformMatrix3x4fv"); - api->UniformMatrix4x3fv = loadProc("glUniformMatrix4x3fv"); - api->BlitFramebuffer = loadProc("glBlitFramebuffer"); - api->RenderbufferStorageMultisample = loadProc("glRenderbufferStorageMultisample"); - api->FramebufferTextureLayer = loadProc("glFramebufferTextureLayer"); - api->MapBufferRange = loadProc("glMapBufferRange"); - api->FlushMappedBufferRange = loadProc("glFlushMappedBufferRange"); - api->BindVertexArray = loadProc("glBindVertexArray"); - api->DeleteVertexArrays = loadProc("glDeleteVertexArrays"); - api->GenVertexArrays = loadProc("glGenVertexArrays"); - api->IsVertexArray = loadProc("glIsVertexArray"); - api->GetIntegeri_v = loadProc("glGetIntegeri_v"); - api->BeginTransformFeedback = loadProc("glBeginTransformFeedback"); - api->EndTransformFeedback = loadProc("glEndTransformFeedback"); - api->BindBufferRange = loadProc("glBindBufferRange"); - api->BindBufferBase = loadProc("glBindBufferBase"); - api->TransformFeedbackVaryings = loadProc("glTransformFeedbackVaryings"); - api->GetTransformFeedbackVarying = loadProc("glGetTransformFeedbackVarying"); - api->VertexAttribIPointer = loadProc("glVertexAttribIPointer"); - api->GetVertexAttribIiv = loadProc("glGetVertexAttribIiv"); - api->GetVertexAttribIuiv = loadProc("glGetVertexAttribIuiv"); - api->VertexAttribI4i = loadProc("glVertexAttribI4i"); - api->VertexAttribI4ui = loadProc("glVertexAttribI4ui"); - api->VertexAttribI4iv = loadProc("glVertexAttribI4iv"); - api->VertexAttribI4uiv = loadProc("glVertexAttribI4uiv"); - api->GetUniformuiv = loadProc("glGetUniformuiv"); - api->GetFragDataLocation = loadProc("glGetFragDataLocation"); - api->Uniform1ui = loadProc("glUniform1ui"); - api->Uniform2ui = loadProc("glUniform2ui"); - api->Uniform3ui = loadProc("glUniform3ui"); - api->Uniform4ui = loadProc("glUniform4ui"); - api->Uniform1uiv = loadProc("glUniform1uiv"); - api->Uniform2uiv = loadProc("glUniform2uiv"); - api->Uniform3uiv = loadProc("glUniform3uiv"); - api->Uniform4uiv = loadProc("glUniform4uiv"); - api->ClearBufferiv = loadProc("glClearBufferiv"); - api->ClearBufferuiv = loadProc("glClearBufferuiv"); - api->ClearBufferfv = loadProc("glClearBufferfv"); - api->ClearBufferfi = loadProc("glClearBufferfi"); - api->GetStringi = loadProc("glGetStringi"); - api->CopyBufferSubData = loadProc("glCopyBufferSubData"); - api->GetUniformIndices = loadProc("glGetUniformIndices"); - api->GetActiveUniformsiv = loadProc("glGetActiveUniformsiv"); - api->GetUniformBlockIndex = loadProc("glGetUniformBlockIndex"); - api->GetActiveUniformBlockiv = loadProc("glGetActiveUniformBlockiv"); - api->GetActiveUniformBlockName = loadProc("glGetActiveUniformBlockName"); - api->UniformBlockBinding = loadProc("glUniformBlockBinding"); - api->DrawArraysInstanced = loadProc("glDrawArraysInstanced"); - api->DrawElementsInstanced = loadProc("glDrawElementsInstanced"); - api->FenceSync = loadProc("glFenceSync"); - api->IsSync = loadProc("glIsSync"); - api->DeleteSync = loadProc("glDeleteSync"); - api->ClientWaitSync = loadProc("glClientWaitSync"); - api->WaitSync = loadProc("glWaitSync"); - api->GetInteger64v = loadProc("glGetInteger64v"); - api->GetSynciv = loadProc("glGetSynciv"); - api->GetInteger64i_v = loadProc("glGetInteger64i_v"); - api->GetBufferParameteri64v = loadProc("glGetBufferParameteri64v"); - api->GenSamplers = loadProc("glGenSamplers"); - api->DeleteSamplers = loadProc("glDeleteSamplers"); - api->IsSampler = loadProc("glIsSampler"); - api->BindSampler = loadProc("glBindSampler"); - api->SamplerParameteri = loadProc("glSamplerParameteri"); - api->SamplerParameteriv = loadProc("glSamplerParameteriv"); - api->SamplerParameterf = loadProc("glSamplerParameterf"); - api->SamplerParameterfv = loadProc("glSamplerParameterfv"); - api->GetSamplerParameteriv = loadProc("glGetSamplerParameteriv"); - api->GetSamplerParameterfv = loadProc("glGetSamplerParameterfv"); - api->VertexAttribDivisor = loadProc("glVertexAttribDivisor"); - api->BindTransformFeedback = loadProc("glBindTransformFeedback"); - api->DeleteTransformFeedbacks = loadProc("glDeleteTransformFeedbacks"); - api->GenTransformFeedbacks = loadProc("glGenTransformFeedbacks"); - api->IsTransformFeedback = loadProc("glIsTransformFeedback"); - api->PauseTransformFeedback = loadProc("glPauseTransformFeedback"); - api->ResumeTransformFeedback = loadProc("glResumeTransformFeedback"); - api->GetProgramBinary = loadProc("glGetProgramBinary"); - api->ProgramBinary = loadProc("glProgramBinary"); - api->ProgramParameteri = loadProc("glProgramParameteri"); - api->InvalidateFramebuffer = loadProc("glInvalidateFramebuffer"); - api->InvalidateSubFramebuffer = loadProc("glInvalidateSubFramebuffer"); - api->TexStorage2D = loadProc("glTexStorage2D"); - api->TexStorage3D = loadProc("glTexStorage3D"); - api->GetInternalformativ = loadProc("glGetInternalformativ"); - api->DispatchCompute = loadProc("glDispatchCompute"); - api->DispatchComputeIndirect = loadProc("glDispatchComputeIndirect"); - api->DrawArraysIndirect = loadProc("glDrawArraysIndirect"); - api->DrawElementsIndirect = loadProc("glDrawElementsIndirect"); - api->FramebufferParameteri = loadProc("glFramebufferParameteri"); - api->GetFramebufferParameteriv = loadProc("glGetFramebufferParameteriv"); - api->GetProgramInterfaceiv = loadProc("glGetProgramInterfaceiv"); - api->GetProgramResourceIndex = loadProc("glGetProgramResourceIndex"); - api->GetProgramResourceName = loadProc("glGetProgramResourceName"); - api->GetProgramResourceiv = loadProc("glGetProgramResourceiv"); - api->GetProgramResourceLocation = loadProc("glGetProgramResourceLocation"); - api->UseProgramStages = loadProc("glUseProgramStages"); - api->ActiveShaderProgram = loadProc("glActiveShaderProgram"); - api->CreateShaderProgramv = loadProc("glCreateShaderProgramv"); - api->BindProgramPipeline = loadProc("glBindProgramPipeline"); - api->DeleteProgramPipelines = loadProc("glDeleteProgramPipelines"); - api->GenProgramPipelines = loadProc("glGenProgramPipelines"); - api->IsProgramPipeline = loadProc("glIsProgramPipeline"); - api->GetProgramPipelineiv = loadProc("glGetProgramPipelineiv"); - api->ProgramUniform1i = loadProc("glProgramUniform1i"); - api->ProgramUniform2i = loadProc("glProgramUniform2i"); - api->ProgramUniform3i = loadProc("glProgramUniform3i"); - api->ProgramUniform4i = loadProc("glProgramUniform4i"); - api->ProgramUniform1ui = loadProc("glProgramUniform1ui"); - api->ProgramUniform2ui = loadProc("glProgramUniform2ui"); - api->ProgramUniform3ui = loadProc("glProgramUniform3ui"); - api->ProgramUniform4ui = loadProc("glProgramUniform4ui"); - api->ProgramUniform1f = loadProc("glProgramUniform1f"); - api->ProgramUniform2f = loadProc("glProgramUniform2f"); - api->ProgramUniform3f = loadProc("glProgramUniform3f"); - api->ProgramUniform4f = loadProc("glProgramUniform4f"); - api->ProgramUniform1iv = loadProc("glProgramUniform1iv"); - api->ProgramUniform2iv = loadProc("glProgramUniform2iv"); - api->ProgramUniform3iv = loadProc("glProgramUniform3iv"); - api->ProgramUniform4iv = loadProc("glProgramUniform4iv"); - api->ProgramUniform1uiv = loadProc("glProgramUniform1uiv"); - api->ProgramUniform2uiv = loadProc("glProgramUniform2uiv"); - api->ProgramUniform3uiv = loadProc("glProgramUniform3uiv"); - api->ProgramUniform4uiv = loadProc("glProgramUniform4uiv"); - api->ProgramUniform1fv = loadProc("glProgramUniform1fv"); - api->ProgramUniform2fv = loadProc("glProgramUniform2fv"); - api->ProgramUniform3fv = loadProc("glProgramUniform3fv"); - api->ProgramUniform4fv = loadProc("glProgramUniform4fv"); - api->ProgramUniformMatrix2fv = loadProc("glProgramUniformMatrix2fv"); - api->ProgramUniformMatrix3fv = loadProc("glProgramUniformMatrix3fv"); - api->ProgramUniformMatrix4fv = loadProc("glProgramUniformMatrix4fv"); - api->ProgramUniformMatrix2x3fv = loadProc("glProgramUniformMatrix2x3fv"); - api->ProgramUniformMatrix3x2fv = loadProc("glProgramUniformMatrix3x2fv"); - api->ProgramUniformMatrix2x4fv = loadProc("glProgramUniformMatrix2x4fv"); - api->ProgramUniformMatrix4x2fv = loadProc("glProgramUniformMatrix4x2fv"); - api->ProgramUniformMatrix3x4fv = loadProc("glProgramUniformMatrix3x4fv"); - api->ProgramUniformMatrix4x3fv = loadProc("glProgramUniformMatrix4x3fv"); - api->ValidateProgramPipeline = loadProc("glValidateProgramPipeline"); - api->GetProgramPipelineInfoLog = loadProc("glGetProgramPipelineInfoLog"); - api->BindImageTexture = loadProc("glBindImageTexture"); - api->GetBooleani_v = loadProc("glGetBooleani_v"); - api->MemoryBarrier = loadProc("glMemoryBarrier"); - api->MemoryBarrierByRegion = loadProc("glMemoryBarrierByRegion"); - api->TexStorage2DMultisample = loadProc("glTexStorage2DMultisample"); - api->GetMultisamplefv = loadProc("glGetMultisamplefv"); - api->SampleMaski = loadProc("glSampleMaski"); - api->GetTexLevelParameteriv = loadProc("glGetTexLevelParameteriv"); - api->GetTexLevelParameterfv = loadProc("glGetTexLevelParameterfv"); - api->BindVertexBuffer = loadProc("glBindVertexBuffer"); - api->VertexAttribFormat = loadProc("glVertexAttribFormat"); - api->VertexAttribIFormat = loadProc("glVertexAttribIFormat"); - api->VertexAttribBinding = loadProc("glVertexAttribBinding"); - api->VertexBindingDivisor = loadProc("glVertexBindingDivisor"); -} - -void mg_gl_load_gles31(mg_gl_api* api, mg_gl_load_proc loadProc) -{ - api->ActiveTexture = loadProc("glActiveTexture"); - api->AttachShader = loadProc("glAttachShader"); - api->BindAttribLocation = loadProc("glBindAttribLocation"); - api->BindBuffer = loadProc("glBindBuffer"); - api->BindFramebuffer = loadProc("glBindFramebuffer"); - api->BindRenderbuffer = loadProc("glBindRenderbuffer"); - api->BindTexture = loadProc("glBindTexture"); - api->BlendColor = loadProc("glBlendColor"); - api->BlendEquation = loadProc("glBlendEquation"); - api->BlendEquationSeparate = loadProc("glBlendEquationSeparate"); - api->BlendFunc = loadProc("glBlendFunc"); - api->BlendFuncSeparate = loadProc("glBlendFuncSeparate"); - api->BufferData = loadProc("glBufferData"); - api->BufferSubData = loadProc("glBufferSubData"); - api->CheckFramebufferStatus = loadProc("glCheckFramebufferStatus"); - api->Clear = loadProc("glClear"); - api->ClearColor = loadProc("glClearColor"); - api->ClearDepthf = loadProc("glClearDepthf"); - api->ClearStencil = loadProc("glClearStencil"); - api->ColorMask = loadProc("glColorMask"); - api->CompileShader = loadProc("glCompileShader"); - api->CompressedTexImage2D = loadProc("glCompressedTexImage2D"); - api->CompressedTexSubImage2D = loadProc("glCompressedTexSubImage2D"); - api->CopyTexImage2D = loadProc("glCopyTexImage2D"); - api->CopyTexSubImage2D = loadProc("glCopyTexSubImage2D"); - api->CreateProgram = loadProc("glCreateProgram"); - api->CreateShader = loadProc("glCreateShader"); - api->CullFace = loadProc("glCullFace"); - api->DeleteBuffers = loadProc("glDeleteBuffers"); - api->DeleteFramebuffers = loadProc("glDeleteFramebuffers"); - api->DeleteProgram = loadProc("glDeleteProgram"); - api->DeleteRenderbuffers = loadProc("glDeleteRenderbuffers"); - api->DeleteShader = loadProc("glDeleteShader"); - api->DeleteTextures = loadProc("glDeleteTextures"); - api->DepthFunc = loadProc("glDepthFunc"); - api->DepthMask = loadProc("glDepthMask"); - api->DepthRangef = loadProc("glDepthRangef"); - api->DetachShader = loadProc("glDetachShader"); - api->Disable = loadProc("glDisable"); - api->DisableVertexAttribArray = loadProc("glDisableVertexAttribArray"); - api->DrawArrays = loadProc("glDrawArrays"); - api->DrawElements = loadProc("glDrawElements"); - api->Enable = loadProc("glEnable"); - api->EnableVertexAttribArray = loadProc("glEnableVertexAttribArray"); - api->Finish = loadProc("glFinish"); - api->Flush = loadProc("glFlush"); - api->FramebufferRenderbuffer = loadProc("glFramebufferRenderbuffer"); - api->FramebufferTexture2D = loadProc("glFramebufferTexture2D"); - api->FrontFace = loadProc("glFrontFace"); - api->GenBuffers = loadProc("glGenBuffers"); - api->GenerateMipmap = loadProc("glGenerateMipmap"); - api->GenFramebuffers = loadProc("glGenFramebuffers"); - api->GenRenderbuffers = loadProc("glGenRenderbuffers"); - api->GenTextures = loadProc("glGenTextures"); - api->GetActiveAttrib = loadProc("glGetActiveAttrib"); - api->GetActiveUniform = loadProc("glGetActiveUniform"); - api->GetAttachedShaders = loadProc("glGetAttachedShaders"); - api->GetAttribLocation = loadProc("glGetAttribLocation"); - api->GetBooleanv = loadProc("glGetBooleanv"); - api->GetBufferParameteriv = loadProc("glGetBufferParameteriv"); - api->GetError = loadProc("glGetError"); - api->GetFloatv = loadProc("glGetFloatv"); - api->GetFramebufferAttachmentParameteriv = loadProc("glGetFramebufferAttachmentParameteriv"); - api->GetIntegerv = loadProc("glGetIntegerv"); - api->GetProgramiv = loadProc("glGetProgramiv"); - api->GetProgramInfoLog = loadProc("glGetProgramInfoLog"); - api->GetRenderbufferParameteriv = loadProc("glGetRenderbufferParameteriv"); - api->GetShaderiv = loadProc("glGetShaderiv"); - api->GetShaderInfoLog = loadProc("glGetShaderInfoLog"); - api->GetShaderPrecisionFormat = loadProc("glGetShaderPrecisionFormat"); - api->GetShaderSource = loadProc("glGetShaderSource"); - api->GetString = loadProc("glGetString"); - api->GetTexParameterfv = loadProc("glGetTexParameterfv"); - api->GetTexParameteriv = loadProc("glGetTexParameteriv"); - api->GetUniformfv = loadProc("glGetUniformfv"); - api->GetUniformiv = loadProc("glGetUniformiv"); - api->GetUniformLocation = loadProc("glGetUniformLocation"); - api->GetVertexAttribfv = loadProc("glGetVertexAttribfv"); - api->GetVertexAttribiv = loadProc("glGetVertexAttribiv"); - api->GetVertexAttribPointerv = loadProc("glGetVertexAttribPointerv"); - api->Hint = loadProc("glHint"); - api->IsBuffer = loadProc("glIsBuffer"); - api->IsEnabled = loadProc("glIsEnabled"); - api->IsFramebuffer = loadProc("glIsFramebuffer"); - api->IsProgram = loadProc("glIsProgram"); - api->IsRenderbuffer = loadProc("glIsRenderbuffer"); - api->IsShader = loadProc("glIsShader"); - api->IsTexture = loadProc("glIsTexture"); - api->LineWidth = loadProc("glLineWidth"); - api->LinkProgram = loadProc("glLinkProgram"); - api->PixelStorei = loadProc("glPixelStorei"); - api->PolygonOffset = loadProc("glPolygonOffset"); - api->ReadPixels = loadProc("glReadPixels"); - api->ReleaseShaderCompiler = loadProc("glReleaseShaderCompiler"); - api->RenderbufferStorage = loadProc("glRenderbufferStorage"); - api->SampleCoverage = loadProc("glSampleCoverage"); - api->Scissor = loadProc("glScissor"); - api->ShaderBinary = loadProc("glShaderBinary"); - api->ShaderSource = loadProc("glShaderSource"); - api->StencilFunc = loadProc("glStencilFunc"); - api->StencilFuncSeparate = loadProc("glStencilFuncSeparate"); - api->StencilMask = loadProc("glStencilMask"); - api->StencilMaskSeparate = loadProc("glStencilMaskSeparate"); - api->StencilOp = loadProc("glStencilOp"); - api->StencilOpSeparate = loadProc("glStencilOpSeparate"); - api->TexImage2D = loadProc("glTexImage2D"); - api->TexParameterf = loadProc("glTexParameterf"); - api->TexParameterfv = loadProc("glTexParameterfv"); - api->TexParameteri = loadProc("glTexParameteri"); - api->TexParameteriv = loadProc("glTexParameteriv"); - api->TexSubImage2D = loadProc("glTexSubImage2D"); - api->Uniform1f = loadProc("glUniform1f"); - api->Uniform1fv = loadProc("glUniform1fv"); - api->Uniform1i = loadProc("glUniform1i"); - api->Uniform1iv = loadProc("glUniform1iv"); - api->Uniform2f = loadProc("glUniform2f"); - api->Uniform2fv = loadProc("glUniform2fv"); - api->Uniform2i = loadProc("glUniform2i"); - api->Uniform2iv = loadProc("glUniform2iv"); - api->Uniform3f = loadProc("glUniform3f"); - api->Uniform3fv = loadProc("glUniform3fv"); - api->Uniform3i = loadProc("glUniform3i"); - api->Uniform3iv = loadProc("glUniform3iv"); - api->Uniform4f = loadProc("glUniform4f"); - api->Uniform4fv = loadProc("glUniform4fv"); - api->Uniform4i = loadProc("glUniform4i"); - api->Uniform4iv = loadProc("glUniform4iv"); - api->UniformMatrix2fv = loadProc("glUniformMatrix2fv"); - api->UniformMatrix3fv = loadProc("glUniformMatrix3fv"); - api->UniformMatrix4fv = loadProc("glUniformMatrix4fv"); - api->UseProgram = loadProc("glUseProgram"); - api->ValidateProgram = loadProc("glValidateProgram"); - api->VertexAttrib1f = loadProc("glVertexAttrib1f"); - api->VertexAttrib1fv = loadProc("glVertexAttrib1fv"); - api->VertexAttrib2f = loadProc("glVertexAttrib2f"); - api->VertexAttrib2fv = loadProc("glVertexAttrib2fv"); - api->VertexAttrib3f = loadProc("glVertexAttrib3f"); - api->VertexAttrib3fv = loadProc("glVertexAttrib3fv"); - api->VertexAttrib4f = loadProc("glVertexAttrib4f"); - api->VertexAttrib4fv = loadProc("glVertexAttrib4fv"); - api->VertexAttribPointer = loadProc("glVertexAttribPointer"); - api->Viewport = loadProc("glViewport"); - api->ReadBuffer = loadProc("glReadBuffer"); - api->DrawRangeElements = loadProc("glDrawRangeElements"); - api->TexImage3D = loadProc("glTexImage3D"); - api->TexSubImage3D = loadProc("glTexSubImage3D"); - api->CopyTexSubImage3D = loadProc("glCopyTexSubImage3D"); - api->CompressedTexImage3D = loadProc("glCompressedTexImage3D"); - api->CompressedTexSubImage3D = loadProc("glCompressedTexSubImage3D"); - api->GenQueries = loadProc("glGenQueries"); - api->DeleteQueries = loadProc("glDeleteQueries"); - api->IsQuery = loadProc("glIsQuery"); - api->BeginQuery = loadProc("glBeginQuery"); - api->EndQuery = loadProc("glEndQuery"); - api->GetQueryiv = loadProc("glGetQueryiv"); - api->GetQueryObjectuiv = loadProc("glGetQueryObjectuiv"); - api->UnmapBuffer = loadProc("glUnmapBuffer"); - api->GetBufferPointerv = loadProc("glGetBufferPointerv"); - api->DrawBuffers = loadProc("glDrawBuffers"); - api->UniformMatrix2x3fv = loadProc("glUniformMatrix2x3fv"); - api->UniformMatrix3x2fv = loadProc("glUniformMatrix3x2fv"); - api->UniformMatrix2x4fv = loadProc("glUniformMatrix2x4fv"); - api->UniformMatrix4x2fv = loadProc("glUniformMatrix4x2fv"); - api->UniformMatrix3x4fv = loadProc("glUniformMatrix3x4fv"); - api->UniformMatrix4x3fv = loadProc("glUniformMatrix4x3fv"); - api->BlitFramebuffer = loadProc("glBlitFramebuffer"); - api->RenderbufferStorageMultisample = loadProc("glRenderbufferStorageMultisample"); - api->FramebufferTextureLayer = loadProc("glFramebufferTextureLayer"); - api->MapBufferRange = loadProc("glMapBufferRange"); - api->FlushMappedBufferRange = loadProc("glFlushMappedBufferRange"); - api->BindVertexArray = loadProc("glBindVertexArray"); - api->DeleteVertexArrays = loadProc("glDeleteVertexArrays"); - api->GenVertexArrays = loadProc("glGenVertexArrays"); - api->IsVertexArray = loadProc("glIsVertexArray"); - api->GetIntegeri_v = loadProc("glGetIntegeri_v"); - api->BeginTransformFeedback = loadProc("glBeginTransformFeedback"); - api->EndTransformFeedback = loadProc("glEndTransformFeedback"); - api->BindBufferRange = loadProc("glBindBufferRange"); - api->BindBufferBase = loadProc("glBindBufferBase"); - api->TransformFeedbackVaryings = loadProc("glTransformFeedbackVaryings"); - api->GetTransformFeedbackVarying = loadProc("glGetTransformFeedbackVarying"); - api->VertexAttribIPointer = loadProc("glVertexAttribIPointer"); - api->GetVertexAttribIiv = loadProc("glGetVertexAttribIiv"); - api->GetVertexAttribIuiv = loadProc("glGetVertexAttribIuiv"); - api->VertexAttribI4i = loadProc("glVertexAttribI4i"); - api->VertexAttribI4ui = loadProc("glVertexAttribI4ui"); - api->VertexAttribI4iv = loadProc("glVertexAttribI4iv"); - api->VertexAttribI4uiv = loadProc("glVertexAttribI4uiv"); - api->GetUniformuiv = loadProc("glGetUniformuiv"); - api->GetFragDataLocation = loadProc("glGetFragDataLocation"); - api->Uniform1ui = loadProc("glUniform1ui"); - api->Uniform2ui = loadProc("glUniform2ui"); - api->Uniform3ui = loadProc("glUniform3ui"); - api->Uniform4ui = loadProc("glUniform4ui"); - api->Uniform1uiv = loadProc("glUniform1uiv"); - api->Uniform2uiv = loadProc("glUniform2uiv"); - api->Uniform3uiv = loadProc("glUniform3uiv"); - api->Uniform4uiv = loadProc("glUniform4uiv"); - api->ClearBufferiv = loadProc("glClearBufferiv"); - api->ClearBufferuiv = loadProc("glClearBufferuiv"); - api->ClearBufferfv = loadProc("glClearBufferfv"); - api->ClearBufferfi = loadProc("glClearBufferfi"); - api->GetStringi = loadProc("glGetStringi"); - api->CopyBufferSubData = loadProc("glCopyBufferSubData"); - api->GetUniformIndices = loadProc("glGetUniformIndices"); - api->GetActiveUniformsiv = loadProc("glGetActiveUniformsiv"); - api->GetUniformBlockIndex = loadProc("glGetUniformBlockIndex"); - api->GetActiveUniformBlockiv = loadProc("glGetActiveUniformBlockiv"); - api->GetActiveUniformBlockName = loadProc("glGetActiveUniformBlockName"); - api->UniformBlockBinding = loadProc("glUniformBlockBinding"); - api->DrawArraysInstanced = loadProc("glDrawArraysInstanced"); - api->DrawElementsInstanced = loadProc("glDrawElementsInstanced"); - api->FenceSync = loadProc("glFenceSync"); - api->IsSync = loadProc("glIsSync"); - api->DeleteSync = loadProc("glDeleteSync"); - api->ClientWaitSync = loadProc("glClientWaitSync"); - api->WaitSync = loadProc("glWaitSync"); - api->GetInteger64v = loadProc("glGetInteger64v"); - api->GetSynciv = loadProc("glGetSynciv"); - api->GetInteger64i_v = loadProc("glGetInteger64i_v"); - api->GetBufferParameteri64v = loadProc("glGetBufferParameteri64v"); - api->GenSamplers = loadProc("glGenSamplers"); - api->DeleteSamplers = loadProc("glDeleteSamplers"); - api->IsSampler = loadProc("glIsSampler"); - api->BindSampler = loadProc("glBindSampler"); - api->SamplerParameteri = loadProc("glSamplerParameteri"); - api->SamplerParameteriv = loadProc("glSamplerParameteriv"); - api->SamplerParameterf = loadProc("glSamplerParameterf"); - api->SamplerParameterfv = loadProc("glSamplerParameterfv"); - api->GetSamplerParameteriv = loadProc("glGetSamplerParameteriv"); - api->GetSamplerParameterfv = loadProc("glGetSamplerParameterfv"); - api->VertexAttribDivisor = loadProc("glVertexAttribDivisor"); - api->BindTransformFeedback = loadProc("glBindTransformFeedback"); - api->DeleteTransformFeedbacks = loadProc("glDeleteTransformFeedbacks"); - api->GenTransformFeedbacks = loadProc("glGenTransformFeedbacks"); - api->IsTransformFeedback = loadProc("glIsTransformFeedback"); - api->PauseTransformFeedback = loadProc("glPauseTransformFeedback"); - api->ResumeTransformFeedback = loadProc("glResumeTransformFeedback"); - api->GetProgramBinary = loadProc("glGetProgramBinary"); - api->ProgramBinary = loadProc("glProgramBinary"); - api->ProgramParameteri = loadProc("glProgramParameteri"); - api->InvalidateFramebuffer = loadProc("glInvalidateFramebuffer"); - api->InvalidateSubFramebuffer = loadProc("glInvalidateSubFramebuffer"); - api->TexStorage2D = loadProc("glTexStorage2D"); - api->TexStorage3D = loadProc("glTexStorage3D"); - api->GetInternalformativ = loadProc("glGetInternalformativ"); - api->DispatchCompute = loadProc("glDispatchCompute"); - api->DispatchComputeIndirect = loadProc("glDispatchComputeIndirect"); - api->DrawArraysIndirect = loadProc("glDrawArraysIndirect"); - api->DrawElementsIndirect = loadProc("glDrawElementsIndirect"); - api->FramebufferParameteri = loadProc("glFramebufferParameteri"); - api->GetFramebufferParameteriv = loadProc("glGetFramebufferParameteriv"); - api->GetProgramInterfaceiv = loadProc("glGetProgramInterfaceiv"); - api->GetProgramResourceIndex = loadProc("glGetProgramResourceIndex"); - api->GetProgramResourceName = loadProc("glGetProgramResourceName"); - api->GetProgramResourceiv = loadProc("glGetProgramResourceiv"); - api->GetProgramResourceLocation = loadProc("glGetProgramResourceLocation"); - api->UseProgramStages = loadProc("glUseProgramStages"); - api->ActiveShaderProgram = loadProc("glActiveShaderProgram"); - api->CreateShaderProgramv = loadProc("glCreateShaderProgramv"); - api->BindProgramPipeline = loadProc("glBindProgramPipeline"); - api->DeleteProgramPipelines = loadProc("glDeleteProgramPipelines"); - api->GenProgramPipelines = loadProc("glGenProgramPipelines"); - api->IsProgramPipeline = loadProc("glIsProgramPipeline"); - api->GetProgramPipelineiv = loadProc("glGetProgramPipelineiv"); - api->ProgramUniform1i = loadProc("glProgramUniform1i"); - api->ProgramUniform2i = loadProc("glProgramUniform2i"); - api->ProgramUniform3i = loadProc("glProgramUniform3i"); - api->ProgramUniform4i = loadProc("glProgramUniform4i"); - api->ProgramUniform1ui = loadProc("glProgramUniform1ui"); - api->ProgramUniform2ui = loadProc("glProgramUniform2ui"); - api->ProgramUniform3ui = loadProc("glProgramUniform3ui"); - api->ProgramUniform4ui = loadProc("glProgramUniform4ui"); - api->ProgramUniform1f = loadProc("glProgramUniform1f"); - api->ProgramUniform2f = loadProc("glProgramUniform2f"); - api->ProgramUniform3f = loadProc("glProgramUniform3f"); - api->ProgramUniform4f = loadProc("glProgramUniform4f"); - api->ProgramUniform1iv = loadProc("glProgramUniform1iv"); - api->ProgramUniform2iv = loadProc("glProgramUniform2iv"); - api->ProgramUniform3iv = loadProc("glProgramUniform3iv"); - api->ProgramUniform4iv = loadProc("glProgramUniform4iv"); - api->ProgramUniform1uiv = loadProc("glProgramUniform1uiv"); - api->ProgramUniform2uiv = loadProc("glProgramUniform2uiv"); - api->ProgramUniform3uiv = loadProc("glProgramUniform3uiv"); - api->ProgramUniform4uiv = loadProc("glProgramUniform4uiv"); - api->ProgramUniform1fv = loadProc("glProgramUniform1fv"); - api->ProgramUniform2fv = loadProc("glProgramUniform2fv"); - api->ProgramUniform3fv = loadProc("glProgramUniform3fv"); - api->ProgramUniform4fv = loadProc("glProgramUniform4fv"); - api->ProgramUniformMatrix2fv = loadProc("glProgramUniformMatrix2fv"); - api->ProgramUniformMatrix3fv = loadProc("glProgramUniformMatrix3fv"); - api->ProgramUniformMatrix4fv = loadProc("glProgramUniformMatrix4fv"); - api->ProgramUniformMatrix2x3fv = loadProc("glProgramUniformMatrix2x3fv"); - api->ProgramUniformMatrix3x2fv = loadProc("glProgramUniformMatrix3x2fv"); - api->ProgramUniformMatrix2x4fv = loadProc("glProgramUniformMatrix2x4fv"); - api->ProgramUniformMatrix4x2fv = loadProc("glProgramUniformMatrix4x2fv"); - api->ProgramUniformMatrix3x4fv = loadProc("glProgramUniformMatrix3x4fv"); - api->ProgramUniformMatrix4x3fv = loadProc("glProgramUniformMatrix4x3fv"); - api->ValidateProgramPipeline = loadProc("glValidateProgramPipeline"); - api->GetProgramPipelineInfoLog = loadProc("glGetProgramPipelineInfoLog"); - api->BindImageTexture = loadProc("glBindImageTexture"); - api->GetBooleani_v = loadProc("glGetBooleani_v"); - api->MemoryBarrier = loadProc("glMemoryBarrier"); - api->MemoryBarrierByRegion = loadProc("glMemoryBarrierByRegion"); - api->TexStorage2DMultisample = loadProc("glTexStorage2DMultisample"); - api->GetMultisamplefv = loadProc("glGetMultisamplefv"); - api->SampleMaski = loadProc("glSampleMaski"); - api->GetTexLevelParameteriv = loadProc("glGetTexLevelParameteriv"); - api->GetTexLevelParameterfv = loadProc("glGetTexLevelParameterfv"); - api->BindVertexBuffer = loadProc("glBindVertexBuffer"); - api->VertexAttribFormat = loadProc("glVertexAttribFormat"); - api->VertexAttribIFormat = loadProc("glVertexAttribIFormat"); - api->VertexAttribBinding = loadProc("glVertexAttribBinding"); - api->VertexBindingDivisor = loadProc("glVertexBindingDivisor"); - api->BlendBarrier = loadProc("glBlendBarrier"); - api->CopyImageSubData = loadProc("glCopyImageSubData"); - api->DebugMessageControl = loadProc("glDebugMessageControl"); - api->DebugMessageInsert = loadProc("glDebugMessageInsert"); - api->DebugMessageCallback = loadProc("glDebugMessageCallback"); - api->GetDebugMessageLog = loadProc("glGetDebugMessageLog"); - api->PushDebugGroup = loadProc("glPushDebugGroup"); - api->PopDebugGroup = loadProc("glPopDebugGroup"); - api->ObjectLabel = loadProc("glObjectLabel"); - api->GetObjectLabel = loadProc("glGetObjectLabel"); - api->ObjectPtrLabel = loadProc("glObjectPtrLabel"); - api->GetObjectPtrLabel = loadProc("glGetObjectPtrLabel"); - api->GetPointerv = loadProc("glGetPointerv"); - api->Enablei = loadProc("glEnablei"); - api->Disablei = loadProc("glDisablei"); - api->BlendEquationi = loadProc("glBlendEquationi"); - api->BlendEquationSeparatei = loadProc("glBlendEquationSeparatei"); - api->BlendFunci = loadProc("glBlendFunci"); - api->BlendFuncSeparatei = loadProc("glBlendFuncSeparatei"); - api->ColorMaski = loadProc("glColorMaski"); - api->IsEnabledi = loadProc("glIsEnabledi"); - api->DrawElementsBaseVertex = loadProc("glDrawElementsBaseVertex"); - api->DrawRangeElementsBaseVertex = loadProc("glDrawRangeElementsBaseVertex"); - api->DrawElementsInstancedBaseVertex = loadProc("glDrawElementsInstancedBaseVertex"); - api->FramebufferTexture = loadProc("glFramebufferTexture"); - api->PrimitiveBoundingBox = loadProc("glPrimitiveBoundingBox"); - api->GetGraphicsResetStatus = loadProc("glGetGraphicsResetStatus"); - api->ReadnPixels = loadProc("glReadnPixels"); - api->GetnUniformfv = loadProc("glGetnUniformfv"); - api->GetnUniformiv = loadProc("glGetnUniformiv"); - api->GetnUniformuiv = loadProc("glGetnUniformuiv"); - api->MinSampleShading = loadProc("glMinSampleShading"); - api->PatchParameteri = loadProc("glPatchParameteri"); - api->TexParameterIiv = loadProc("glTexParameterIiv"); - api->TexParameterIuiv = loadProc("glTexParameterIuiv"); - api->GetTexParameterIiv = loadProc("glGetTexParameterIiv"); - api->GetTexParameterIuiv = loadProc("glGetTexParameterIuiv"); - api->SamplerParameterIiv = loadProc("glSamplerParameterIiv"); - api->SamplerParameterIuiv = loadProc("glSamplerParameterIuiv"); - api->GetSamplerParameterIiv = loadProc("glGetSamplerParameterIiv"); - api->GetSamplerParameterIuiv = loadProc("glGetSamplerParameterIuiv"); - api->TexBuffer = loadProc("glTexBuffer"); - api->TexBufferRange = loadProc("glTexBufferRange"); - api->TexStorage3DMultisample = loadProc("glTexStorage3DMultisample"); -} - -void mg_gl_select_api(mg_gl_api* api){ __mgGLAPI = api; } -mg_gl_api* mg_gl_get_api(void) { return(__mgGLAPI); } - +/******************************************************** +* +* @file: gl_loader.c +* @note: auto-generated by glapi.py from gl.xml +* @date: 12/072023 +* +*********************************************************/ +#include"gl_loader.h" +#include"platform.h" + +mp_thread_local mg_gl_api* __mgGLAPI = 0; + +void mg_gl_load_gl41(mg_gl_api* api, mg_gl_load_proc loadProc) +{ + api->CullFace = loadProc("glCullFace"); + api->FrontFace = loadProc("glFrontFace"); + api->Hint = loadProc("glHint"); + api->LineWidth = loadProc("glLineWidth"); + api->PointSize = loadProc("glPointSize"); + api->PolygonMode = loadProc("glPolygonMode"); + api->Scissor = loadProc("glScissor"); + api->TexParameterf = loadProc("glTexParameterf"); + api->TexParameterfv = loadProc("glTexParameterfv"); + api->TexParameteri = loadProc("glTexParameteri"); + api->TexParameteriv = loadProc("glTexParameteriv"); + api->TexImage1D = loadProc("glTexImage1D"); + api->TexImage2D = loadProc("glTexImage2D"); + api->DrawBuffer = loadProc("glDrawBuffer"); + api->Clear = loadProc("glClear"); + api->ClearColor = loadProc("glClearColor"); + api->ClearStencil = loadProc("glClearStencil"); + api->ClearDepth = loadProc("glClearDepth"); + api->StencilMask = loadProc("glStencilMask"); + api->ColorMask = loadProc("glColorMask"); + api->DepthMask = loadProc("glDepthMask"); + api->Disable = loadProc("glDisable"); + api->Enable = loadProc("glEnable"); + api->Finish = loadProc("glFinish"); + api->Flush = loadProc("glFlush"); + api->BlendFunc = loadProc("glBlendFunc"); + api->LogicOp = loadProc("glLogicOp"); + api->StencilFunc = loadProc("glStencilFunc"); + api->StencilOp = loadProc("glStencilOp"); + api->DepthFunc = loadProc("glDepthFunc"); + api->PixelStoref = loadProc("glPixelStoref"); + api->PixelStorei = loadProc("glPixelStorei"); + api->ReadBuffer = loadProc("glReadBuffer"); + api->ReadPixels = loadProc("glReadPixels"); + api->GetBooleanv = loadProc("glGetBooleanv"); + api->GetDoublev = loadProc("glGetDoublev"); + api->GetError = loadProc("glGetError"); + api->GetFloatv = loadProc("glGetFloatv"); + api->GetIntegerv = loadProc("glGetIntegerv"); + api->GetString = loadProc("glGetString"); + api->GetTexImage = loadProc("glGetTexImage"); + api->GetTexParameterfv = loadProc("glGetTexParameterfv"); + api->GetTexParameteriv = loadProc("glGetTexParameteriv"); + api->GetTexLevelParameterfv = loadProc("glGetTexLevelParameterfv"); + api->GetTexLevelParameteriv = loadProc("glGetTexLevelParameteriv"); + api->IsEnabled = loadProc("glIsEnabled"); + api->DepthRange = loadProc("glDepthRange"); + api->Viewport = loadProc("glViewport"); + api->DrawArrays = loadProc("glDrawArrays"); + api->DrawElements = loadProc("glDrawElements"); + api->PolygonOffset = loadProc("glPolygonOffset"); + api->CopyTexImage1D = loadProc("glCopyTexImage1D"); + api->CopyTexImage2D = loadProc("glCopyTexImage2D"); + api->CopyTexSubImage1D = loadProc("glCopyTexSubImage1D"); + api->CopyTexSubImage2D = loadProc("glCopyTexSubImage2D"); + api->TexSubImage1D = loadProc("glTexSubImage1D"); + api->TexSubImage2D = loadProc("glTexSubImage2D"); + api->BindTexture = loadProc("glBindTexture"); + api->DeleteTextures = loadProc("glDeleteTextures"); + api->GenTextures = loadProc("glGenTextures"); + api->IsTexture = loadProc("glIsTexture"); + api->DrawRangeElements = loadProc("glDrawRangeElements"); + api->TexImage3D = loadProc("glTexImage3D"); + api->TexSubImage3D = loadProc("glTexSubImage3D"); + api->CopyTexSubImage3D = loadProc("glCopyTexSubImage3D"); + api->ActiveTexture = loadProc("glActiveTexture"); + api->SampleCoverage = loadProc("glSampleCoverage"); + api->CompressedTexImage3D = loadProc("glCompressedTexImage3D"); + api->CompressedTexImage2D = loadProc("glCompressedTexImage2D"); + api->CompressedTexImage1D = loadProc("glCompressedTexImage1D"); + api->CompressedTexSubImage3D = loadProc("glCompressedTexSubImage3D"); + api->CompressedTexSubImage2D = loadProc("glCompressedTexSubImage2D"); + api->CompressedTexSubImage1D = loadProc("glCompressedTexSubImage1D"); + api->GetCompressedTexImage = loadProc("glGetCompressedTexImage"); + api->BlendFuncSeparate = loadProc("glBlendFuncSeparate"); + api->MultiDrawArrays = loadProc("glMultiDrawArrays"); + api->MultiDrawElements = loadProc("glMultiDrawElements"); + api->PointParameterf = loadProc("glPointParameterf"); + api->PointParameterfv = loadProc("glPointParameterfv"); + api->PointParameteri = loadProc("glPointParameteri"); + api->PointParameteriv = loadProc("glPointParameteriv"); + api->BlendColor = loadProc("glBlendColor"); + api->BlendEquation = loadProc("glBlendEquation"); + api->GenQueries = loadProc("glGenQueries"); + api->DeleteQueries = loadProc("glDeleteQueries"); + api->IsQuery = loadProc("glIsQuery"); + api->BeginQuery = loadProc("glBeginQuery"); + api->EndQuery = loadProc("glEndQuery"); + api->GetQueryiv = loadProc("glGetQueryiv"); + api->GetQueryObjectiv = loadProc("glGetQueryObjectiv"); + api->GetQueryObjectuiv = loadProc("glGetQueryObjectuiv"); + api->BindBuffer = loadProc("glBindBuffer"); + api->DeleteBuffers = loadProc("glDeleteBuffers"); + api->GenBuffers = loadProc("glGenBuffers"); + api->IsBuffer = loadProc("glIsBuffer"); + api->BufferData = loadProc("glBufferData"); + api->BufferSubData = loadProc("glBufferSubData"); + api->GetBufferSubData = loadProc("glGetBufferSubData"); + api->MapBuffer = loadProc("glMapBuffer"); + api->UnmapBuffer = loadProc("glUnmapBuffer"); + api->GetBufferParameteriv = loadProc("glGetBufferParameteriv"); + api->GetBufferPointerv = loadProc("glGetBufferPointerv"); + api->BlendEquationSeparate = loadProc("glBlendEquationSeparate"); + api->DrawBuffers = loadProc("glDrawBuffers"); + api->StencilOpSeparate = loadProc("glStencilOpSeparate"); + api->StencilFuncSeparate = loadProc("glStencilFuncSeparate"); + api->StencilMaskSeparate = loadProc("glStencilMaskSeparate"); + api->AttachShader = loadProc("glAttachShader"); + api->BindAttribLocation = loadProc("glBindAttribLocation"); + api->CompileShader = loadProc("glCompileShader"); + api->CreateProgram = loadProc("glCreateProgram"); + api->CreateShader = loadProc("glCreateShader"); + api->DeleteProgram = loadProc("glDeleteProgram"); + api->DeleteShader = loadProc("glDeleteShader"); + api->DetachShader = loadProc("glDetachShader"); + api->DisableVertexAttribArray = loadProc("glDisableVertexAttribArray"); + api->EnableVertexAttribArray = loadProc("glEnableVertexAttribArray"); + api->GetActiveAttrib = loadProc("glGetActiveAttrib"); + api->GetActiveUniform = loadProc("glGetActiveUniform"); + api->GetAttachedShaders = loadProc("glGetAttachedShaders"); + api->GetAttribLocation = loadProc("glGetAttribLocation"); + api->GetProgramiv = loadProc("glGetProgramiv"); + api->GetProgramInfoLog = loadProc("glGetProgramInfoLog"); + api->GetShaderiv = loadProc("glGetShaderiv"); + api->GetShaderInfoLog = loadProc("glGetShaderInfoLog"); + api->GetShaderSource = loadProc("glGetShaderSource"); + api->GetUniformLocation = loadProc("glGetUniformLocation"); + api->GetUniformfv = loadProc("glGetUniformfv"); + api->GetUniformiv = loadProc("glGetUniformiv"); + api->GetVertexAttribdv = loadProc("glGetVertexAttribdv"); + api->GetVertexAttribfv = loadProc("glGetVertexAttribfv"); + api->GetVertexAttribiv = loadProc("glGetVertexAttribiv"); + api->GetVertexAttribPointerv = loadProc("glGetVertexAttribPointerv"); + api->IsProgram = loadProc("glIsProgram"); + api->IsShader = loadProc("glIsShader"); + api->LinkProgram = loadProc("glLinkProgram"); + api->ShaderSource = loadProc("glShaderSource"); + api->UseProgram = loadProc("glUseProgram"); + api->Uniform1f = loadProc("glUniform1f"); + api->Uniform2f = loadProc("glUniform2f"); + api->Uniform3f = loadProc("glUniform3f"); + api->Uniform4f = loadProc("glUniform4f"); + api->Uniform1i = loadProc("glUniform1i"); + api->Uniform2i = loadProc("glUniform2i"); + api->Uniform3i = loadProc("glUniform3i"); + api->Uniform4i = loadProc("glUniform4i"); + api->Uniform1fv = loadProc("glUniform1fv"); + api->Uniform2fv = loadProc("glUniform2fv"); + api->Uniform3fv = loadProc("glUniform3fv"); + api->Uniform4fv = loadProc("glUniform4fv"); + api->Uniform1iv = loadProc("glUniform1iv"); + api->Uniform2iv = loadProc("glUniform2iv"); + api->Uniform3iv = loadProc("glUniform3iv"); + api->Uniform4iv = loadProc("glUniform4iv"); + api->UniformMatrix2fv = loadProc("glUniformMatrix2fv"); + api->UniformMatrix3fv = loadProc("glUniformMatrix3fv"); + api->UniformMatrix4fv = loadProc("glUniformMatrix4fv"); + api->ValidateProgram = loadProc("glValidateProgram"); + api->VertexAttrib1d = loadProc("glVertexAttrib1d"); + api->VertexAttrib1dv = loadProc("glVertexAttrib1dv"); + api->VertexAttrib1f = loadProc("glVertexAttrib1f"); + api->VertexAttrib1fv = loadProc("glVertexAttrib1fv"); + api->VertexAttrib1s = loadProc("glVertexAttrib1s"); + api->VertexAttrib1sv = loadProc("glVertexAttrib1sv"); + api->VertexAttrib2d = loadProc("glVertexAttrib2d"); + api->VertexAttrib2dv = loadProc("glVertexAttrib2dv"); + api->VertexAttrib2f = loadProc("glVertexAttrib2f"); + api->VertexAttrib2fv = loadProc("glVertexAttrib2fv"); + api->VertexAttrib2s = loadProc("glVertexAttrib2s"); + api->VertexAttrib2sv = loadProc("glVertexAttrib2sv"); + api->VertexAttrib3d = loadProc("glVertexAttrib3d"); + api->VertexAttrib3dv = loadProc("glVertexAttrib3dv"); + api->VertexAttrib3f = loadProc("glVertexAttrib3f"); + api->VertexAttrib3fv = loadProc("glVertexAttrib3fv"); + api->VertexAttrib3s = loadProc("glVertexAttrib3s"); + api->VertexAttrib3sv = loadProc("glVertexAttrib3sv"); + api->VertexAttrib4Nbv = loadProc("glVertexAttrib4Nbv"); + api->VertexAttrib4Niv = loadProc("glVertexAttrib4Niv"); + api->VertexAttrib4Nsv = loadProc("glVertexAttrib4Nsv"); + api->VertexAttrib4Nub = loadProc("glVertexAttrib4Nub"); + api->VertexAttrib4Nubv = loadProc("glVertexAttrib4Nubv"); + api->VertexAttrib4Nuiv = loadProc("glVertexAttrib4Nuiv"); + api->VertexAttrib4Nusv = loadProc("glVertexAttrib4Nusv"); + api->VertexAttrib4bv = loadProc("glVertexAttrib4bv"); + api->VertexAttrib4d = loadProc("glVertexAttrib4d"); + api->VertexAttrib4dv = loadProc("glVertexAttrib4dv"); + api->VertexAttrib4f = loadProc("glVertexAttrib4f"); + api->VertexAttrib4fv = loadProc("glVertexAttrib4fv"); + api->VertexAttrib4iv = loadProc("glVertexAttrib4iv"); + api->VertexAttrib4s = loadProc("glVertexAttrib4s"); + api->VertexAttrib4sv = loadProc("glVertexAttrib4sv"); + api->VertexAttrib4ubv = loadProc("glVertexAttrib4ubv"); + api->VertexAttrib4uiv = loadProc("glVertexAttrib4uiv"); + api->VertexAttrib4usv = loadProc("glVertexAttrib4usv"); + api->VertexAttribPointer = loadProc("glVertexAttribPointer"); + api->UniformMatrix2x3fv = loadProc("glUniformMatrix2x3fv"); + api->UniformMatrix3x2fv = loadProc("glUniformMatrix3x2fv"); + api->UniformMatrix2x4fv = loadProc("glUniformMatrix2x4fv"); + api->UniformMatrix4x2fv = loadProc("glUniformMatrix4x2fv"); + api->UniformMatrix3x4fv = loadProc("glUniformMatrix3x4fv"); + api->UniformMatrix4x3fv = loadProc("glUniformMatrix4x3fv"); + api->ColorMaski = loadProc("glColorMaski"); + api->GetBooleani_v = loadProc("glGetBooleani_v"); + api->GetIntegeri_v = loadProc("glGetIntegeri_v"); + api->Enablei = loadProc("glEnablei"); + api->Disablei = loadProc("glDisablei"); + api->IsEnabledi = loadProc("glIsEnabledi"); + api->BeginTransformFeedback = loadProc("glBeginTransformFeedback"); + api->EndTransformFeedback = loadProc("glEndTransformFeedback"); + api->BindBufferRange = loadProc("glBindBufferRange"); + api->BindBufferBase = loadProc("glBindBufferBase"); + api->TransformFeedbackVaryings = loadProc("glTransformFeedbackVaryings"); + api->GetTransformFeedbackVarying = loadProc("glGetTransformFeedbackVarying"); + api->ClampColor = loadProc("glClampColor"); + api->BeginConditionalRender = loadProc("glBeginConditionalRender"); + api->EndConditionalRender = loadProc("glEndConditionalRender"); + api->VertexAttribIPointer = loadProc("glVertexAttribIPointer"); + api->GetVertexAttribIiv = loadProc("glGetVertexAttribIiv"); + api->GetVertexAttribIuiv = loadProc("glGetVertexAttribIuiv"); + api->VertexAttribI1i = loadProc("glVertexAttribI1i"); + api->VertexAttribI2i = loadProc("glVertexAttribI2i"); + api->VertexAttribI3i = loadProc("glVertexAttribI3i"); + api->VertexAttribI4i = loadProc("glVertexAttribI4i"); + api->VertexAttribI1ui = loadProc("glVertexAttribI1ui"); + api->VertexAttribI2ui = loadProc("glVertexAttribI2ui"); + api->VertexAttribI3ui = loadProc("glVertexAttribI3ui"); + api->VertexAttribI4ui = loadProc("glVertexAttribI4ui"); + api->VertexAttribI1iv = loadProc("glVertexAttribI1iv"); + api->VertexAttribI2iv = loadProc("glVertexAttribI2iv"); + api->VertexAttribI3iv = loadProc("glVertexAttribI3iv"); + api->VertexAttribI4iv = loadProc("glVertexAttribI4iv"); + api->VertexAttribI1uiv = loadProc("glVertexAttribI1uiv"); + api->VertexAttribI2uiv = loadProc("glVertexAttribI2uiv"); + api->VertexAttribI3uiv = loadProc("glVertexAttribI3uiv"); + api->VertexAttribI4uiv = loadProc("glVertexAttribI4uiv"); + api->VertexAttribI4bv = loadProc("glVertexAttribI4bv"); + api->VertexAttribI4sv = loadProc("glVertexAttribI4sv"); + api->VertexAttribI4ubv = loadProc("glVertexAttribI4ubv"); + api->VertexAttribI4usv = loadProc("glVertexAttribI4usv"); + api->GetUniformuiv = loadProc("glGetUniformuiv"); + api->BindFragDataLocation = loadProc("glBindFragDataLocation"); + api->GetFragDataLocation = loadProc("glGetFragDataLocation"); + api->Uniform1ui = loadProc("glUniform1ui"); + api->Uniform2ui = loadProc("glUniform2ui"); + api->Uniform3ui = loadProc("glUniform3ui"); + api->Uniform4ui = loadProc("glUniform4ui"); + api->Uniform1uiv = loadProc("glUniform1uiv"); + api->Uniform2uiv = loadProc("glUniform2uiv"); + api->Uniform3uiv = loadProc("glUniform3uiv"); + api->Uniform4uiv = loadProc("glUniform4uiv"); + api->TexParameterIiv = loadProc("glTexParameterIiv"); + api->TexParameterIuiv = loadProc("glTexParameterIuiv"); + api->GetTexParameterIiv = loadProc("glGetTexParameterIiv"); + api->GetTexParameterIuiv = loadProc("glGetTexParameterIuiv"); + api->ClearBufferiv = loadProc("glClearBufferiv"); + api->ClearBufferuiv = loadProc("glClearBufferuiv"); + api->ClearBufferfv = loadProc("glClearBufferfv"); + api->ClearBufferfi = loadProc("glClearBufferfi"); + api->GetStringi = loadProc("glGetStringi"); + api->IsRenderbuffer = loadProc("glIsRenderbuffer"); + api->BindRenderbuffer = loadProc("glBindRenderbuffer"); + api->DeleteRenderbuffers = loadProc("glDeleteRenderbuffers"); + api->GenRenderbuffers = loadProc("glGenRenderbuffers"); + api->RenderbufferStorage = loadProc("glRenderbufferStorage"); + api->GetRenderbufferParameteriv = loadProc("glGetRenderbufferParameteriv"); + api->IsFramebuffer = loadProc("glIsFramebuffer"); + api->BindFramebuffer = loadProc("glBindFramebuffer"); + api->DeleteFramebuffers = loadProc("glDeleteFramebuffers"); + api->GenFramebuffers = loadProc("glGenFramebuffers"); + api->CheckFramebufferStatus = loadProc("glCheckFramebufferStatus"); + api->FramebufferTexture1D = loadProc("glFramebufferTexture1D"); + api->FramebufferTexture2D = loadProc("glFramebufferTexture2D"); + api->FramebufferTexture3D = loadProc("glFramebufferTexture3D"); + api->FramebufferRenderbuffer = loadProc("glFramebufferRenderbuffer"); + api->GetFramebufferAttachmentParameteriv = loadProc("glGetFramebufferAttachmentParameteriv"); + api->GenerateMipmap = loadProc("glGenerateMipmap"); + api->BlitFramebuffer = loadProc("glBlitFramebuffer"); + api->RenderbufferStorageMultisample = loadProc("glRenderbufferStorageMultisample"); + api->FramebufferTextureLayer = loadProc("glFramebufferTextureLayer"); + api->MapBufferRange = loadProc("glMapBufferRange"); + api->FlushMappedBufferRange = loadProc("glFlushMappedBufferRange"); + api->BindVertexArray = loadProc("glBindVertexArray"); + api->DeleteVertexArrays = loadProc("glDeleteVertexArrays"); + api->GenVertexArrays = loadProc("glGenVertexArrays"); + api->IsVertexArray = loadProc("glIsVertexArray"); + api->DrawArraysInstanced = loadProc("glDrawArraysInstanced"); + api->DrawElementsInstanced = loadProc("glDrawElementsInstanced"); + api->TexBuffer = loadProc("glTexBuffer"); + api->PrimitiveRestartIndex = loadProc("glPrimitiveRestartIndex"); + api->CopyBufferSubData = loadProc("glCopyBufferSubData"); + api->GetUniformIndices = loadProc("glGetUniformIndices"); + api->GetActiveUniformsiv = loadProc("glGetActiveUniformsiv"); + api->GetActiveUniformName = loadProc("glGetActiveUniformName"); + api->GetUniformBlockIndex = loadProc("glGetUniformBlockIndex"); + api->GetActiveUniformBlockiv = loadProc("glGetActiveUniformBlockiv"); + api->GetActiveUniformBlockName = loadProc("glGetActiveUniformBlockName"); + api->UniformBlockBinding = loadProc("glUniformBlockBinding"); + api->BindBufferRange = loadProc("glBindBufferRange"); + api->BindBufferBase = loadProc("glBindBufferBase"); + api->GetIntegeri_v = loadProc("glGetIntegeri_v"); + api->DrawElementsBaseVertex = loadProc("glDrawElementsBaseVertex"); + api->DrawRangeElementsBaseVertex = loadProc("glDrawRangeElementsBaseVertex"); + api->DrawElementsInstancedBaseVertex = loadProc("glDrawElementsInstancedBaseVertex"); + api->MultiDrawElementsBaseVertex = loadProc("glMultiDrawElementsBaseVertex"); + api->ProvokingVertex = loadProc("glProvokingVertex"); + api->FenceSync = loadProc("glFenceSync"); + api->IsSync = loadProc("glIsSync"); + api->DeleteSync = loadProc("glDeleteSync"); + api->ClientWaitSync = loadProc("glClientWaitSync"); + api->WaitSync = loadProc("glWaitSync"); + api->GetInteger64v = loadProc("glGetInteger64v"); + api->GetSynciv = loadProc("glGetSynciv"); + api->GetInteger64i_v = loadProc("glGetInteger64i_v"); + api->GetBufferParameteri64v = loadProc("glGetBufferParameteri64v"); + api->FramebufferTexture = loadProc("glFramebufferTexture"); + api->TexImage2DMultisample = loadProc("glTexImage2DMultisample"); + api->TexImage3DMultisample = loadProc("glTexImage3DMultisample"); + api->GetMultisamplefv = loadProc("glGetMultisamplefv"); + api->SampleMaski = loadProc("glSampleMaski"); + api->BindFragDataLocationIndexed = loadProc("glBindFragDataLocationIndexed"); + api->GetFragDataIndex = loadProc("glGetFragDataIndex"); + api->GenSamplers = loadProc("glGenSamplers"); + api->DeleteSamplers = loadProc("glDeleteSamplers"); + api->IsSampler = loadProc("glIsSampler"); + api->BindSampler = loadProc("glBindSampler"); + api->SamplerParameteri = loadProc("glSamplerParameteri"); + api->SamplerParameteriv = loadProc("glSamplerParameteriv"); + api->SamplerParameterf = loadProc("glSamplerParameterf"); + api->SamplerParameterfv = loadProc("glSamplerParameterfv"); + api->SamplerParameterIiv = loadProc("glSamplerParameterIiv"); + api->SamplerParameterIuiv = loadProc("glSamplerParameterIuiv"); + api->GetSamplerParameteriv = loadProc("glGetSamplerParameteriv"); + api->GetSamplerParameterIiv = loadProc("glGetSamplerParameterIiv"); + api->GetSamplerParameterfv = loadProc("glGetSamplerParameterfv"); + api->GetSamplerParameterIuiv = loadProc("glGetSamplerParameterIuiv"); + api->QueryCounter = loadProc("glQueryCounter"); + api->GetQueryObjecti64v = loadProc("glGetQueryObjecti64v"); + api->GetQueryObjectui64v = loadProc("glGetQueryObjectui64v"); + api->VertexAttribDivisor = loadProc("glVertexAttribDivisor"); + api->VertexAttribP1ui = loadProc("glVertexAttribP1ui"); + api->VertexAttribP1uiv = loadProc("glVertexAttribP1uiv"); + api->VertexAttribP2ui = loadProc("glVertexAttribP2ui"); + api->VertexAttribP2uiv = loadProc("glVertexAttribP2uiv"); + api->VertexAttribP3ui = loadProc("glVertexAttribP3ui"); + api->VertexAttribP3uiv = loadProc("glVertexAttribP3uiv"); + api->VertexAttribP4ui = loadProc("glVertexAttribP4ui"); + api->VertexAttribP4uiv = loadProc("glVertexAttribP4uiv"); + api->MinSampleShading = loadProc("glMinSampleShading"); + api->BlendEquationi = loadProc("glBlendEquationi"); + api->BlendEquationSeparatei = loadProc("glBlendEquationSeparatei"); + api->BlendFunci = loadProc("glBlendFunci"); + api->BlendFuncSeparatei = loadProc("glBlendFuncSeparatei"); + api->DrawArraysIndirect = loadProc("glDrawArraysIndirect"); + api->DrawElementsIndirect = loadProc("glDrawElementsIndirect"); + api->Uniform1d = loadProc("glUniform1d"); + api->Uniform2d = loadProc("glUniform2d"); + api->Uniform3d = loadProc("glUniform3d"); + api->Uniform4d = loadProc("glUniform4d"); + api->Uniform1dv = loadProc("glUniform1dv"); + api->Uniform2dv = loadProc("glUniform2dv"); + api->Uniform3dv = loadProc("glUniform3dv"); + api->Uniform4dv = loadProc("glUniform4dv"); + api->UniformMatrix2dv = loadProc("glUniformMatrix2dv"); + api->UniformMatrix3dv = loadProc("glUniformMatrix3dv"); + api->UniformMatrix4dv = loadProc("glUniformMatrix4dv"); + api->UniformMatrix2x3dv = loadProc("glUniformMatrix2x3dv"); + api->UniformMatrix2x4dv = loadProc("glUniformMatrix2x4dv"); + api->UniformMatrix3x2dv = loadProc("glUniformMatrix3x2dv"); + api->UniformMatrix3x4dv = loadProc("glUniformMatrix3x4dv"); + api->UniformMatrix4x2dv = loadProc("glUniformMatrix4x2dv"); + api->UniformMatrix4x3dv = loadProc("glUniformMatrix4x3dv"); + api->GetUniformdv = loadProc("glGetUniformdv"); + api->GetSubroutineUniformLocation = loadProc("glGetSubroutineUniformLocation"); + api->GetSubroutineIndex = loadProc("glGetSubroutineIndex"); + api->GetActiveSubroutineUniformiv = loadProc("glGetActiveSubroutineUniformiv"); + api->GetActiveSubroutineUniformName = loadProc("glGetActiveSubroutineUniformName"); + api->GetActiveSubroutineName = loadProc("glGetActiveSubroutineName"); + api->UniformSubroutinesuiv = loadProc("glUniformSubroutinesuiv"); + api->GetUniformSubroutineuiv = loadProc("glGetUniformSubroutineuiv"); + api->GetProgramStageiv = loadProc("glGetProgramStageiv"); + api->PatchParameteri = loadProc("glPatchParameteri"); + api->PatchParameterfv = loadProc("glPatchParameterfv"); + api->BindTransformFeedback = loadProc("glBindTransformFeedback"); + api->DeleteTransformFeedbacks = loadProc("glDeleteTransformFeedbacks"); + api->GenTransformFeedbacks = loadProc("glGenTransformFeedbacks"); + api->IsTransformFeedback = loadProc("glIsTransformFeedback"); + api->PauseTransformFeedback = loadProc("glPauseTransformFeedback"); + api->ResumeTransformFeedback = loadProc("glResumeTransformFeedback"); + api->DrawTransformFeedback = loadProc("glDrawTransformFeedback"); + api->DrawTransformFeedbackStream = loadProc("glDrawTransformFeedbackStream"); + api->BeginQueryIndexed = loadProc("glBeginQueryIndexed"); + api->EndQueryIndexed = loadProc("glEndQueryIndexed"); + api->GetQueryIndexediv = loadProc("glGetQueryIndexediv"); + api->ReleaseShaderCompiler = loadProc("glReleaseShaderCompiler"); + api->ShaderBinary = loadProc("glShaderBinary"); + api->GetShaderPrecisionFormat = loadProc("glGetShaderPrecisionFormat"); + api->DepthRangef = loadProc("glDepthRangef"); + api->ClearDepthf = loadProc("glClearDepthf"); + api->GetProgramBinary = loadProc("glGetProgramBinary"); + api->ProgramBinary = loadProc("glProgramBinary"); + api->ProgramParameteri = loadProc("glProgramParameteri"); + api->UseProgramStages = loadProc("glUseProgramStages"); + api->ActiveShaderProgram = loadProc("glActiveShaderProgram"); + api->CreateShaderProgramv = loadProc("glCreateShaderProgramv"); + api->BindProgramPipeline = loadProc("glBindProgramPipeline"); + api->DeleteProgramPipelines = loadProc("glDeleteProgramPipelines"); + api->GenProgramPipelines = loadProc("glGenProgramPipelines"); + api->IsProgramPipeline = loadProc("glIsProgramPipeline"); + api->GetProgramPipelineiv = loadProc("glGetProgramPipelineiv"); + api->ProgramParameteri = loadProc("glProgramParameteri"); + api->ProgramUniform1i = loadProc("glProgramUniform1i"); + api->ProgramUniform1iv = loadProc("glProgramUniform1iv"); + api->ProgramUniform1f = loadProc("glProgramUniform1f"); + api->ProgramUniform1fv = loadProc("glProgramUniform1fv"); + api->ProgramUniform1d = loadProc("glProgramUniform1d"); + api->ProgramUniform1dv = loadProc("glProgramUniform1dv"); + api->ProgramUniform1ui = loadProc("glProgramUniform1ui"); + api->ProgramUniform1uiv = loadProc("glProgramUniform1uiv"); + api->ProgramUniform2i = loadProc("glProgramUniform2i"); + api->ProgramUniform2iv = loadProc("glProgramUniform2iv"); + api->ProgramUniform2f = loadProc("glProgramUniform2f"); + api->ProgramUniform2fv = loadProc("glProgramUniform2fv"); + api->ProgramUniform2d = loadProc("glProgramUniform2d"); + api->ProgramUniform2dv = loadProc("glProgramUniform2dv"); + api->ProgramUniform2ui = loadProc("glProgramUniform2ui"); + api->ProgramUniform2uiv = loadProc("glProgramUniform2uiv"); + api->ProgramUniform3i = loadProc("glProgramUniform3i"); + api->ProgramUniform3iv = loadProc("glProgramUniform3iv"); + api->ProgramUniform3f = loadProc("glProgramUniform3f"); + api->ProgramUniform3fv = loadProc("glProgramUniform3fv"); + api->ProgramUniform3d = loadProc("glProgramUniform3d"); + api->ProgramUniform3dv = loadProc("glProgramUniform3dv"); + api->ProgramUniform3ui = loadProc("glProgramUniform3ui"); + api->ProgramUniform3uiv = loadProc("glProgramUniform3uiv"); + api->ProgramUniform4i = loadProc("glProgramUniform4i"); + api->ProgramUniform4iv = loadProc("glProgramUniform4iv"); + api->ProgramUniform4f = loadProc("glProgramUniform4f"); + api->ProgramUniform4fv = loadProc("glProgramUniform4fv"); + api->ProgramUniform4d = loadProc("glProgramUniform4d"); + api->ProgramUniform4dv = loadProc("glProgramUniform4dv"); + api->ProgramUniform4ui = loadProc("glProgramUniform4ui"); + api->ProgramUniform4uiv = loadProc("glProgramUniform4uiv"); + api->ProgramUniformMatrix2fv = loadProc("glProgramUniformMatrix2fv"); + api->ProgramUniformMatrix3fv = loadProc("glProgramUniformMatrix3fv"); + api->ProgramUniformMatrix4fv = loadProc("glProgramUniformMatrix4fv"); + api->ProgramUniformMatrix2dv = loadProc("glProgramUniformMatrix2dv"); + api->ProgramUniformMatrix3dv = loadProc("glProgramUniformMatrix3dv"); + api->ProgramUniformMatrix4dv = loadProc("glProgramUniformMatrix4dv"); + api->ProgramUniformMatrix2x3fv = loadProc("glProgramUniformMatrix2x3fv"); + api->ProgramUniformMatrix3x2fv = loadProc("glProgramUniformMatrix3x2fv"); + api->ProgramUniformMatrix2x4fv = loadProc("glProgramUniformMatrix2x4fv"); + api->ProgramUniformMatrix4x2fv = loadProc("glProgramUniformMatrix4x2fv"); + api->ProgramUniformMatrix3x4fv = loadProc("glProgramUniformMatrix3x4fv"); + api->ProgramUniformMatrix4x3fv = loadProc("glProgramUniformMatrix4x3fv"); + api->ProgramUniformMatrix2x3dv = loadProc("glProgramUniformMatrix2x3dv"); + api->ProgramUniformMatrix3x2dv = loadProc("glProgramUniformMatrix3x2dv"); + api->ProgramUniformMatrix2x4dv = loadProc("glProgramUniformMatrix2x4dv"); + api->ProgramUniformMatrix4x2dv = loadProc("glProgramUniformMatrix4x2dv"); + api->ProgramUniformMatrix3x4dv = loadProc("glProgramUniformMatrix3x4dv"); + api->ProgramUniformMatrix4x3dv = loadProc("glProgramUniformMatrix4x3dv"); + api->ValidateProgramPipeline = loadProc("glValidateProgramPipeline"); + api->GetProgramPipelineInfoLog = loadProc("glGetProgramPipelineInfoLog"); + api->VertexAttribL1d = loadProc("glVertexAttribL1d"); + api->VertexAttribL2d = loadProc("glVertexAttribL2d"); + api->VertexAttribL3d = loadProc("glVertexAttribL3d"); + api->VertexAttribL4d = loadProc("glVertexAttribL4d"); + api->VertexAttribL1dv = loadProc("glVertexAttribL1dv"); + api->VertexAttribL2dv = loadProc("glVertexAttribL2dv"); + api->VertexAttribL3dv = loadProc("glVertexAttribL3dv"); + api->VertexAttribL4dv = loadProc("glVertexAttribL4dv"); + api->VertexAttribLPointer = loadProc("glVertexAttribLPointer"); + api->GetVertexAttribLdv = loadProc("glGetVertexAttribLdv"); + api->ViewportArrayv = loadProc("glViewportArrayv"); + api->ViewportIndexedf = loadProc("glViewportIndexedf"); + api->ViewportIndexedfv = loadProc("glViewportIndexedfv"); + api->ScissorArrayv = loadProc("glScissorArrayv"); + api->ScissorIndexed = loadProc("glScissorIndexed"); + api->ScissorIndexedv = loadProc("glScissorIndexedv"); + api->DepthRangeArrayv = loadProc("glDepthRangeArrayv"); + api->DepthRangeIndexed = loadProc("glDepthRangeIndexed"); + api->GetFloati_v = loadProc("glGetFloati_v"); + api->GetDoublei_v = loadProc("glGetDoublei_v"); +} + +void mg_gl_load_gl43(mg_gl_api* api, mg_gl_load_proc loadProc) +{ + api->CullFace = loadProc("glCullFace"); + api->FrontFace = loadProc("glFrontFace"); + api->Hint = loadProc("glHint"); + api->LineWidth = loadProc("glLineWidth"); + api->PointSize = loadProc("glPointSize"); + api->PolygonMode = loadProc("glPolygonMode"); + api->Scissor = loadProc("glScissor"); + api->TexParameterf = loadProc("glTexParameterf"); + api->TexParameterfv = loadProc("glTexParameterfv"); + api->TexParameteri = loadProc("glTexParameteri"); + api->TexParameteriv = loadProc("glTexParameteriv"); + api->TexImage1D = loadProc("glTexImage1D"); + api->TexImage2D = loadProc("glTexImage2D"); + api->DrawBuffer = loadProc("glDrawBuffer"); + api->Clear = loadProc("glClear"); + api->ClearColor = loadProc("glClearColor"); + api->ClearStencil = loadProc("glClearStencil"); + api->ClearDepth = loadProc("glClearDepth"); + api->StencilMask = loadProc("glStencilMask"); + api->ColorMask = loadProc("glColorMask"); + api->DepthMask = loadProc("glDepthMask"); + api->Disable = loadProc("glDisable"); + api->Enable = loadProc("glEnable"); + api->Finish = loadProc("glFinish"); + api->Flush = loadProc("glFlush"); + api->BlendFunc = loadProc("glBlendFunc"); + api->LogicOp = loadProc("glLogicOp"); + api->StencilFunc = loadProc("glStencilFunc"); + api->StencilOp = loadProc("glStencilOp"); + api->DepthFunc = loadProc("glDepthFunc"); + api->PixelStoref = loadProc("glPixelStoref"); + api->PixelStorei = loadProc("glPixelStorei"); + api->ReadBuffer = loadProc("glReadBuffer"); + api->ReadPixels = loadProc("glReadPixels"); + api->GetBooleanv = loadProc("glGetBooleanv"); + api->GetDoublev = loadProc("glGetDoublev"); + api->GetError = loadProc("glGetError"); + api->GetFloatv = loadProc("glGetFloatv"); + api->GetIntegerv = loadProc("glGetIntegerv"); + api->GetString = loadProc("glGetString"); + api->GetTexImage = loadProc("glGetTexImage"); + api->GetTexParameterfv = loadProc("glGetTexParameterfv"); + api->GetTexParameteriv = loadProc("glGetTexParameteriv"); + api->GetTexLevelParameterfv = loadProc("glGetTexLevelParameterfv"); + api->GetTexLevelParameteriv = loadProc("glGetTexLevelParameteriv"); + api->IsEnabled = loadProc("glIsEnabled"); + api->DepthRange = loadProc("glDepthRange"); + api->Viewport = loadProc("glViewport"); + api->DrawArrays = loadProc("glDrawArrays"); + api->DrawElements = loadProc("glDrawElements"); + api->PolygonOffset = loadProc("glPolygonOffset"); + api->CopyTexImage1D = loadProc("glCopyTexImage1D"); + api->CopyTexImage2D = loadProc("glCopyTexImage2D"); + api->CopyTexSubImage1D = loadProc("glCopyTexSubImage1D"); + api->CopyTexSubImage2D = loadProc("glCopyTexSubImage2D"); + api->TexSubImage1D = loadProc("glTexSubImage1D"); + api->TexSubImage2D = loadProc("glTexSubImage2D"); + api->BindTexture = loadProc("glBindTexture"); + api->DeleteTextures = loadProc("glDeleteTextures"); + api->GenTextures = loadProc("glGenTextures"); + api->IsTexture = loadProc("glIsTexture"); + api->DrawRangeElements = loadProc("glDrawRangeElements"); + api->TexImage3D = loadProc("glTexImage3D"); + api->TexSubImage3D = loadProc("glTexSubImage3D"); + api->CopyTexSubImage3D = loadProc("glCopyTexSubImage3D"); + api->ActiveTexture = loadProc("glActiveTexture"); + api->SampleCoverage = loadProc("glSampleCoverage"); + api->CompressedTexImage3D = loadProc("glCompressedTexImage3D"); + api->CompressedTexImage2D = loadProc("glCompressedTexImage2D"); + api->CompressedTexImage1D = loadProc("glCompressedTexImage1D"); + api->CompressedTexSubImage3D = loadProc("glCompressedTexSubImage3D"); + api->CompressedTexSubImage2D = loadProc("glCompressedTexSubImage2D"); + api->CompressedTexSubImage1D = loadProc("glCompressedTexSubImage1D"); + api->GetCompressedTexImage = loadProc("glGetCompressedTexImage"); + api->BlendFuncSeparate = loadProc("glBlendFuncSeparate"); + api->MultiDrawArrays = loadProc("glMultiDrawArrays"); + api->MultiDrawElements = loadProc("glMultiDrawElements"); + api->PointParameterf = loadProc("glPointParameterf"); + api->PointParameterfv = loadProc("glPointParameterfv"); + api->PointParameteri = loadProc("glPointParameteri"); + api->PointParameteriv = loadProc("glPointParameteriv"); + api->BlendColor = loadProc("glBlendColor"); + api->BlendEquation = loadProc("glBlendEquation"); + api->GenQueries = loadProc("glGenQueries"); + api->DeleteQueries = loadProc("glDeleteQueries"); + api->IsQuery = loadProc("glIsQuery"); + api->BeginQuery = loadProc("glBeginQuery"); + api->EndQuery = loadProc("glEndQuery"); + api->GetQueryiv = loadProc("glGetQueryiv"); + api->GetQueryObjectiv = loadProc("glGetQueryObjectiv"); + api->GetQueryObjectuiv = loadProc("glGetQueryObjectuiv"); + api->BindBuffer = loadProc("glBindBuffer"); + api->DeleteBuffers = loadProc("glDeleteBuffers"); + api->GenBuffers = loadProc("glGenBuffers"); + api->IsBuffer = loadProc("glIsBuffer"); + api->BufferData = loadProc("glBufferData"); + api->BufferSubData = loadProc("glBufferSubData"); + api->GetBufferSubData = loadProc("glGetBufferSubData"); + api->MapBuffer = loadProc("glMapBuffer"); + api->UnmapBuffer = loadProc("glUnmapBuffer"); + api->GetBufferParameteriv = loadProc("glGetBufferParameteriv"); + api->GetBufferPointerv = loadProc("glGetBufferPointerv"); + api->BlendEquationSeparate = loadProc("glBlendEquationSeparate"); + api->DrawBuffers = loadProc("glDrawBuffers"); + api->StencilOpSeparate = loadProc("glStencilOpSeparate"); + api->StencilFuncSeparate = loadProc("glStencilFuncSeparate"); + api->StencilMaskSeparate = loadProc("glStencilMaskSeparate"); + api->AttachShader = loadProc("glAttachShader"); + api->BindAttribLocation = loadProc("glBindAttribLocation"); + api->CompileShader = loadProc("glCompileShader"); + api->CreateProgram = loadProc("glCreateProgram"); + api->CreateShader = loadProc("glCreateShader"); + api->DeleteProgram = loadProc("glDeleteProgram"); + api->DeleteShader = loadProc("glDeleteShader"); + api->DetachShader = loadProc("glDetachShader"); + api->DisableVertexAttribArray = loadProc("glDisableVertexAttribArray"); + api->EnableVertexAttribArray = loadProc("glEnableVertexAttribArray"); + api->GetActiveAttrib = loadProc("glGetActiveAttrib"); + api->GetActiveUniform = loadProc("glGetActiveUniform"); + api->GetAttachedShaders = loadProc("glGetAttachedShaders"); + api->GetAttribLocation = loadProc("glGetAttribLocation"); + api->GetProgramiv = loadProc("glGetProgramiv"); + api->GetProgramInfoLog = loadProc("glGetProgramInfoLog"); + api->GetShaderiv = loadProc("glGetShaderiv"); + api->GetShaderInfoLog = loadProc("glGetShaderInfoLog"); + api->GetShaderSource = loadProc("glGetShaderSource"); + api->GetUniformLocation = loadProc("glGetUniformLocation"); + api->GetUniformfv = loadProc("glGetUniformfv"); + api->GetUniformiv = loadProc("glGetUniformiv"); + api->GetVertexAttribdv = loadProc("glGetVertexAttribdv"); + api->GetVertexAttribfv = loadProc("glGetVertexAttribfv"); + api->GetVertexAttribiv = loadProc("glGetVertexAttribiv"); + api->GetVertexAttribPointerv = loadProc("glGetVertexAttribPointerv"); + api->IsProgram = loadProc("glIsProgram"); + api->IsShader = loadProc("glIsShader"); + api->LinkProgram = loadProc("glLinkProgram"); + api->ShaderSource = loadProc("glShaderSource"); + api->UseProgram = loadProc("glUseProgram"); + api->Uniform1f = loadProc("glUniform1f"); + api->Uniform2f = loadProc("glUniform2f"); + api->Uniform3f = loadProc("glUniform3f"); + api->Uniform4f = loadProc("glUniform4f"); + api->Uniform1i = loadProc("glUniform1i"); + api->Uniform2i = loadProc("glUniform2i"); + api->Uniform3i = loadProc("glUniform3i"); + api->Uniform4i = loadProc("glUniform4i"); + api->Uniform1fv = loadProc("glUniform1fv"); + api->Uniform2fv = loadProc("glUniform2fv"); + api->Uniform3fv = loadProc("glUniform3fv"); + api->Uniform4fv = loadProc("glUniform4fv"); + api->Uniform1iv = loadProc("glUniform1iv"); + api->Uniform2iv = loadProc("glUniform2iv"); + api->Uniform3iv = loadProc("glUniform3iv"); + api->Uniform4iv = loadProc("glUniform4iv"); + api->UniformMatrix2fv = loadProc("glUniformMatrix2fv"); + api->UniformMatrix3fv = loadProc("glUniformMatrix3fv"); + api->UniformMatrix4fv = loadProc("glUniformMatrix4fv"); + api->ValidateProgram = loadProc("glValidateProgram"); + api->VertexAttrib1d = loadProc("glVertexAttrib1d"); + api->VertexAttrib1dv = loadProc("glVertexAttrib1dv"); + api->VertexAttrib1f = loadProc("glVertexAttrib1f"); + api->VertexAttrib1fv = loadProc("glVertexAttrib1fv"); + api->VertexAttrib1s = loadProc("glVertexAttrib1s"); + api->VertexAttrib1sv = loadProc("glVertexAttrib1sv"); + api->VertexAttrib2d = loadProc("glVertexAttrib2d"); + api->VertexAttrib2dv = loadProc("glVertexAttrib2dv"); + api->VertexAttrib2f = loadProc("glVertexAttrib2f"); + api->VertexAttrib2fv = loadProc("glVertexAttrib2fv"); + api->VertexAttrib2s = loadProc("glVertexAttrib2s"); + api->VertexAttrib2sv = loadProc("glVertexAttrib2sv"); + api->VertexAttrib3d = loadProc("glVertexAttrib3d"); + api->VertexAttrib3dv = loadProc("glVertexAttrib3dv"); + api->VertexAttrib3f = loadProc("glVertexAttrib3f"); + api->VertexAttrib3fv = loadProc("glVertexAttrib3fv"); + api->VertexAttrib3s = loadProc("glVertexAttrib3s"); + api->VertexAttrib3sv = loadProc("glVertexAttrib3sv"); + api->VertexAttrib4Nbv = loadProc("glVertexAttrib4Nbv"); + api->VertexAttrib4Niv = loadProc("glVertexAttrib4Niv"); + api->VertexAttrib4Nsv = loadProc("glVertexAttrib4Nsv"); + api->VertexAttrib4Nub = loadProc("glVertexAttrib4Nub"); + api->VertexAttrib4Nubv = loadProc("glVertexAttrib4Nubv"); + api->VertexAttrib4Nuiv = loadProc("glVertexAttrib4Nuiv"); + api->VertexAttrib4Nusv = loadProc("glVertexAttrib4Nusv"); + api->VertexAttrib4bv = loadProc("glVertexAttrib4bv"); + api->VertexAttrib4d = loadProc("glVertexAttrib4d"); + api->VertexAttrib4dv = loadProc("glVertexAttrib4dv"); + api->VertexAttrib4f = loadProc("glVertexAttrib4f"); + api->VertexAttrib4fv = loadProc("glVertexAttrib4fv"); + api->VertexAttrib4iv = loadProc("glVertexAttrib4iv"); + api->VertexAttrib4s = loadProc("glVertexAttrib4s"); + api->VertexAttrib4sv = loadProc("glVertexAttrib4sv"); + api->VertexAttrib4ubv = loadProc("glVertexAttrib4ubv"); + api->VertexAttrib4uiv = loadProc("glVertexAttrib4uiv"); + api->VertexAttrib4usv = loadProc("glVertexAttrib4usv"); + api->VertexAttribPointer = loadProc("glVertexAttribPointer"); + api->UniformMatrix2x3fv = loadProc("glUniformMatrix2x3fv"); + api->UniformMatrix3x2fv = loadProc("glUniformMatrix3x2fv"); + api->UniformMatrix2x4fv = loadProc("glUniformMatrix2x4fv"); + api->UniformMatrix4x2fv = loadProc("glUniformMatrix4x2fv"); + api->UniformMatrix3x4fv = loadProc("glUniformMatrix3x4fv"); + api->UniformMatrix4x3fv = loadProc("glUniformMatrix4x3fv"); + api->ColorMaski = loadProc("glColorMaski"); + api->GetBooleani_v = loadProc("glGetBooleani_v"); + api->GetIntegeri_v = loadProc("glGetIntegeri_v"); + api->Enablei = loadProc("glEnablei"); + api->Disablei = loadProc("glDisablei"); + api->IsEnabledi = loadProc("glIsEnabledi"); + api->BeginTransformFeedback = loadProc("glBeginTransformFeedback"); + api->EndTransformFeedback = loadProc("glEndTransformFeedback"); + api->BindBufferRange = loadProc("glBindBufferRange"); + api->BindBufferBase = loadProc("glBindBufferBase"); + api->TransformFeedbackVaryings = loadProc("glTransformFeedbackVaryings"); + api->GetTransformFeedbackVarying = loadProc("glGetTransformFeedbackVarying"); + api->ClampColor = loadProc("glClampColor"); + api->BeginConditionalRender = loadProc("glBeginConditionalRender"); + api->EndConditionalRender = loadProc("glEndConditionalRender"); + api->VertexAttribIPointer = loadProc("glVertexAttribIPointer"); + api->GetVertexAttribIiv = loadProc("glGetVertexAttribIiv"); + api->GetVertexAttribIuiv = loadProc("glGetVertexAttribIuiv"); + api->VertexAttribI1i = loadProc("glVertexAttribI1i"); + api->VertexAttribI2i = loadProc("glVertexAttribI2i"); + api->VertexAttribI3i = loadProc("glVertexAttribI3i"); + api->VertexAttribI4i = loadProc("glVertexAttribI4i"); + api->VertexAttribI1ui = loadProc("glVertexAttribI1ui"); + api->VertexAttribI2ui = loadProc("glVertexAttribI2ui"); + api->VertexAttribI3ui = loadProc("glVertexAttribI3ui"); + api->VertexAttribI4ui = loadProc("glVertexAttribI4ui"); + api->VertexAttribI1iv = loadProc("glVertexAttribI1iv"); + api->VertexAttribI2iv = loadProc("glVertexAttribI2iv"); + api->VertexAttribI3iv = loadProc("glVertexAttribI3iv"); + api->VertexAttribI4iv = loadProc("glVertexAttribI4iv"); + api->VertexAttribI1uiv = loadProc("glVertexAttribI1uiv"); + api->VertexAttribI2uiv = loadProc("glVertexAttribI2uiv"); + api->VertexAttribI3uiv = loadProc("glVertexAttribI3uiv"); + api->VertexAttribI4uiv = loadProc("glVertexAttribI4uiv"); + api->VertexAttribI4bv = loadProc("glVertexAttribI4bv"); + api->VertexAttribI4sv = loadProc("glVertexAttribI4sv"); + api->VertexAttribI4ubv = loadProc("glVertexAttribI4ubv"); + api->VertexAttribI4usv = loadProc("glVertexAttribI4usv"); + api->GetUniformuiv = loadProc("glGetUniformuiv"); + api->BindFragDataLocation = loadProc("glBindFragDataLocation"); + api->GetFragDataLocation = loadProc("glGetFragDataLocation"); + api->Uniform1ui = loadProc("glUniform1ui"); + api->Uniform2ui = loadProc("glUniform2ui"); + api->Uniform3ui = loadProc("glUniform3ui"); + api->Uniform4ui = loadProc("glUniform4ui"); + api->Uniform1uiv = loadProc("glUniform1uiv"); + api->Uniform2uiv = loadProc("glUniform2uiv"); + api->Uniform3uiv = loadProc("glUniform3uiv"); + api->Uniform4uiv = loadProc("glUniform4uiv"); + api->TexParameterIiv = loadProc("glTexParameterIiv"); + api->TexParameterIuiv = loadProc("glTexParameterIuiv"); + api->GetTexParameterIiv = loadProc("glGetTexParameterIiv"); + api->GetTexParameterIuiv = loadProc("glGetTexParameterIuiv"); + api->ClearBufferiv = loadProc("glClearBufferiv"); + api->ClearBufferuiv = loadProc("glClearBufferuiv"); + api->ClearBufferfv = loadProc("glClearBufferfv"); + api->ClearBufferfi = loadProc("glClearBufferfi"); + api->GetStringi = loadProc("glGetStringi"); + api->IsRenderbuffer = loadProc("glIsRenderbuffer"); + api->BindRenderbuffer = loadProc("glBindRenderbuffer"); + api->DeleteRenderbuffers = loadProc("glDeleteRenderbuffers"); + api->GenRenderbuffers = loadProc("glGenRenderbuffers"); + api->RenderbufferStorage = loadProc("glRenderbufferStorage"); + api->GetRenderbufferParameteriv = loadProc("glGetRenderbufferParameteriv"); + api->IsFramebuffer = loadProc("glIsFramebuffer"); + api->BindFramebuffer = loadProc("glBindFramebuffer"); + api->DeleteFramebuffers = loadProc("glDeleteFramebuffers"); + api->GenFramebuffers = loadProc("glGenFramebuffers"); + api->CheckFramebufferStatus = loadProc("glCheckFramebufferStatus"); + api->FramebufferTexture1D = loadProc("glFramebufferTexture1D"); + api->FramebufferTexture2D = loadProc("glFramebufferTexture2D"); + api->FramebufferTexture3D = loadProc("glFramebufferTexture3D"); + api->FramebufferRenderbuffer = loadProc("glFramebufferRenderbuffer"); + api->GetFramebufferAttachmentParameteriv = loadProc("glGetFramebufferAttachmentParameteriv"); + api->GenerateMipmap = loadProc("glGenerateMipmap"); + api->BlitFramebuffer = loadProc("glBlitFramebuffer"); + api->RenderbufferStorageMultisample = loadProc("glRenderbufferStorageMultisample"); + api->FramebufferTextureLayer = loadProc("glFramebufferTextureLayer"); + api->MapBufferRange = loadProc("glMapBufferRange"); + api->FlushMappedBufferRange = loadProc("glFlushMappedBufferRange"); + api->BindVertexArray = loadProc("glBindVertexArray"); + api->DeleteVertexArrays = loadProc("glDeleteVertexArrays"); + api->GenVertexArrays = loadProc("glGenVertexArrays"); + api->IsVertexArray = loadProc("glIsVertexArray"); + api->DrawArraysInstanced = loadProc("glDrawArraysInstanced"); + api->DrawElementsInstanced = loadProc("glDrawElementsInstanced"); + api->TexBuffer = loadProc("glTexBuffer"); + api->PrimitiveRestartIndex = loadProc("glPrimitiveRestartIndex"); + api->CopyBufferSubData = loadProc("glCopyBufferSubData"); + api->GetUniformIndices = loadProc("glGetUniformIndices"); + api->GetActiveUniformsiv = loadProc("glGetActiveUniformsiv"); + api->GetActiveUniformName = loadProc("glGetActiveUniformName"); + api->GetUniformBlockIndex = loadProc("glGetUniformBlockIndex"); + api->GetActiveUniformBlockiv = loadProc("glGetActiveUniformBlockiv"); + api->GetActiveUniformBlockName = loadProc("glGetActiveUniformBlockName"); + api->UniformBlockBinding = loadProc("glUniformBlockBinding"); + api->BindBufferRange = loadProc("glBindBufferRange"); + api->BindBufferBase = loadProc("glBindBufferBase"); + api->GetIntegeri_v = loadProc("glGetIntegeri_v"); + api->DrawElementsBaseVertex = loadProc("glDrawElementsBaseVertex"); + api->DrawRangeElementsBaseVertex = loadProc("glDrawRangeElementsBaseVertex"); + api->DrawElementsInstancedBaseVertex = loadProc("glDrawElementsInstancedBaseVertex"); + api->MultiDrawElementsBaseVertex = loadProc("glMultiDrawElementsBaseVertex"); + api->ProvokingVertex = loadProc("glProvokingVertex"); + api->FenceSync = loadProc("glFenceSync"); + api->IsSync = loadProc("glIsSync"); + api->DeleteSync = loadProc("glDeleteSync"); + api->ClientWaitSync = loadProc("glClientWaitSync"); + api->WaitSync = loadProc("glWaitSync"); + api->GetInteger64v = loadProc("glGetInteger64v"); + api->GetSynciv = loadProc("glGetSynciv"); + api->GetInteger64i_v = loadProc("glGetInteger64i_v"); + api->GetBufferParameteri64v = loadProc("glGetBufferParameteri64v"); + api->FramebufferTexture = loadProc("glFramebufferTexture"); + api->TexImage2DMultisample = loadProc("glTexImage2DMultisample"); + api->TexImage3DMultisample = loadProc("glTexImage3DMultisample"); + api->GetMultisamplefv = loadProc("glGetMultisamplefv"); + api->SampleMaski = loadProc("glSampleMaski"); + api->BindFragDataLocationIndexed = loadProc("glBindFragDataLocationIndexed"); + api->GetFragDataIndex = loadProc("glGetFragDataIndex"); + api->GenSamplers = loadProc("glGenSamplers"); + api->DeleteSamplers = loadProc("glDeleteSamplers"); + api->IsSampler = loadProc("glIsSampler"); + api->BindSampler = loadProc("glBindSampler"); + api->SamplerParameteri = loadProc("glSamplerParameteri"); + api->SamplerParameteriv = loadProc("glSamplerParameteriv"); + api->SamplerParameterf = loadProc("glSamplerParameterf"); + api->SamplerParameterfv = loadProc("glSamplerParameterfv"); + api->SamplerParameterIiv = loadProc("glSamplerParameterIiv"); + api->SamplerParameterIuiv = loadProc("glSamplerParameterIuiv"); + api->GetSamplerParameteriv = loadProc("glGetSamplerParameteriv"); + api->GetSamplerParameterIiv = loadProc("glGetSamplerParameterIiv"); + api->GetSamplerParameterfv = loadProc("glGetSamplerParameterfv"); + api->GetSamplerParameterIuiv = loadProc("glGetSamplerParameterIuiv"); + api->QueryCounter = loadProc("glQueryCounter"); + api->GetQueryObjecti64v = loadProc("glGetQueryObjecti64v"); + api->GetQueryObjectui64v = loadProc("glGetQueryObjectui64v"); + api->VertexAttribDivisor = loadProc("glVertexAttribDivisor"); + api->VertexAttribP1ui = loadProc("glVertexAttribP1ui"); + api->VertexAttribP1uiv = loadProc("glVertexAttribP1uiv"); + api->VertexAttribP2ui = loadProc("glVertexAttribP2ui"); + api->VertexAttribP2uiv = loadProc("glVertexAttribP2uiv"); + api->VertexAttribP3ui = loadProc("glVertexAttribP3ui"); + api->VertexAttribP3uiv = loadProc("glVertexAttribP3uiv"); + api->VertexAttribP4ui = loadProc("glVertexAttribP4ui"); + api->VertexAttribP4uiv = loadProc("glVertexAttribP4uiv"); + api->MinSampleShading = loadProc("glMinSampleShading"); + api->BlendEquationi = loadProc("glBlendEquationi"); + api->BlendEquationSeparatei = loadProc("glBlendEquationSeparatei"); + api->BlendFunci = loadProc("glBlendFunci"); + api->BlendFuncSeparatei = loadProc("glBlendFuncSeparatei"); + api->DrawArraysIndirect = loadProc("glDrawArraysIndirect"); + api->DrawElementsIndirect = loadProc("glDrawElementsIndirect"); + api->Uniform1d = loadProc("glUniform1d"); + api->Uniform2d = loadProc("glUniform2d"); + api->Uniform3d = loadProc("glUniform3d"); + api->Uniform4d = loadProc("glUniform4d"); + api->Uniform1dv = loadProc("glUniform1dv"); + api->Uniform2dv = loadProc("glUniform2dv"); + api->Uniform3dv = loadProc("glUniform3dv"); + api->Uniform4dv = loadProc("glUniform4dv"); + api->UniformMatrix2dv = loadProc("glUniformMatrix2dv"); + api->UniformMatrix3dv = loadProc("glUniformMatrix3dv"); + api->UniformMatrix4dv = loadProc("glUniformMatrix4dv"); + api->UniformMatrix2x3dv = loadProc("glUniformMatrix2x3dv"); + api->UniformMatrix2x4dv = loadProc("glUniformMatrix2x4dv"); + api->UniformMatrix3x2dv = loadProc("glUniformMatrix3x2dv"); + api->UniformMatrix3x4dv = loadProc("glUniformMatrix3x4dv"); + api->UniformMatrix4x2dv = loadProc("glUniformMatrix4x2dv"); + api->UniformMatrix4x3dv = loadProc("glUniformMatrix4x3dv"); + api->GetUniformdv = loadProc("glGetUniformdv"); + api->GetSubroutineUniformLocation = loadProc("glGetSubroutineUniformLocation"); + api->GetSubroutineIndex = loadProc("glGetSubroutineIndex"); + api->GetActiveSubroutineUniformiv = loadProc("glGetActiveSubroutineUniformiv"); + api->GetActiveSubroutineUniformName = loadProc("glGetActiveSubroutineUniformName"); + api->GetActiveSubroutineName = loadProc("glGetActiveSubroutineName"); + api->UniformSubroutinesuiv = loadProc("glUniformSubroutinesuiv"); + api->GetUniformSubroutineuiv = loadProc("glGetUniformSubroutineuiv"); + api->GetProgramStageiv = loadProc("glGetProgramStageiv"); + api->PatchParameteri = loadProc("glPatchParameteri"); + api->PatchParameterfv = loadProc("glPatchParameterfv"); + api->BindTransformFeedback = loadProc("glBindTransformFeedback"); + api->DeleteTransformFeedbacks = loadProc("glDeleteTransformFeedbacks"); + api->GenTransformFeedbacks = loadProc("glGenTransformFeedbacks"); + api->IsTransformFeedback = loadProc("glIsTransformFeedback"); + api->PauseTransformFeedback = loadProc("glPauseTransformFeedback"); + api->ResumeTransformFeedback = loadProc("glResumeTransformFeedback"); + api->DrawTransformFeedback = loadProc("glDrawTransformFeedback"); + api->DrawTransformFeedbackStream = loadProc("glDrawTransformFeedbackStream"); + api->BeginQueryIndexed = loadProc("glBeginQueryIndexed"); + api->EndQueryIndexed = loadProc("glEndQueryIndexed"); + api->GetQueryIndexediv = loadProc("glGetQueryIndexediv"); + api->ReleaseShaderCompiler = loadProc("glReleaseShaderCompiler"); + api->ShaderBinary = loadProc("glShaderBinary"); + api->GetShaderPrecisionFormat = loadProc("glGetShaderPrecisionFormat"); + api->DepthRangef = loadProc("glDepthRangef"); + api->ClearDepthf = loadProc("glClearDepthf"); + api->GetProgramBinary = loadProc("glGetProgramBinary"); + api->ProgramBinary = loadProc("glProgramBinary"); + api->ProgramParameteri = loadProc("glProgramParameteri"); + api->UseProgramStages = loadProc("glUseProgramStages"); + api->ActiveShaderProgram = loadProc("glActiveShaderProgram"); + api->CreateShaderProgramv = loadProc("glCreateShaderProgramv"); + api->BindProgramPipeline = loadProc("glBindProgramPipeline"); + api->DeleteProgramPipelines = loadProc("glDeleteProgramPipelines"); + api->GenProgramPipelines = loadProc("glGenProgramPipelines"); + api->IsProgramPipeline = loadProc("glIsProgramPipeline"); + api->GetProgramPipelineiv = loadProc("glGetProgramPipelineiv"); + api->ProgramParameteri = loadProc("glProgramParameteri"); + api->ProgramUniform1i = loadProc("glProgramUniform1i"); + api->ProgramUniform1iv = loadProc("glProgramUniform1iv"); + api->ProgramUniform1f = loadProc("glProgramUniform1f"); + api->ProgramUniform1fv = loadProc("glProgramUniform1fv"); + api->ProgramUniform1d = loadProc("glProgramUniform1d"); + api->ProgramUniform1dv = loadProc("glProgramUniform1dv"); + api->ProgramUniform1ui = loadProc("glProgramUniform1ui"); + api->ProgramUniform1uiv = loadProc("glProgramUniform1uiv"); + api->ProgramUniform2i = loadProc("glProgramUniform2i"); + api->ProgramUniform2iv = loadProc("glProgramUniform2iv"); + api->ProgramUniform2f = loadProc("glProgramUniform2f"); + api->ProgramUniform2fv = loadProc("glProgramUniform2fv"); + api->ProgramUniform2d = loadProc("glProgramUniform2d"); + api->ProgramUniform2dv = loadProc("glProgramUniform2dv"); + api->ProgramUniform2ui = loadProc("glProgramUniform2ui"); + api->ProgramUniform2uiv = loadProc("glProgramUniform2uiv"); + api->ProgramUniform3i = loadProc("glProgramUniform3i"); + api->ProgramUniform3iv = loadProc("glProgramUniform3iv"); + api->ProgramUniform3f = loadProc("glProgramUniform3f"); + api->ProgramUniform3fv = loadProc("glProgramUniform3fv"); + api->ProgramUniform3d = loadProc("glProgramUniform3d"); + api->ProgramUniform3dv = loadProc("glProgramUniform3dv"); + api->ProgramUniform3ui = loadProc("glProgramUniform3ui"); + api->ProgramUniform3uiv = loadProc("glProgramUniform3uiv"); + api->ProgramUniform4i = loadProc("glProgramUniform4i"); + api->ProgramUniform4iv = loadProc("glProgramUniform4iv"); + api->ProgramUniform4f = loadProc("glProgramUniform4f"); + api->ProgramUniform4fv = loadProc("glProgramUniform4fv"); + api->ProgramUniform4d = loadProc("glProgramUniform4d"); + api->ProgramUniform4dv = loadProc("glProgramUniform4dv"); + api->ProgramUniform4ui = loadProc("glProgramUniform4ui"); + api->ProgramUniform4uiv = loadProc("glProgramUniform4uiv"); + api->ProgramUniformMatrix2fv = loadProc("glProgramUniformMatrix2fv"); + api->ProgramUniformMatrix3fv = loadProc("glProgramUniformMatrix3fv"); + api->ProgramUniformMatrix4fv = loadProc("glProgramUniformMatrix4fv"); + api->ProgramUniformMatrix2dv = loadProc("glProgramUniformMatrix2dv"); + api->ProgramUniformMatrix3dv = loadProc("glProgramUniformMatrix3dv"); + api->ProgramUniformMatrix4dv = loadProc("glProgramUniformMatrix4dv"); + api->ProgramUniformMatrix2x3fv = loadProc("glProgramUniformMatrix2x3fv"); + api->ProgramUniformMatrix3x2fv = loadProc("glProgramUniformMatrix3x2fv"); + api->ProgramUniformMatrix2x4fv = loadProc("glProgramUniformMatrix2x4fv"); + api->ProgramUniformMatrix4x2fv = loadProc("glProgramUniformMatrix4x2fv"); + api->ProgramUniformMatrix3x4fv = loadProc("glProgramUniformMatrix3x4fv"); + api->ProgramUniformMatrix4x3fv = loadProc("glProgramUniformMatrix4x3fv"); + api->ProgramUniformMatrix2x3dv = loadProc("glProgramUniformMatrix2x3dv"); + api->ProgramUniformMatrix3x2dv = loadProc("glProgramUniformMatrix3x2dv"); + api->ProgramUniformMatrix2x4dv = loadProc("glProgramUniformMatrix2x4dv"); + api->ProgramUniformMatrix4x2dv = loadProc("glProgramUniformMatrix4x2dv"); + api->ProgramUniformMatrix3x4dv = loadProc("glProgramUniformMatrix3x4dv"); + api->ProgramUniformMatrix4x3dv = loadProc("glProgramUniformMatrix4x3dv"); + api->ValidateProgramPipeline = loadProc("glValidateProgramPipeline"); + api->GetProgramPipelineInfoLog = loadProc("glGetProgramPipelineInfoLog"); + api->VertexAttribL1d = loadProc("glVertexAttribL1d"); + api->VertexAttribL2d = loadProc("glVertexAttribL2d"); + api->VertexAttribL3d = loadProc("glVertexAttribL3d"); + api->VertexAttribL4d = loadProc("glVertexAttribL4d"); + api->VertexAttribL1dv = loadProc("glVertexAttribL1dv"); + api->VertexAttribL2dv = loadProc("glVertexAttribL2dv"); + api->VertexAttribL3dv = loadProc("glVertexAttribL3dv"); + api->VertexAttribL4dv = loadProc("glVertexAttribL4dv"); + api->VertexAttribLPointer = loadProc("glVertexAttribLPointer"); + api->GetVertexAttribLdv = loadProc("glGetVertexAttribLdv"); + api->ViewportArrayv = loadProc("glViewportArrayv"); + api->ViewportIndexedf = loadProc("glViewportIndexedf"); + api->ViewportIndexedfv = loadProc("glViewportIndexedfv"); + api->ScissorArrayv = loadProc("glScissorArrayv"); + api->ScissorIndexed = loadProc("glScissorIndexed"); + api->ScissorIndexedv = loadProc("glScissorIndexedv"); + api->DepthRangeArrayv = loadProc("glDepthRangeArrayv"); + api->DepthRangeIndexed = loadProc("glDepthRangeIndexed"); + api->GetFloati_v = loadProc("glGetFloati_v"); + api->GetDoublei_v = loadProc("glGetDoublei_v"); + api->DrawArraysInstancedBaseInstance = loadProc("glDrawArraysInstancedBaseInstance"); + api->DrawElementsInstancedBaseInstance = loadProc("glDrawElementsInstancedBaseInstance"); + api->DrawElementsInstancedBaseVertexBaseInstance = loadProc("glDrawElementsInstancedBaseVertexBaseInstance"); + api->GetInternalformativ = loadProc("glGetInternalformativ"); + api->GetActiveAtomicCounterBufferiv = loadProc("glGetActiveAtomicCounterBufferiv"); + api->BindImageTexture = loadProc("glBindImageTexture"); + api->MemoryBarrier = loadProc("glMemoryBarrier"); + api->TexStorage1D = loadProc("glTexStorage1D"); + api->TexStorage2D = loadProc("glTexStorage2D"); + api->TexStorage3D = loadProc("glTexStorage3D"); + api->DrawTransformFeedbackInstanced = loadProc("glDrawTransformFeedbackInstanced"); + api->DrawTransformFeedbackStreamInstanced = loadProc("glDrawTransformFeedbackStreamInstanced"); + api->ClearBufferData = loadProc("glClearBufferData"); + api->ClearBufferSubData = loadProc("glClearBufferSubData"); + api->DispatchCompute = loadProc("glDispatchCompute"); + api->DispatchComputeIndirect = loadProc("glDispatchComputeIndirect"); + api->CopyImageSubData = loadProc("glCopyImageSubData"); + api->FramebufferParameteri = loadProc("glFramebufferParameteri"); + api->GetFramebufferParameteriv = loadProc("glGetFramebufferParameteriv"); + api->GetInternalformati64v = loadProc("glGetInternalformati64v"); + api->InvalidateTexSubImage = loadProc("glInvalidateTexSubImage"); + api->InvalidateTexImage = loadProc("glInvalidateTexImage"); + api->InvalidateBufferSubData = loadProc("glInvalidateBufferSubData"); + api->InvalidateBufferData = loadProc("glInvalidateBufferData"); + api->InvalidateFramebuffer = loadProc("glInvalidateFramebuffer"); + api->InvalidateSubFramebuffer = loadProc("glInvalidateSubFramebuffer"); + api->MultiDrawArraysIndirect = loadProc("glMultiDrawArraysIndirect"); + api->MultiDrawElementsIndirect = loadProc("glMultiDrawElementsIndirect"); + api->GetProgramInterfaceiv = loadProc("glGetProgramInterfaceiv"); + api->GetProgramResourceIndex = loadProc("glGetProgramResourceIndex"); + api->GetProgramResourceName = loadProc("glGetProgramResourceName"); + api->GetProgramResourceiv = loadProc("glGetProgramResourceiv"); + api->GetProgramResourceLocation = loadProc("glGetProgramResourceLocation"); + api->GetProgramResourceLocationIndex = loadProc("glGetProgramResourceLocationIndex"); + api->ShaderStorageBlockBinding = loadProc("glShaderStorageBlockBinding"); + api->TexBufferRange = loadProc("glTexBufferRange"); + api->TexStorage2DMultisample = loadProc("glTexStorage2DMultisample"); + api->TexStorage3DMultisample = loadProc("glTexStorage3DMultisample"); + api->TextureView = loadProc("glTextureView"); + api->BindVertexBuffer = loadProc("glBindVertexBuffer"); + api->VertexAttribFormat = loadProc("glVertexAttribFormat"); + api->VertexAttribIFormat = loadProc("glVertexAttribIFormat"); + api->VertexAttribLFormat = loadProc("glVertexAttribLFormat"); + api->VertexAttribBinding = loadProc("glVertexAttribBinding"); + api->VertexBindingDivisor = loadProc("glVertexBindingDivisor"); + api->DebugMessageControl = loadProc("glDebugMessageControl"); + api->DebugMessageInsert = loadProc("glDebugMessageInsert"); + api->DebugMessageCallback = loadProc("glDebugMessageCallback"); + api->GetDebugMessageLog = loadProc("glGetDebugMessageLog"); + api->PushDebugGroup = loadProc("glPushDebugGroup"); + api->PopDebugGroup = loadProc("glPopDebugGroup"); + api->ObjectLabel = loadProc("glObjectLabel"); + api->GetObjectLabel = loadProc("glGetObjectLabel"); + api->ObjectPtrLabel = loadProc("glObjectPtrLabel"); + api->GetObjectPtrLabel = loadProc("glGetObjectPtrLabel"); + api->GetPointerv = loadProc("glGetPointerv"); +} + +void mg_gl_load_gl44(mg_gl_api* api, mg_gl_load_proc loadProc) +{ + api->CullFace = loadProc("glCullFace"); + api->FrontFace = loadProc("glFrontFace"); + api->Hint = loadProc("glHint"); + api->LineWidth = loadProc("glLineWidth"); + api->PointSize = loadProc("glPointSize"); + api->PolygonMode = loadProc("glPolygonMode"); + api->Scissor = loadProc("glScissor"); + api->TexParameterf = loadProc("glTexParameterf"); + api->TexParameterfv = loadProc("glTexParameterfv"); + api->TexParameteri = loadProc("glTexParameteri"); + api->TexParameteriv = loadProc("glTexParameteriv"); + api->TexImage1D = loadProc("glTexImage1D"); + api->TexImage2D = loadProc("glTexImage2D"); + api->DrawBuffer = loadProc("glDrawBuffer"); + api->Clear = loadProc("glClear"); + api->ClearColor = loadProc("glClearColor"); + api->ClearStencil = loadProc("glClearStencil"); + api->ClearDepth = loadProc("glClearDepth"); + api->StencilMask = loadProc("glStencilMask"); + api->ColorMask = loadProc("glColorMask"); + api->DepthMask = loadProc("glDepthMask"); + api->Disable = loadProc("glDisable"); + api->Enable = loadProc("glEnable"); + api->Finish = loadProc("glFinish"); + api->Flush = loadProc("glFlush"); + api->BlendFunc = loadProc("glBlendFunc"); + api->LogicOp = loadProc("glLogicOp"); + api->StencilFunc = loadProc("glStencilFunc"); + api->StencilOp = loadProc("glStencilOp"); + api->DepthFunc = loadProc("glDepthFunc"); + api->PixelStoref = loadProc("glPixelStoref"); + api->PixelStorei = loadProc("glPixelStorei"); + api->ReadBuffer = loadProc("glReadBuffer"); + api->ReadPixels = loadProc("glReadPixels"); + api->GetBooleanv = loadProc("glGetBooleanv"); + api->GetDoublev = loadProc("glGetDoublev"); + api->GetError = loadProc("glGetError"); + api->GetFloatv = loadProc("glGetFloatv"); + api->GetIntegerv = loadProc("glGetIntegerv"); + api->GetString = loadProc("glGetString"); + api->GetTexImage = loadProc("glGetTexImage"); + api->GetTexParameterfv = loadProc("glGetTexParameterfv"); + api->GetTexParameteriv = loadProc("glGetTexParameteriv"); + api->GetTexLevelParameterfv = loadProc("glGetTexLevelParameterfv"); + api->GetTexLevelParameteriv = loadProc("glGetTexLevelParameteriv"); + api->IsEnabled = loadProc("glIsEnabled"); + api->DepthRange = loadProc("glDepthRange"); + api->Viewport = loadProc("glViewport"); + api->DrawArrays = loadProc("glDrawArrays"); + api->DrawElements = loadProc("glDrawElements"); + api->PolygonOffset = loadProc("glPolygonOffset"); + api->CopyTexImage1D = loadProc("glCopyTexImage1D"); + api->CopyTexImage2D = loadProc("glCopyTexImage2D"); + api->CopyTexSubImage1D = loadProc("glCopyTexSubImage1D"); + api->CopyTexSubImage2D = loadProc("glCopyTexSubImage2D"); + api->TexSubImage1D = loadProc("glTexSubImage1D"); + api->TexSubImage2D = loadProc("glTexSubImage2D"); + api->BindTexture = loadProc("glBindTexture"); + api->DeleteTextures = loadProc("glDeleteTextures"); + api->GenTextures = loadProc("glGenTextures"); + api->IsTexture = loadProc("glIsTexture"); + api->DrawRangeElements = loadProc("glDrawRangeElements"); + api->TexImage3D = loadProc("glTexImage3D"); + api->TexSubImage3D = loadProc("glTexSubImage3D"); + api->CopyTexSubImage3D = loadProc("glCopyTexSubImage3D"); + api->ActiveTexture = loadProc("glActiveTexture"); + api->SampleCoverage = loadProc("glSampleCoverage"); + api->CompressedTexImage3D = loadProc("glCompressedTexImage3D"); + api->CompressedTexImage2D = loadProc("glCompressedTexImage2D"); + api->CompressedTexImage1D = loadProc("glCompressedTexImage1D"); + api->CompressedTexSubImage3D = loadProc("glCompressedTexSubImage3D"); + api->CompressedTexSubImage2D = loadProc("glCompressedTexSubImage2D"); + api->CompressedTexSubImage1D = loadProc("glCompressedTexSubImage1D"); + api->GetCompressedTexImage = loadProc("glGetCompressedTexImage"); + api->BlendFuncSeparate = loadProc("glBlendFuncSeparate"); + api->MultiDrawArrays = loadProc("glMultiDrawArrays"); + api->MultiDrawElements = loadProc("glMultiDrawElements"); + api->PointParameterf = loadProc("glPointParameterf"); + api->PointParameterfv = loadProc("glPointParameterfv"); + api->PointParameteri = loadProc("glPointParameteri"); + api->PointParameteriv = loadProc("glPointParameteriv"); + api->BlendColor = loadProc("glBlendColor"); + api->BlendEquation = loadProc("glBlendEquation"); + api->GenQueries = loadProc("glGenQueries"); + api->DeleteQueries = loadProc("glDeleteQueries"); + api->IsQuery = loadProc("glIsQuery"); + api->BeginQuery = loadProc("glBeginQuery"); + api->EndQuery = loadProc("glEndQuery"); + api->GetQueryiv = loadProc("glGetQueryiv"); + api->GetQueryObjectiv = loadProc("glGetQueryObjectiv"); + api->GetQueryObjectuiv = loadProc("glGetQueryObjectuiv"); + api->BindBuffer = loadProc("glBindBuffer"); + api->DeleteBuffers = loadProc("glDeleteBuffers"); + api->GenBuffers = loadProc("glGenBuffers"); + api->IsBuffer = loadProc("glIsBuffer"); + api->BufferData = loadProc("glBufferData"); + api->BufferSubData = loadProc("glBufferSubData"); + api->GetBufferSubData = loadProc("glGetBufferSubData"); + api->MapBuffer = loadProc("glMapBuffer"); + api->UnmapBuffer = loadProc("glUnmapBuffer"); + api->GetBufferParameteriv = loadProc("glGetBufferParameteriv"); + api->GetBufferPointerv = loadProc("glGetBufferPointerv"); + api->BlendEquationSeparate = loadProc("glBlendEquationSeparate"); + api->DrawBuffers = loadProc("glDrawBuffers"); + api->StencilOpSeparate = loadProc("glStencilOpSeparate"); + api->StencilFuncSeparate = loadProc("glStencilFuncSeparate"); + api->StencilMaskSeparate = loadProc("glStencilMaskSeparate"); + api->AttachShader = loadProc("glAttachShader"); + api->BindAttribLocation = loadProc("glBindAttribLocation"); + api->CompileShader = loadProc("glCompileShader"); + api->CreateProgram = loadProc("glCreateProgram"); + api->CreateShader = loadProc("glCreateShader"); + api->DeleteProgram = loadProc("glDeleteProgram"); + api->DeleteShader = loadProc("glDeleteShader"); + api->DetachShader = loadProc("glDetachShader"); + api->DisableVertexAttribArray = loadProc("glDisableVertexAttribArray"); + api->EnableVertexAttribArray = loadProc("glEnableVertexAttribArray"); + api->GetActiveAttrib = loadProc("glGetActiveAttrib"); + api->GetActiveUniform = loadProc("glGetActiveUniform"); + api->GetAttachedShaders = loadProc("glGetAttachedShaders"); + api->GetAttribLocation = loadProc("glGetAttribLocation"); + api->GetProgramiv = loadProc("glGetProgramiv"); + api->GetProgramInfoLog = loadProc("glGetProgramInfoLog"); + api->GetShaderiv = loadProc("glGetShaderiv"); + api->GetShaderInfoLog = loadProc("glGetShaderInfoLog"); + api->GetShaderSource = loadProc("glGetShaderSource"); + api->GetUniformLocation = loadProc("glGetUniformLocation"); + api->GetUniformfv = loadProc("glGetUniformfv"); + api->GetUniformiv = loadProc("glGetUniformiv"); + api->GetVertexAttribdv = loadProc("glGetVertexAttribdv"); + api->GetVertexAttribfv = loadProc("glGetVertexAttribfv"); + api->GetVertexAttribiv = loadProc("glGetVertexAttribiv"); + api->GetVertexAttribPointerv = loadProc("glGetVertexAttribPointerv"); + api->IsProgram = loadProc("glIsProgram"); + api->IsShader = loadProc("glIsShader"); + api->LinkProgram = loadProc("glLinkProgram"); + api->ShaderSource = loadProc("glShaderSource"); + api->UseProgram = loadProc("glUseProgram"); + api->Uniform1f = loadProc("glUniform1f"); + api->Uniform2f = loadProc("glUniform2f"); + api->Uniform3f = loadProc("glUniform3f"); + api->Uniform4f = loadProc("glUniform4f"); + api->Uniform1i = loadProc("glUniform1i"); + api->Uniform2i = loadProc("glUniform2i"); + api->Uniform3i = loadProc("glUniform3i"); + api->Uniform4i = loadProc("glUniform4i"); + api->Uniform1fv = loadProc("glUniform1fv"); + api->Uniform2fv = loadProc("glUniform2fv"); + api->Uniform3fv = loadProc("glUniform3fv"); + api->Uniform4fv = loadProc("glUniform4fv"); + api->Uniform1iv = loadProc("glUniform1iv"); + api->Uniform2iv = loadProc("glUniform2iv"); + api->Uniform3iv = loadProc("glUniform3iv"); + api->Uniform4iv = loadProc("glUniform4iv"); + api->UniformMatrix2fv = loadProc("glUniformMatrix2fv"); + api->UniformMatrix3fv = loadProc("glUniformMatrix3fv"); + api->UniformMatrix4fv = loadProc("glUniformMatrix4fv"); + api->ValidateProgram = loadProc("glValidateProgram"); + api->VertexAttrib1d = loadProc("glVertexAttrib1d"); + api->VertexAttrib1dv = loadProc("glVertexAttrib1dv"); + api->VertexAttrib1f = loadProc("glVertexAttrib1f"); + api->VertexAttrib1fv = loadProc("glVertexAttrib1fv"); + api->VertexAttrib1s = loadProc("glVertexAttrib1s"); + api->VertexAttrib1sv = loadProc("glVertexAttrib1sv"); + api->VertexAttrib2d = loadProc("glVertexAttrib2d"); + api->VertexAttrib2dv = loadProc("glVertexAttrib2dv"); + api->VertexAttrib2f = loadProc("glVertexAttrib2f"); + api->VertexAttrib2fv = loadProc("glVertexAttrib2fv"); + api->VertexAttrib2s = loadProc("glVertexAttrib2s"); + api->VertexAttrib2sv = loadProc("glVertexAttrib2sv"); + api->VertexAttrib3d = loadProc("glVertexAttrib3d"); + api->VertexAttrib3dv = loadProc("glVertexAttrib3dv"); + api->VertexAttrib3f = loadProc("glVertexAttrib3f"); + api->VertexAttrib3fv = loadProc("glVertexAttrib3fv"); + api->VertexAttrib3s = loadProc("glVertexAttrib3s"); + api->VertexAttrib3sv = loadProc("glVertexAttrib3sv"); + api->VertexAttrib4Nbv = loadProc("glVertexAttrib4Nbv"); + api->VertexAttrib4Niv = loadProc("glVertexAttrib4Niv"); + api->VertexAttrib4Nsv = loadProc("glVertexAttrib4Nsv"); + api->VertexAttrib4Nub = loadProc("glVertexAttrib4Nub"); + api->VertexAttrib4Nubv = loadProc("glVertexAttrib4Nubv"); + api->VertexAttrib4Nuiv = loadProc("glVertexAttrib4Nuiv"); + api->VertexAttrib4Nusv = loadProc("glVertexAttrib4Nusv"); + api->VertexAttrib4bv = loadProc("glVertexAttrib4bv"); + api->VertexAttrib4d = loadProc("glVertexAttrib4d"); + api->VertexAttrib4dv = loadProc("glVertexAttrib4dv"); + api->VertexAttrib4f = loadProc("glVertexAttrib4f"); + api->VertexAttrib4fv = loadProc("glVertexAttrib4fv"); + api->VertexAttrib4iv = loadProc("glVertexAttrib4iv"); + api->VertexAttrib4s = loadProc("glVertexAttrib4s"); + api->VertexAttrib4sv = loadProc("glVertexAttrib4sv"); + api->VertexAttrib4ubv = loadProc("glVertexAttrib4ubv"); + api->VertexAttrib4uiv = loadProc("glVertexAttrib4uiv"); + api->VertexAttrib4usv = loadProc("glVertexAttrib4usv"); + api->VertexAttribPointer = loadProc("glVertexAttribPointer"); + api->UniformMatrix2x3fv = loadProc("glUniformMatrix2x3fv"); + api->UniformMatrix3x2fv = loadProc("glUniformMatrix3x2fv"); + api->UniformMatrix2x4fv = loadProc("glUniformMatrix2x4fv"); + api->UniformMatrix4x2fv = loadProc("glUniformMatrix4x2fv"); + api->UniformMatrix3x4fv = loadProc("glUniformMatrix3x4fv"); + api->UniformMatrix4x3fv = loadProc("glUniformMatrix4x3fv"); + api->ColorMaski = loadProc("glColorMaski"); + api->GetBooleani_v = loadProc("glGetBooleani_v"); + api->GetIntegeri_v = loadProc("glGetIntegeri_v"); + api->Enablei = loadProc("glEnablei"); + api->Disablei = loadProc("glDisablei"); + api->IsEnabledi = loadProc("glIsEnabledi"); + api->BeginTransformFeedback = loadProc("glBeginTransformFeedback"); + api->EndTransformFeedback = loadProc("glEndTransformFeedback"); + api->BindBufferRange = loadProc("glBindBufferRange"); + api->BindBufferBase = loadProc("glBindBufferBase"); + api->TransformFeedbackVaryings = loadProc("glTransformFeedbackVaryings"); + api->GetTransformFeedbackVarying = loadProc("glGetTransformFeedbackVarying"); + api->ClampColor = loadProc("glClampColor"); + api->BeginConditionalRender = loadProc("glBeginConditionalRender"); + api->EndConditionalRender = loadProc("glEndConditionalRender"); + api->VertexAttribIPointer = loadProc("glVertexAttribIPointer"); + api->GetVertexAttribIiv = loadProc("glGetVertexAttribIiv"); + api->GetVertexAttribIuiv = loadProc("glGetVertexAttribIuiv"); + api->VertexAttribI1i = loadProc("glVertexAttribI1i"); + api->VertexAttribI2i = loadProc("glVertexAttribI2i"); + api->VertexAttribI3i = loadProc("glVertexAttribI3i"); + api->VertexAttribI4i = loadProc("glVertexAttribI4i"); + api->VertexAttribI1ui = loadProc("glVertexAttribI1ui"); + api->VertexAttribI2ui = loadProc("glVertexAttribI2ui"); + api->VertexAttribI3ui = loadProc("glVertexAttribI3ui"); + api->VertexAttribI4ui = loadProc("glVertexAttribI4ui"); + api->VertexAttribI1iv = loadProc("glVertexAttribI1iv"); + api->VertexAttribI2iv = loadProc("glVertexAttribI2iv"); + api->VertexAttribI3iv = loadProc("glVertexAttribI3iv"); + api->VertexAttribI4iv = loadProc("glVertexAttribI4iv"); + api->VertexAttribI1uiv = loadProc("glVertexAttribI1uiv"); + api->VertexAttribI2uiv = loadProc("glVertexAttribI2uiv"); + api->VertexAttribI3uiv = loadProc("glVertexAttribI3uiv"); + api->VertexAttribI4uiv = loadProc("glVertexAttribI4uiv"); + api->VertexAttribI4bv = loadProc("glVertexAttribI4bv"); + api->VertexAttribI4sv = loadProc("glVertexAttribI4sv"); + api->VertexAttribI4ubv = loadProc("glVertexAttribI4ubv"); + api->VertexAttribI4usv = loadProc("glVertexAttribI4usv"); + api->GetUniformuiv = loadProc("glGetUniformuiv"); + api->BindFragDataLocation = loadProc("glBindFragDataLocation"); + api->GetFragDataLocation = loadProc("glGetFragDataLocation"); + api->Uniform1ui = loadProc("glUniform1ui"); + api->Uniform2ui = loadProc("glUniform2ui"); + api->Uniform3ui = loadProc("glUniform3ui"); + api->Uniform4ui = loadProc("glUniform4ui"); + api->Uniform1uiv = loadProc("glUniform1uiv"); + api->Uniform2uiv = loadProc("glUniform2uiv"); + api->Uniform3uiv = loadProc("glUniform3uiv"); + api->Uniform4uiv = loadProc("glUniform4uiv"); + api->TexParameterIiv = loadProc("glTexParameterIiv"); + api->TexParameterIuiv = loadProc("glTexParameterIuiv"); + api->GetTexParameterIiv = loadProc("glGetTexParameterIiv"); + api->GetTexParameterIuiv = loadProc("glGetTexParameterIuiv"); + api->ClearBufferiv = loadProc("glClearBufferiv"); + api->ClearBufferuiv = loadProc("glClearBufferuiv"); + api->ClearBufferfv = loadProc("glClearBufferfv"); + api->ClearBufferfi = loadProc("glClearBufferfi"); + api->GetStringi = loadProc("glGetStringi"); + api->IsRenderbuffer = loadProc("glIsRenderbuffer"); + api->BindRenderbuffer = loadProc("glBindRenderbuffer"); + api->DeleteRenderbuffers = loadProc("glDeleteRenderbuffers"); + api->GenRenderbuffers = loadProc("glGenRenderbuffers"); + api->RenderbufferStorage = loadProc("glRenderbufferStorage"); + api->GetRenderbufferParameteriv = loadProc("glGetRenderbufferParameteriv"); + api->IsFramebuffer = loadProc("glIsFramebuffer"); + api->BindFramebuffer = loadProc("glBindFramebuffer"); + api->DeleteFramebuffers = loadProc("glDeleteFramebuffers"); + api->GenFramebuffers = loadProc("glGenFramebuffers"); + api->CheckFramebufferStatus = loadProc("glCheckFramebufferStatus"); + api->FramebufferTexture1D = loadProc("glFramebufferTexture1D"); + api->FramebufferTexture2D = loadProc("glFramebufferTexture2D"); + api->FramebufferTexture3D = loadProc("glFramebufferTexture3D"); + api->FramebufferRenderbuffer = loadProc("glFramebufferRenderbuffer"); + api->GetFramebufferAttachmentParameteriv = loadProc("glGetFramebufferAttachmentParameteriv"); + api->GenerateMipmap = loadProc("glGenerateMipmap"); + api->BlitFramebuffer = loadProc("glBlitFramebuffer"); + api->RenderbufferStorageMultisample = loadProc("glRenderbufferStorageMultisample"); + api->FramebufferTextureLayer = loadProc("glFramebufferTextureLayer"); + api->MapBufferRange = loadProc("glMapBufferRange"); + api->FlushMappedBufferRange = loadProc("glFlushMappedBufferRange"); + api->BindVertexArray = loadProc("glBindVertexArray"); + api->DeleteVertexArrays = loadProc("glDeleteVertexArrays"); + api->GenVertexArrays = loadProc("glGenVertexArrays"); + api->IsVertexArray = loadProc("glIsVertexArray"); + api->DrawArraysInstanced = loadProc("glDrawArraysInstanced"); + api->DrawElementsInstanced = loadProc("glDrawElementsInstanced"); + api->TexBuffer = loadProc("glTexBuffer"); + api->PrimitiveRestartIndex = loadProc("glPrimitiveRestartIndex"); + api->CopyBufferSubData = loadProc("glCopyBufferSubData"); + api->GetUniformIndices = loadProc("glGetUniformIndices"); + api->GetActiveUniformsiv = loadProc("glGetActiveUniformsiv"); + api->GetActiveUniformName = loadProc("glGetActiveUniformName"); + api->GetUniformBlockIndex = loadProc("glGetUniformBlockIndex"); + api->GetActiveUniformBlockiv = loadProc("glGetActiveUniformBlockiv"); + api->GetActiveUniformBlockName = loadProc("glGetActiveUniformBlockName"); + api->UniformBlockBinding = loadProc("glUniformBlockBinding"); + api->BindBufferRange = loadProc("glBindBufferRange"); + api->BindBufferBase = loadProc("glBindBufferBase"); + api->GetIntegeri_v = loadProc("glGetIntegeri_v"); + api->DrawElementsBaseVertex = loadProc("glDrawElementsBaseVertex"); + api->DrawRangeElementsBaseVertex = loadProc("glDrawRangeElementsBaseVertex"); + api->DrawElementsInstancedBaseVertex = loadProc("glDrawElementsInstancedBaseVertex"); + api->MultiDrawElementsBaseVertex = loadProc("glMultiDrawElementsBaseVertex"); + api->ProvokingVertex = loadProc("glProvokingVertex"); + api->FenceSync = loadProc("glFenceSync"); + api->IsSync = loadProc("glIsSync"); + api->DeleteSync = loadProc("glDeleteSync"); + api->ClientWaitSync = loadProc("glClientWaitSync"); + api->WaitSync = loadProc("glWaitSync"); + api->GetInteger64v = loadProc("glGetInteger64v"); + api->GetSynciv = loadProc("glGetSynciv"); + api->GetInteger64i_v = loadProc("glGetInteger64i_v"); + api->GetBufferParameteri64v = loadProc("glGetBufferParameteri64v"); + api->FramebufferTexture = loadProc("glFramebufferTexture"); + api->TexImage2DMultisample = loadProc("glTexImage2DMultisample"); + api->TexImage3DMultisample = loadProc("glTexImage3DMultisample"); + api->GetMultisamplefv = loadProc("glGetMultisamplefv"); + api->SampleMaski = loadProc("glSampleMaski"); + api->BindFragDataLocationIndexed = loadProc("glBindFragDataLocationIndexed"); + api->GetFragDataIndex = loadProc("glGetFragDataIndex"); + api->GenSamplers = loadProc("glGenSamplers"); + api->DeleteSamplers = loadProc("glDeleteSamplers"); + api->IsSampler = loadProc("glIsSampler"); + api->BindSampler = loadProc("glBindSampler"); + api->SamplerParameteri = loadProc("glSamplerParameteri"); + api->SamplerParameteriv = loadProc("glSamplerParameteriv"); + api->SamplerParameterf = loadProc("glSamplerParameterf"); + api->SamplerParameterfv = loadProc("glSamplerParameterfv"); + api->SamplerParameterIiv = loadProc("glSamplerParameterIiv"); + api->SamplerParameterIuiv = loadProc("glSamplerParameterIuiv"); + api->GetSamplerParameteriv = loadProc("glGetSamplerParameteriv"); + api->GetSamplerParameterIiv = loadProc("glGetSamplerParameterIiv"); + api->GetSamplerParameterfv = loadProc("glGetSamplerParameterfv"); + api->GetSamplerParameterIuiv = loadProc("glGetSamplerParameterIuiv"); + api->QueryCounter = loadProc("glQueryCounter"); + api->GetQueryObjecti64v = loadProc("glGetQueryObjecti64v"); + api->GetQueryObjectui64v = loadProc("glGetQueryObjectui64v"); + api->VertexAttribDivisor = loadProc("glVertexAttribDivisor"); + api->VertexAttribP1ui = loadProc("glVertexAttribP1ui"); + api->VertexAttribP1uiv = loadProc("glVertexAttribP1uiv"); + api->VertexAttribP2ui = loadProc("glVertexAttribP2ui"); + api->VertexAttribP2uiv = loadProc("glVertexAttribP2uiv"); + api->VertexAttribP3ui = loadProc("glVertexAttribP3ui"); + api->VertexAttribP3uiv = loadProc("glVertexAttribP3uiv"); + api->VertexAttribP4ui = loadProc("glVertexAttribP4ui"); + api->VertexAttribP4uiv = loadProc("glVertexAttribP4uiv"); + api->MinSampleShading = loadProc("glMinSampleShading"); + api->BlendEquationi = loadProc("glBlendEquationi"); + api->BlendEquationSeparatei = loadProc("glBlendEquationSeparatei"); + api->BlendFunci = loadProc("glBlendFunci"); + api->BlendFuncSeparatei = loadProc("glBlendFuncSeparatei"); + api->DrawArraysIndirect = loadProc("glDrawArraysIndirect"); + api->DrawElementsIndirect = loadProc("glDrawElementsIndirect"); + api->Uniform1d = loadProc("glUniform1d"); + api->Uniform2d = loadProc("glUniform2d"); + api->Uniform3d = loadProc("glUniform3d"); + api->Uniform4d = loadProc("glUniform4d"); + api->Uniform1dv = loadProc("glUniform1dv"); + api->Uniform2dv = loadProc("glUniform2dv"); + api->Uniform3dv = loadProc("glUniform3dv"); + api->Uniform4dv = loadProc("glUniform4dv"); + api->UniformMatrix2dv = loadProc("glUniformMatrix2dv"); + api->UniformMatrix3dv = loadProc("glUniformMatrix3dv"); + api->UniformMatrix4dv = loadProc("glUniformMatrix4dv"); + api->UniformMatrix2x3dv = loadProc("glUniformMatrix2x3dv"); + api->UniformMatrix2x4dv = loadProc("glUniformMatrix2x4dv"); + api->UniformMatrix3x2dv = loadProc("glUniformMatrix3x2dv"); + api->UniformMatrix3x4dv = loadProc("glUniformMatrix3x4dv"); + api->UniformMatrix4x2dv = loadProc("glUniformMatrix4x2dv"); + api->UniformMatrix4x3dv = loadProc("glUniformMatrix4x3dv"); + api->GetUniformdv = loadProc("glGetUniformdv"); + api->GetSubroutineUniformLocation = loadProc("glGetSubroutineUniformLocation"); + api->GetSubroutineIndex = loadProc("glGetSubroutineIndex"); + api->GetActiveSubroutineUniformiv = loadProc("glGetActiveSubroutineUniformiv"); + api->GetActiveSubroutineUniformName = loadProc("glGetActiveSubroutineUniformName"); + api->GetActiveSubroutineName = loadProc("glGetActiveSubroutineName"); + api->UniformSubroutinesuiv = loadProc("glUniformSubroutinesuiv"); + api->GetUniformSubroutineuiv = loadProc("glGetUniformSubroutineuiv"); + api->GetProgramStageiv = loadProc("glGetProgramStageiv"); + api->PatchParameteri = loadProc("glPatchParameteri"); + api->PatchParameterfv = loadProc("glPatchParameterfv"); + api->BindTransformFeedback = loadProc("glBindTransformFeedback"); + api->DeleteTransformFeedbacks = loadProc("glDeleteTransformFeedbacks"); + api->GenTransformFeedbacks = loadProc("glGenTransformFeedbacks"); + api->IsTransformFeedback = loadProc("glIsTransformFeedback"); + api->PauseTransformFeedback = loadProc("glPauseTransformFeedback"); + api->ResumeTransformFeedback = loadProc("glResumeTransformFeedback"); + api->DrawTransformFeedback = loadProc("glDrawTransformFeedback"); + api->DrawTransformFeedbackStream = loadProc("glDrawTransformFeedbackStream"); + api->BeginQueryIndexed = loadProc("glBeginQueryIndexed"); + api->EndQueryIndexed = loadProc("glEndQueryIndexed"); + api->GetQueryIndexediv = loadProc("glGetQueryIndexediv"); + api->ReleaseShaderCompiler = loadProc("glReleaseShaderCompiler"); + api->ShaderBinary = loadProc("glShaderBinary"); + api->GetShaderPrecisionFormat = loadProc("glGetShaderPrecisionFormat"); + api->DepthRangef = loadProc("glDepthRangef"); + api->ClearDepthf = loadProc("glClearDepthf"); + api->GetProgramBinary = loadProc("glGetProgramBinary"); + api->ProgramBinary = loadProc("glProgramBinary"); + api->ProgramParameteri = loadProc("glProgramParameteri"); + api->UseProgramStages = loadProc("glUseProgramStages"); + api->ActiveShaderProgram = loadProc("glActiveShaderProgram"); + api->CreateShaderProgramv = loadProc("glCreateShaderProgramv"); + api->BindProgramPipeline = loadProc("glBindProgramPipeline"); + api->DeleteProgramPipelines = loadProc("glDeleteProgramPipelines"); + api->GenProgramPipelines = loadProc("glGenProgramPipelines"); + api->IsProgramPipeline = loadProc("glIsProgramPipeline"); + api->GetProgramPipelineiv = loadProc("glGetProgramPipelineiv"); + api->ProgramParameteri = loadProc("glProgramParameteri"); + api->ProgramUniform1i = loadProc("glProgramUniform1i"); + api->ProgramUniform1iv = loadProc("glProgramUniform1iv"); + api->ProgramUniform1f = loadProc("glProgramUniform1f"); + api->ProgramUniform1fv = loadProc("glProgramUniform1fv"); + api->ProgramUniform1d = loadProc("glProgramUniform1d"); + api->ProgramUniform1dv = loadProc("glProgramUniform1dv"); + api->ProgramUniform1ui = loadProc("glProgramUniform1ui"); + api->ProgramUniform1uiv = loadProc("glProgramUniform1uiv"); + api->ProgramUniform2i = loadProc("glProgramUniform2i"); + api->ProgramUniform2iv = loadProc("glProgramUniform2iv"); + api->ProgramUniform2f = loadProc("glProgramUniform2f"); + api->ProgramUniform2fv = loadProc("glProgramUniform2fv"); + api->ProgramUniform2d = loadProc("glProgramUniform2d"); + api->ProgramUniform2dv = loadProc("glProgramUniform2dv"); + api->ProgramUniform2ui = loadProc("glProgramUniform2ui"); + api->ProgramUniform2uiv = loadProc("glProgramUniform2uiv"); + api->ProgramUniform3i = loadProc("glProgramUniform3i"); + api->ProgramUniform3iv = loadProc("glProgramUniform3iv"); + api->ProgramUniform3f = loadProc("glProgramUniform3f"); + api->ProgramUniform3fv = loadProc("glProgramUniform3fv"); + api->ProgramUniform3d = loadProc("glProgramUniform3d"); + api->ProgramUniform3dv = loadProc("glProgramUniform3dv"); + api->ProgramUniform3ui = loadProc("glProgramUniform3ui"); + api->ProgramUniform3uiv = loadProc("glProgramUniform3uiv"); + api->ProgramUniform4i = loadProc("glProgramUniform4i"); + api->ProgramUniform4iv = loadProc("glProgramUniform4iv"); + api->ProgramUniform4f = loadProc("glProgramUniform4f"); + api->ProgramUniform4fv = loadProc("glProgramUniform4fv"); + api->ProgramUniform4d = loadProc("glProgramUniform4d"); + api->ProgramUniform4dv = loadProc("glProgramUniform4dv"); + api->ProgramUniform4ui = loadProc("glProgramUniform4ui"); + api->ProgramUniform4uiv = loadProc("glProgramUniform4uiv"); + api->ProgramUniformMatrix2fv = loadProc("glProgramUniformMatrix2fv"); + api->ProgramUniformMatrix3fv = loadProc("glProgramUniformMatrix3fv"); + api->ProgramUniformMatrix4fv = loadProc("glProgramUniformMatrix4fv"); + api->ProgramUniformMatrix2dv = loadProc("glProgramUniformMatrix2dv"); + api->ProgramUniformMatrix3dv = loadProc("glProgramUniformMatrix3dv"); + api->ProgramUniformMatrix4dv = loadProc("glProgramUniformMatrix4dv"); + api->ProgramUniformMatrix2x3fv = loadProc("glProgramUniformMatrix2x3fv"); + api->ProgramUniformMatrix3x2fv = loadProc("glProgramUniformMatrix3x2fv"); + api->ProgramUniformMatrix2x4fv = loadProc("glProgramUniformMatrix2x4fv"); + api->ProgramUniformMatrix4x2fv = loadProc("glProgramUniformMatrix4x2fv"); + api->ProgramUniformMatrix3x4fv = loadProc("glProgramUniformMatrix3x4fv"); + api->ProgramUniformMatrix4x3fv = loadProc("glProgramUniformMatrix4x3fv"); + api->ProgramUniformMatrix2x3dv = loadProc("glProgramUniformMatrix2x3dv"); + api->ProgramUniformMatrix3x2dv = loadProc("glProgramUniformMatrix3x2dv"); + api->ProgramUniformMatrix2x4dv = loadProc("glProgramUniformMatrix2x4dv"); + api->ProgramUniformMatrix4x2dv = loadProc("glProgramUniformMatrix4x2dv"); + api->ProgramUniformMatrix3x4dv = loadProc("glProgramUniformMatrix3x4dv"); + api->ProgramUniformMatrix4x3dv = loadProc("glProgramUniformMatrix4x3dv"); + api->ValidateProgramPipeline = loadProc("glValidateProgramPipeline"); + api->GetProgramPipelineInfoLog = loadProc("glGetProgramPipelineInfoLog"); + api->VertexAttribL1d = loadProc("glVertexAttribL1d"); + api->VertexAttribL2d = loadProc("glVertexAttribL2d"); + api->VertexAttribL3d = loadProc("glVertexAttribL3d"); + api->VertexAttribL4d = loadProc("glVertexAttribL4d"); + api->VertexAttribL1dv = loadProc("glVertexAttribL1dv"); + api->VertexAttribL2dv = loadProc("glVertexAttribL2dv"); + api->VertexAttribL3dv = loadProc("glVertexAttribL3dv"); + api->VertexAttribL4dv = loadProc("glVertexAttribL4dv"); + api->VertexAttribLPointer = loadProc("glVertexAttribLPointer"); + api->GetVertexAttribLdv = loadProc("glGetVertexAttribLdv"); + api->ViewportArrayv = loadProc("glViewportArrayv"); + api->ViewportIndexedf = loadProc("glViewportIndexedf"); + api->ViewportIndexedfv = loadProc("glViewportIndexedfv"); + api->ScissorArrayv = loadProc("glScissorArrayv"); + api->ScissorIndexed = loadProc("glScissorIndexed"); + api->ScissorIndexedv = loadProc("glScissorIndexedv"); + api->DepthRangeArrayv = loadProc("glDepthRangeArrayv"); + api->DepthRangeIndexed = loadProc("glDepthRangeIndexed"); + api->GetFloati_v = loadProc("glGetFloati_v"); + api->GetDoublei_v = loadProc("glGetDoublei_v"); + api->DrawArraysInstancedBaseInstance = loadProc("glDrawArraysInstancedBaseInstance"); + api->DrawElementsInstancedBaseInstance = loadProc("glDrawElementsInstancedBaseInstance"); + api->DrawElementsInstancedBaseVertexBaseInstance = loadProc("glDrawElementsInstancedBaseVertexBaseInstance"); + api->GetInternalformativ = loadProc("glGetInternalformativ"); + api->GetActiveAtomicCounterBufferiv = loadProc("glGetActiveAtomicCounterBufferiv"); + api->BindImageTexture = loadProc("glBindImageTexture"); + api->MemoryBarrier = loadProc("glMemoryBarrier"); + api->TexStorage1D = loadProc("glTexStorage1D"); + api->TexStorage2D = loadProc("glTexStorage2D"); + api->TexStorage3D = loadProc("glTexStorage3D"); + api->DrawTransformFeedbackInstanced = loadProc("glDrawTransformFeedbackInstanced"); + api->DrawTransformFeedbackStreamInstanced = loadProc("glDrawTransformFeedbackStreamInstanced"); + api->ClearBufferData = loadProc("glClearBufferData"); + api->ClearBufferSubData = loadProc("glClearBufferSubData"); + api->DispatchCompute = loadProc("glDispatchCompute"); + api->DispatchComputeIndirect = loadProc("glDispatchComputeIndirect"); + api->CopyImageSubData = loadProc("glCopyImageSubData"); + api->FramebufferParameteri = loadProc("glFramebufferParameteri"); + api->GetFramebufferParameteriv = loadProc("glGetFramebufferParameteriv"); + api->GetInternalformati64v = loadProc("glGetInternalformati64v"); + api->InvalidateTexSubImage = loadProc("glInvalidateTexSubImage"); + api->InvalidateTexImage = loadProc("glInvalidateTexImage"); + api->InvalidateBufferSubData = loadProc("glInvalidateBufferSubData"); + api->InvalidateBufferData = loadProc("glInvalidateBufferData"); + api->InvalidateFramebuffer = loadProc("glInvalidateFramebuffer"); + api->InvalidateSubFramebuffer = loadProc("glInvalidateSubFramebuffer"); + api->MultiDrawArraysIndirect = loadProc("glMultiDrawArraysIndirect"); + api->MultiDrawElementsIndirect = loadProc("glMultiDrawElementsIndirect"); + api->GetProgramInterfaceiv = loadProc("glGetProgramInterfaceiv"); + api->GetProgramResourceIndex = loadProc("glGetProgramResourceIndex"); + api->GetProgramResourceName = loadProc("glGetProgramResourceName"); + api->GetProgramResourceiv = loadProc("glGetProgramResourceiv"); + api->GetProgramResourceLocation = loadProc("glGetProgramResourceLocation"); + api->GetProgramResourceLocationIndex = loadProc("glGetProgramResourceLocationIndex"); + api->ShaderStorageBlockBinding = loadProc("glShaderStorageBlockBinding"); + api->TexBufferRange = loadProc("glTexBufferRange"); + api->TexStorage2DMultisample = loadProc("glTexStorage2DMultisample"); + api->TexStorage3DMultisample = loadProc("glTexStorage3DMultisample"); + api->TextureView = loadProc("glTextureView"); + api->BindVertexBuffer = loadProc("glBindVertexBuffer"); + api->VertexAttribFormat = loadProc("glVertexAttribFormat"); + api->VertexAttribIFormat = loadProc("glVertexAttribIFormat"); + api->VertexAttribLFormat = loadProc("glVertexAttribLFormat"); + api->VertexAttribBinding = loadProc("glVertexAttribBinding"); + api->VertexBindingDivisor = loadProc("glVertexBindingDivisor"); + api->DebugMessageControl = loadProc("glDebugMessageControl"); + api->DebugMessageInsert = loadProc("glDebugMessageInsert"); + api->DebugMessageCallback = loadProc("glDebugMessageCallback"); + api->GetDebugMessageLog = loadProc("glGetDebugMessageLog"); + api->PushDebugGroup = loadProc("glPushDebugGroup"); + api->PopDebugGroup = loadProc("glPopDebugGroup"); + api->ObjectLabel = loadProc("glObjectLabel"); + api->GetObjectLabel = loadProc("glGetObjectLabel"); + api->ObjectPtrLabel = loadProc("glObjectPtrLabel"); + api->GetObjectPtrLabel = loadProc("glGetObjectPtrLabel"); + api->GetPointerv = loadProc("glGetPointerv"); + api->BufferStorage = loadProc("glBufferStorage"); + api->ClearTexImage = loadProc("glClearTexImage"); + api->ClearTexSubImage = loadProc("glClearTexSubImage"); + api->BindBuffersBase = loadProc("glBindBuffersBase"); + api->BindBuffersRange = loadProc("glBindBuffersRange"); + api->BindTextures = loadProc("glBindTextures"); + api->BindSamplers = loadProc("glBindSamplers"); + api->BindImageTextures = loadProc("glBindImageTextures"); + api->BindVertexBuffers = loadProc("glBindVertexBuffers"); +} + +void mg_gl_load_gles30(mg_gl_api* api, mg_gl_load_proc loadProc) +{ + api->ActiveTexture = loadProc("glActiveTexture"); + api->AttachShader = loadProc("glAttachShader"); + api->BindAttribLocation = loadProc("glBindAttribLocation"); + api->BindBuffer = loadProc("glBindBuffer"); + api->BindFramebuffer = loadProc("glBindFramebuffer"); + api->BindRenderbuffer = loadProc("glBindRenderbuffer"); + api->BindTexture = loadProc("glBindTexture"); + api->BlendColor = loadProc("glBlendColor"); + api->BlendEquation = loadProc("glBlendEquation"); + api->BlendEquationSeparate = loadProc("glBlendEquationSeparate"); + api->BlendFunc = loadProc("glBlendFunc"); + api->BlendFuncSeparate = loadProc("glBlendFuncSeparate"); + api->BufferData = loadProc("glBufferData"); + api->BufferSubData = loadProc("glBufferSubData"); + api->CheckFramebufferStatus = loadProc("glCheckFramebufferStatus"); + api->Clear = loadProc("glClear"); + api->ClearColor = loadProc("glClearColor"); + api->ClearDepthf = loadProc("glClearDepthf"); + api->ClearStencil = loadProc("glClearStencil"); + api->ColorMask = loadProc("glColorMask"); + api->CompileShader = loadProc("glCompileShader"); + api->CompressedTexImage2D = loadProc("glCompressedTexImage2D"); + api->CompressedTexSubImage2D = loadProc("glCompressedTexSubImage2D"); + api->CopyTexImage2D = loadProc("glCopyTexImage2D"); + api->CopyTexSubImage2D = loadProc("glCopyTexSubImage2D"); + api->CreateProgram = loadProc("glCreateProgram"); + api->CreateShader = loadProc("glCreateShader"); + api->CullFace = loadProc("glCullFace"); + api->DeleteBuffers = loadProc("glDeleteBuffers"); + api->DeleteFramebuffers = loadProc("glDeleteFramebuffers"); + api->DeleteProgram = loadProc("glDeleteProgram"); + api->DeleteRenderbuffers = loadProc("glDeleteRenderbuffers"); + api->DeleteShader = loadProc("glDeleteShader"); + api->DeleteTextures = loadProc("glDeleteTextures"); + api->DepthFunc = loadProc("glDepthFunc"); + api->DepthMask = loadProc("glDepthMask"); + api->DepthRangef = loadProc("glDepthRangef"); + api->DetachShader = loadProc("glDetachShader"); + api->Disable = loadProc("glDisable"); + api->DisableVertexAttribArray = loadProc("glDisableVertexAttribArray"); + api->DrawArrays = loadProc("glDrawArrays"); + api->DrawElements = loadProc("glDrawElements"); + api->Enable = loadProc("glEnable"); + api->EnableVertexAttribArray = loadProc("glEnableVertexAttribArray"); + api->Finish = loadProc("glFinish"); + api->Flush = loadProc("glFlush"); + api->FramebufferRenderbuffer = loadProc("glFramebufferRenderbuffer"); + api->FramebufferTexture2D = loadProc("glFramebufferTexture2D"); + api->FrontFace = loadProc("glFrontFace"); + api->GenBuffers = loadProc("glGenBuffers"); + api->GenerateMipmap = loadProc("glGenerateMipmap"); + api->GenFramebuffers = loadProc("glGenFramebuffers"); + api->GenRenderbuffers = loadProc("glGenRenderbuffers"); + api->GenTextures = loadProc("glGenTextures"); + api->GetActiveAttrib = loadProc("glGetActiveAttrib"); + api->GetActiveUniform = loadProc("glGetActiveUniform"); + api->GetAttachedShaders = loadProc("glGetAttachedShaders"); + api->GetAttribLocation = loadProc("glGetAttribLocation"); + api->GetBooleanv = loadProc("glGetBooleanv"); + api->GetBufferParameteriv = loadProc("glGetBufferParameteriv"); + api->GetError = loadProc("glGetError"); + api->GetFloatv = loadProc("glGetFloatv"); + api->GetFramebufferAttachmentParameteriv = loadProc("glGetFramebufferAttachmentParameteriv"); + api->GetIntegerv = loadProc("glGetIntegerv"); + api->GetProgramiv = loadProc("glGetProgramiv"); + api->GetProgramInfoLog = loadProc("glGetProgramInfoLog"); + api->GetRenderbufferParameteriv = loadProc("glGetRenderbufferParameteriv"); + api->GetShaderiv = loadProc("glGetShaderiv"); + api->GetShaderInfoLog = loadProc("glGetShaderInfoLog"); + api->GetShaderPrecisionFormat = loadProc("glGetShaderPrecisionFormat"); + api->GetShaderSource = loadProc("glGetShaderSource"); + api->GetString = loadProc("glGetString"); + api->GetTexParameterfv = loadProc("glGetTexParameterfv"); + api->GetTexParameteriv = loadProc("glGetTexParameteriv"); + api->GetUniformfv = loadProc("glGetUniformfv"); + api->GetUniformiv = loadProc("glGetUniformiv"); + api->GetUniformLocation = loadProc("glGetUniformLocation"); + api->GetVertexAttribfv = loadProc("glGetVertexAttribfv"); + api->GetVertexAttribiv = loadProc("glGetVertexAttribiv"); + api->GetVertexAttribPointerv = loadProc("glGetVertexAttribPointerv"); + api->Hint = loadProc("glHint"); + api->IsBuffer = loadProc("glIsBuffer"); + api->IsEnabled = loadProc("glIsEnabled"); + api->IsFramebuffer = loadProc("glIsFramebuffer"); + api->IsProgram = loadProc("glIsProgram"); + api->IsRenderbuffer = loadProc("glIsRenderbuffer"); + api->IsShader = loadProc("glIsShader"); + api->IsTexture = loadProc("glIsTexture"); + api->LineWidth = loadProc("glLineWidth"); + api->LinkProgram = loadProc("glLinkProgram"); + api->PixelStorei = loadProc("glPixelStorei"); + api->PolygonOffset = loadProc("glPolygonOffset"); + api->ReadPixels = loadProc("glReadPixels"); + api->ReleaseShaderCompiler = loadProc("glReleaseShaderCompiler"); + api->RenderbufferStorage = loadProc("glRenderbufferStorage"); + api->SampleCoverage = loadProc("glSampleCoverage"); + api->Scissor = loadProc("glScissor"); + api->ShaderBinary = loadProc("glShaderBinary"); + api->ShaderSource = loadProc("glShaderSource"); + api->StencilFunc = loadProc("glStencilFunc"); + api->StencilFuncSeparate = loadProc("glStencilFuncSeparate"); + api->StencilMask = loadProc("glStencilMask"); + api->StencilMaskSeparate = loadProc("glStencilMaskSeparate"); + api->StencilOp = loadProc("glStencilOp"); + api->StencilOpSeparate = loadProc("glStencilOpSeparate"); + api->TexImage2D = loadProc("glTexImage2D"); + api->TexParameterf = loadProc("glTexParameterf"); + api->TexParameterfv = loadProc("glTexParameterfv"); + api->TexParameteri = loadProc("glTexParameteri"); + api->TexParameteriv = loadProc("glTexParameteriv"); + api->TexSubImage2D = loadProc("glTexSubImage2D"); + api->Uniform1f = loadProc("glUniform1f"); + api->Uniform1fv = loadProc("glUniform1fv"); + api->Uniform1i = loadProc("glUniform1i"); + api->Uniform1iv = loadProc("glUniform1iv"); + api->Uniform2f = loadProc("glUniform2f"); + api->Uniform2fv = loadProc("glUniform2fv"); + api->Uniform2i = loadProc("glUniform2i"); + api->Uniform2iv = loadProc("glUniform2iv"); + api->Uniform3f = loadProc("glUniform3f"); + api->Uniform3fv = loadProc("glUniform3fv"); + api->Uniform3i = loadProc("glUniform3i"); + api->Uniform3iv = loadProc("glUniform3iv"); + api->Uniform4f = loadProc("glUniform4f"); + api->Uniform4fv = loadProc("glUniform4fv"); + api->Uniform4i = loadProc("glUniform4i"); + api->Uniform4iv = loadProc("glUniform4iv"); + api->UniformMatrix2fv = loadProc("glUniformMatrix2fv"); + api->UniformMatrix3fv = loadProc("glUniformMatrix3fv"); + api->UniformMatrix4fv = loadProc("glUniformMatrix4fv"); + api->UseProgram = loadProc("glUseProgram"); + api->ValidateProgram = loadProc("glValidateProgram"); + api->VertexAttrib1f = loadProc("glVertexAttrib1f"); + api->VertexAttrib1fv = loadProc("glVertexAttrib1fv"); + api->VertexAttrib2f = loadProc("glVertexAttrib2f"); + api->VertexAttrib2fv = loadProc("glVertexAttrib2fv"); + api->VertexAttrib3f = loadProc("glVertexAttrib3f"); + api->VertexAttrib3fv = loadProc("glVertexAttrib3fv"); + api->VertexAttrib4f = loadProc("glVertexAttrib4f"); + api->VertexAttrib4fv = loadProc("glVertexAttrib4fv"); + api->VertexAttribPointer = loadProc("glVertexAttribPointer"); + api->Viewport = loadProc("glViewport"); + api->ReadBuffer = loadProc("glReadBuffer"); + api->DrawRangeElements = loadProc("glDrawRangeElements"); + api->TexImage3D = loadProc("glTexImage3D"); + api->TexSubImage3D = loadProc("glTexSubImage3D"); + api->CopyTexSubImage3D = loadProc("glCopyTexSubImage3D"); + api->CompressedTexImage3D = loadProc("glCompressedTexImage3D"); + api->CompressedTexSubImage3D = loadProc("glCompressedTexSubImage3D"); + api->GenQueries = loadProc("glGenQueries"); + api->DeleteQueries = loadProc("glDeleteQueries"); + api->IsQuery = loadProc("glIsQuery"); + api->BeginQuery = loadProc("glBeginQuery"); + api->EndQuery = loadProc("glEndQuery"); + api->GetQueryiv = loadProc("glGetQueryiv"); + api->GetQueryObjectuiv = loadProc("glGetQueryObjectuiv"); + api->UnmapBuffer = loadProc("glUnmapBuffer"); + api->GetBufferPointerv = loadProc("glGetBufferPointerv"); + api->DrawBuffers = loadProc("glDrawBuffers"); + api->UniformMatrix2x3fv = loadProc("glUniformMatrix2x3fv"); + api->UniformMatrix3x2fv = loadProc("glUniformMatrix3x2fv"); + api->UniformMatrix2x4fv = loadProc("glUniformMatrix2x4fv"); + api->UniformMatrix4x2fv = loadProc("glUniformMatrix4x2fv"); + api->UniformMatrix3x4fv = loadProc("glUniformMatrix3x4fv"); + api->UniformMatrix4x3fv = loadProc("glUniformMatrix4x3fv"); + api->BlitFramebuffer = loadProc("glBlitFramebuffer"); + api->RenderbufferStorageMultisample = loadProc("glRenderbufferStorageMultisample"); + api->FramebufferTextureLayer = loadProc("glFramebufferTextureLayer"); + api->MapBufferRange = loadProc("glMapBufferRange"); + api->FlushMappedBufferRange = loadProc("glFlushMappedBufferRange"); + api->BindVertexArray = loadProc("glBindVertexArray"); + api->DeleteVertexArrays = loadProc("glDeleteVertexArrays"); + api->GenVertexArrays = loadProc("glGenVertexArrays"); + api->IsVertexArray = loadProc("glIsVertexArray"); + api->GetIntegeri_v = loadProc("glGetIntegeri_v"); + api->BeginTransformFeedback = loadProc("glBeginTransformFeedback"); + api->EndTransformFeedback = loadProc("glEndTransformFeedback"); + api->BindBufferRange = loadProc("glBindBufferRange"); + api->BindBufferBase = loadProc("glBindBufferBase"); + api->TransformFeedbackVaryings = loadProc("glTransformFeedbackVaryings"); + api->GetTransformFeedbackVarying = loadProc("glGetTransformFeedbackVarying"); + api->VertexAttribIPointer = loadProc("glVertexAttribIPointer"); + api->GetVertexAttribIiv = loadProc("glGetVertexAttribIiv"); + api->GetVertexAttribIuiv = loadProc("glGetVertexAttribIuiv"); + api->VertexAttribI4i = loadProc("glVertexAttribI4i"); + api->VertexAttribI4ui = loadProc("glVertexAttribI4ui"); + api->VertexAttribI4iv = loadProc("glVertexAttribI4iv"); + api->VertexAttribI4uiv = loadProc("glVertexAttribI4uiv"); + api->GetUniformuiv = loadProc("glGetUniformuiv"); + api->GetFragDataLocation = loadProc("glGetFragDataLocation"); + api->Uniform1ui = loadProc("glUniform1ui"); + api->Uniform2ui = loadProc("glUniform2ui"); + api->Uniform3ui = loadProc("glUniform3ui"); + api->Uniform4ui = loadProc("glUniform4ui"); + api->Uniform1uiv = loadProc("glUniform1uiv"); + api->Uniform2uiv = loadProc("glUniform2uiv"); + api->Uniform3uiv = loadProc("glUniform3uiv"); + api->Uniform4uiv = loadProc("glUniform4uiv"); + api->ClearBufferiv = loadProc("glClearBufferiv"); + api->ClearBufferuiv = loadProc("glClearBufferuiv"); + api->ClearBufferfv = loadProc("glClearBufferfv"); + api->ClearBufferfi = loadProc("glClearBufferfi"); + api->GetStringi = loadProc("glGetStringi"); + api->CopyBufferSubData = loadProc("glCopyBufferSubData"); + api->GetUniformIndices = loadProc("glGetUniformIndices"); + api->GetActiveUniformsiv = loadProc("glGetActiveUniformsiv"); + api->GetUniformBlockIndex = loadProc("glGetUniformBlockIndex"); + api->GetActiveUniformBlockiv = loadProc("glGetActiveUniformBlockiv"); + api->GetActiveUniformBlockName = loadProc("glGetActiveUniformBlockName"); + api->UniformBlockBinding = loadProc("glUniformBlockBinding"); + api->DrawArraysInstanced = loadProc("glDrawArraysInstanced"); + api->DrawElementsInstanced = loadProc("glDrawElementsInstanced"); + api->FenceSync = loadProc("glFenceSync"); + api->IsSync = loadProc("glIsSync"); + api->DeleteSync = loadProc("glDeleteSync"); + api->ClientWaitSync = loadProc("glClientWaitSync"); + api->WaitSync = loadProc("glWaitSync"); + api->GetInteger64v = loadProc("glGetInteger64v"); + api->GetSynciv = loadProc("glGetSynciv"); + api->GetInteger64i_v = loadProc("glGetInteger64i_v"); + api->GetBufferParameteri64v = loadProc("glGetBufferParameteri64v"); + api->GenSamplers = loadProc("glGenSamplers"); + api->DeleteSamplers = loadProc("glDeleteSamplers"); + api->IsSampler = loadProc("glIsSampler"); + api->BindSampler = loadProc("glBindSampler"); + api->SamplerParameteri = loadProc("glSamplerParameteri"); + api->SamplerParameteriv = loadProc("glSamplerParameteriv"); + api->SamplerParameterf = loadProc("glSamplerParameterf"); + api->SamplerParameterfv = loadProc("glSamplerParameterfv"); + api->GetSamplerParameteriv = loadProc("glGetSamplerParameteriv"); + api->GetSamplerParameterfv = loadProc("glGetSamplerParameterfv"); + api->VertexAttribDivisor = loadProc("glVertexAttribDivisor"); + api->BindTransformFeedback = loadProc("glBindTransformFeedback"); + api->DeleteTransformFeedbacks = loadProc("glDeleteTransformFeedbacks"); + api->GenTransformFeedbacks = loadProc("glGenTransformFeedbacks"); + api->IsTransformFeedback = loadProc("glIsTransformFeedback"); + api->PauseTransformFeedback = loadProc("glPauseTransformFeedback"); + api->ResumeTransformFeedback = loadProc("glResumeTransformFeedback"); + api->GetProgramBinary = loadProc("glGetProgramBinary"); + api->ProgramBinary = loadProc("glProgramBinary"); + api->ProgramParameteri = loadProc("glProgramParameteri"); + api->InvalidateFramebuffer = loadProc("glInvalidateFramebuffer"); + api->InvalidateSubFramebuffer = loadProc("glInvalidateSubFramebuffer"); + api->TexStorage2D = loadProc("glTexStorage2D"); + api->TexStorage3D = loadProc("glTexStorage3D"); + api->GetInternalformativ = loadProc("glGetInternalformativ"); + api->DispatchCompute = loadProc("glDispatchCompute"); + api->DispatchComputeIndirect = loadProc("glDispatchComputeIndirect"); + api->DrawArraysIndirect = loadProc("glDrawArraysIndirect"); + api->DrawElementsIndirect = loadProc("glDrawElementsIndirect"); + api->FramebufferParameteri = loadProc("glFramebufferParameteri"); + api->GetFramebufferParameteriv = loadProc("glGetFramebufferParameteriv"); + api->GetProgramInterfaceiv = loadProc("glGetProgramInterfaceiv"); + api->GetProgramResourceIndex = loadProc("glGetProgramResourceIndex"); + api->GetProgramResourceName = loadProc("glGetProgramResourceName"); + api->GetProgramResourceiv = loadProc("glGetProgramResourceiv"); + api->GetProgramResourceLocation = loadProc("glGetProgramResourceLocation"); + api->UseProgramStages = loadProc("glUseProgramStages"); + api->ActiveShaderProgram = loadProc("glActiveShaderProgram"); + api->CreateShaderProgramv = loadProc("glCreateShaderProgramv"); + api->BindProgramPipeline = loadProc("glBindProgramPipeline"); + api->DeleteProgramPipelines = loadProc("glDeleteProgramPipelines"); + api->GenProgramPipelines = loadProc("glGenProgramPipelines"); + api->IsProgramPipeline = loadProc("glIsProgramPipeline"); + api->GetProgramPipelineiv = loadProc("glGetProgramPipelineiv"); + api->ProgramUniform1i = loadProc("glProgramUniform1i"); + api->ProgramUniform2i = loadProc("glProgramUniform2i"); + api->ProgramUniform3i = loadProc("glProgramUniform3i"); + api->ProgramUniform4i = loadProc("glProgramUniform4i"); + api->ProgramUniform1ui = loadProc("glProgramUniform1ui"); + api->ProgramUniform2ui = loadProc("glProgramUniform2ui"); + api->ProgramUniform3ui = loadProc("glProgramUniform3ui"); + api->ProgramUniform4ui = loadProc("glProgramUniform4ui"); + api->ProgramUniform1f = loadProc("glProgramUniform1f"); + api->ProgramUniform2f = loadProc("glProgramUniform2f"); + api->ProgramUniform3f = loadProc("glProgramUniform3f"); + api->ProgramUniform4f = loadProc("glProgramUniform4f"); + api->ProgramUniform1iv = loadProc("glProgramUniform1iv"); + api->ProgramUniform2iv = loadProc("glProgramUniform2iv"); + api->ProgramUniform3iv = loadProc("glProgramUniform3iv"); + api->ProgramUniform4iv = loadProc("glProgramUniform4iv"); + api->ProgramUniform1uiv = loadProc("glProgramUniform1uiv"); + api->ProgramUniform2uiv = loadProc("glProgramUniform2uiv"); + api->ProgramUniform3uiv = loadProc("glProgramUniform3uiv"); + api->ProgramUniform4uiv = loadProc("glProgramUniform4uiv"); + api->ProgramUniform1fv = loadProc("glProgramUniform1fv"); + api->ProgramUniform2fv = loadProc("glProgramUniform2fv"); + api->ProgramUniform3fv = loadProc("glProgramUniform3fv"); + api->ProgramUniform4fv = loadProc("glProgramUniform4fv"); + api->ProgramUniformMatrix2fv = loadProc("glProgramUniformMatrix2fv"); + api->ProgramUniformMatrix3fv = loadProc("glProgramUniformMatrix3fv"); + api->ProgramUniformMatrix4fv = loadProc("glProgramUniformMatrix4fv"); + api->ProgramUniformMatrix2x3fv = loadProc("glProgramUniformMatrix2x3fv"); + api->ProgramUniformMatrix3x2fv = loadProc("glProgramUniformMatrix3x2fv"); + api->ProgramUniformMatrix2x4fv = loadProc("glProgramUniformMatrix2x4fv"); + api->ProgramUniformMatrix4x2fv = loadProc("glProgramUniformMatrix4x2fv"); + api->ProgramUniformMatrix3x4fv = loadProc("glProgramUniformMatrix3x4fv"); + api->ProgramUniformMatrix4x3fv = loadProc("glProgramUniformMatrix4x3fv"); + api->ValidateProgramPipeline = loadProc("glValidateProgramPipeline"); + api->GetProgramPipelineInfoLog = loadProc("glGetProgramPipelineInfoLog"); + api->BindImageTexture = loadProc("glBindImageTexture"); + api->GetBooleani_v = loadProc("glGetBooleani_v"); + api->MemoryBarrier = loadProc("glMemoryBarrier"); + api->MemoryBarrierByRegion = loadProc("glMemoryBarrierByRegion"); + api->TexStorage2DMultisample = loadProc("glTexStorage2DMultisample"); + api->GetMultisamplefv = loadProc("glGetMultisamplefv"); + api->SampleMaski = loadProc("glSampleMaski"); + api->GetTexLevelParameteriv = loadProc("glGetTexLevelParameteriv"); + api->GetTexLevelParameterfv = loadProc("glGetTexLevelParameterfv"); + api->BindVertexBuffer = loadProc("glBindVertexBuffer"); + api->VertexAttribFormat = loadProc("glVertexAttribFormat"); + api->VertexAttribIFormat = loadProc("glVertexAttribIFormat"); + api->VertexAttribBinding = loadProc("glVertexAttribBinding"); + api->VertexBindingDivisor = loadProc("glVertexBindingDivisor"); +} + +void mg_gl_load_gles31(mg_gl_api* api, mg_gl_load_proc loadProc) +{ + api->ActiveTexture = loadProc("glActiveTexture"); + api->AttachShader = loadProc("glAttachShader"); + api->BindAttribLocation = loadProc("glBindAttribLocation"); + api->BindBuffer = loadProc("glBindBuffer"); + api->BindFramebuffer = loadProc("glBindFramebuffer"); + api->BindRenderbuffer = loadProc("glBindRenderbuffer"); + api->BindTexture = loadProc("glBindTexture"); + api->BlendColor = loadProc("glBlendColor"); + api->BlendEquation = loadProc("glBlendEquation"); + api->BlendEquationSeparate = loadProc("glBlendEquationSeparate"); + api->BlendFunc = loadProc("glBlendFunc"); + api->BlendFuncSeparate = loadProc("glBlendFuncSeparate"); + api->BufferData = loadProc("glBufferData"); + api->BufferSubData = loadProc("glBufferSubData"); + api->CheckFramebufferStatus = loadProc("glCheckFramebufferStatus"); + api->Clear = loadProc("glClear"); + api->ClearColor = loadProc("glClearColor"); + api->ClearDepthf = loadProc("glClearDepthf"); + api->ClearStencil = loadProc("glClearStencil"); + api->ColorMask = loadProc("glColorMask"); + api->CompileShader = loadProc("glCompileShader"); + api->CompressedTexImage2D = loadProc("glCompressedTexImage2D"); + api->CompressedTexSubImage2D = loadProc("glCompressedTexSubImage2D"); + api->CopyTexImage2D = loadProc("glCopyTexImage2D"); + api->CopyTexSubImage2D = loadProc("glCopyTexSubImage2D"); + api->CreateProgram = loadProc("glCreateProgram"); + api->CreateShader = loadProc("glCreateShader"); + api->CullFace = loadProc("glCullFace"); + api->DeleteBuffers = loadProc("glDeleteBuffers"); + api->DeleteFramebuffers = loadProc("glDeleteFramebuffers"); + api->DeleteProgram = loadProc("glDeleteProgram"); + api->DeleteRenderbuffers = loadProc("glDeleteRenderbuffers"); + api->DeleteShader = loadProc("glDeleteShader"); + api->DeleteTextures = loadProc("glDeleteTextures"); + api->DepthFunc = loadProc("glDepthFunc"); + api->DepthMask = loadProc("glDepthMask"); + api->DepthRangef = loadProc("glDepthRangef"); + api->DetachShader = loadProc("glDetachShader"); + api->Disable = loadProc("glDisable"); + api->DisableVertexAttribArray = loadProc("glDisableVertexAttribArray"); + api->DrawArrays = loadProc("glDrawArrays"); + api->DrawElements = loadProc("glDrawElements"); + api->Enable = loadProc("glEnable"); + api->EnableVertexAttribArray = loadProc("glEnableVertexAttribArray"); + api->Finish = loadProc("glFinish"); + api->Flush = loadProc("glFlush"); + api->FramebufferRenderbuffer = loadProc("glFramebufferRenderbuffer"); + api->FramebufferTexture2D = loadProc("glFramebufferTexture2D"); + api->FrontFace = loadProc("glFrontFace"); + api->GenBuffers = loadProc("glGenBuffers"); + api->GenerateMipmap = loadProc("glGenerateMipmap"); + api->GenFramebuffers = loadProc("glGenFramebuffers"); + api->GenRenderbuffers = loadProc("glGenRenderbuffers"); + api->GenTextures = loadProc("glGenTextures"); + api->GetActiveAttrib = loadProc("glGetActiveAttrib"); + api->GetActiveUniform = loadProc("glGetActiveUniform"); + api->GetAttachedShaders = loadProc("glGetAttachedShaders"); + api->GetAttribLocation = loadProc("glGetAttribLocation"); + api->GetBooleanv = loadProc("glGetBooleanv"); + api->GetBufferParameteriv = loadProc("glGetBufferParameteriv"); + api->GetError = loadProc("glGetError"); + api->GetFloatv = loadProc("glGetFloatv"); + api->GetFramebufferAttachmentParameteriv = loadProc("glGetFramebufferAttachmentParameteriv"); + api->GetIntegerv = loadProc("glGetIntegerv"); + api->GetProgramiv = loadProc("glGetProgramiv"); + api->GetProgramInfoLog = loadProc("glGetProgramInfoLog"); + api->GetRenderbufferParameteriv = loadProc("glGetRenderbufferParameteriv"); + api->GetShaderiv = loadProc("glGetShaderiv"); + api->GetShaderInfoLog = loadProc("glGetShaderInfoLog"); + api->GetShaderPrecisionFormat = loadProc("glGetShaderPrecisionFormat"); + api->GetShaderSource = loadProc("glGetShaderSource"); + api->GetString = loadProc("glGetString"); + api->GetTexParameterfv = loadProc("glGetTexParameterfv"); + api->GetTexParameteriv = loadProc("glGetTexParameteriv"); + api->GetUniformfv = loadProc("glGetUniformfv"); + api->GetUniformiv = loadProc("glGetUniformiv"); + api->GetUniformLocation = loadProc("glGetUniformLocation"); + api->GetVertexAttribfv = loadProc("glGetVertexAttribfv"); + api->GetVertexAttribiv = loadProc("glGetVertexAttribiv"); + api->GetVertexAttribPointerv = loadProc("glGetVertexAttribPointerv"); + api->Hint = loadProc("glHint"); + api->IsBuffer = loadProc("glIsBuffer"); + api->IsEnabled = loadProc("glIsEnabled"); + api->IsFramebuffer = loadProc("glIsFramebuffer"); + api->IsProgram = loadProc("glIsProgram"); + api->IsRenderbuffer = loadProc("glIsRenderbuffer"); + api->IsShader = loadProc("glIsShader"); + api->IsTexture = loadProc("glIsTexture"); + api->LineWidth = loadProc("glLineWidth"); + api->LinkProgram = loadProc("glLinkProgram"); + api->PixelStorei = loadProc("glPixelStorei"); + api->PolygonOffset = loadProc("glPolygonOffset"); + api->ReadPixels = loadProc("glReadPixels"); + api->ReleaseShaderCompiler = loadProc("glReleaseShaderCompiler"); + api->RenderbufferStorage = loadProc("glRenderbufferStorage"); + api->SampleCoverage = loadProc("glSampleCoverage"); + api->Scissor = loadProc("glScissor"); + api->ShaderBinary = loadProc("glShaderBinary"); + api->ShaderSource = loadProc("glShaderSource"); + api->StencilFunc = loadProc("glStencilFunc"); + api->StencilFuncSeparate = loadProc("glStencilFuncSeparate"); + api->StencilMask = loadProc("glStencilMask"); + api->StencilMaskSeparate = loadProc("glStencilMaskSeparate"); + api->StencilOp = loadProc("glStencilOp"); + api->StencilOpSeparate = loadProc("glStencilOpSeparate"); + api->TexImage2D = loadProc("glTexImage2D"); + api->TexParameterf = loadProc("glTexParameterf"); + api->TexParameterfv = loadProc("glTexParameterfv"); + api->TexParameteri = loadProc("glTexParameteri"); + api->TexParameteriv = loadProc("glTexParameteriv"); + api->TexSubImage2D = loadProc("glTexSubImage2D"); + api->Uniform1f = loadProc("glUniform1f"); + api->Uniform1fv = loadProc("glUniform1fv"); + api->Uniform1i = loadProc("glUniform1i"); + api->Uniform1iv = loadProc("glUniform1iv"); + api->Uniform2f = loadProc("glUniform2f"); + api->Uniform2fv = loadProc("glUniform2fv"); + api->Uniform2i = loadProc("glUniform2i"); + api->Uniform2iv = loadProc("glUniform2iv"); + api->Uniform3f = loadProc("glUniform3f"); + api->Uniform3fv = loadProc("glUniform3fv"); + api->Uniform3i = loadProc("glUniform3i"); + api->Uniform3iv = loadProc("glUniform3iv"); + api->Uniform4f = loadProc("glUniform4f"); + api->Uniform4fv = loadProc("glUniform4fv"); + api->Uniform4i = loadProc("glUniform4i"); + api->Uniform4iv = loadProc("glUniform4iv"); + api->UniformMatrix2fv = loadProc("glUniformMatrix2fv"); + api->UniformMatrix3fv = loadProc("glUniformMatrix3fv"); + api->UniformMatrix4fv = loadProc("glUniformMatrix4fv"); + api->UseProgram = loadProc("glUseProgram"); + api->ValidateProgram = loadProc("glValidateProgram"); + api->VertexAttrib1f = loadProc("glVertexAttrib1f"); + api->VertexAttrib1fv = loadProc("glVertexAttrib1fv"); + api->VertexAttrib2f = loadProc("glVertexAttrib2f"); + api->VertexAttrib2fv = loadProc("glVertexAttrib2fv"); + api->VertexAttrib3f = loadProc("glVertexAttrib3f"); + api->VertexAttrib3fv = loadProc("glVertexAttrib3fv"); + api->VertexAttrib4f = loadProc("glVertexAttrib4f"); + api->VertexAttrib4fv = loadProc("glVertexAttrib4fv"); + api->VertexAttribPointer = loadProc("glVertexAttribPointer"); + api->Viewport = loadProc("glViewport"); + api->ReadBuffer = loadProc("glReadBuffer"); + api->DrawRangeElements = loadProc("glDrawRangeElements"); + api->TexImage3D = loadProc("glTexImage3D"); + api->TexSubImage3D = loadProc("glTexSubImage3D"); + api->CopyTexSubImage3D = loadProc("glCopyTexSubImage3D"); + api->CompressedTexImage3D = loadProc("glCompressedTexImage3D"); + api->CompressedTexSubImage3D = loadProc("glCompressedTexSubImage3D"); + api->GenQueries = loadProc("glGenQueries"); + api->DeleteQueries = loadProc("glDeleteQueries"); + api->IsQuery = loadProc("glIsQuery"); + api->BeginQuery = loadProc("glBeginQuery"); + api->EndQuery = loadProc("glEndQuery"); + api->GetQueryiv = loadProc("glGetQueryiv"); + api->GetQueryObjectuiv = loadProc("glGetQueryObjectuiv"); + api->UnmapBuffer = loadProc("glUnmapBuffer"); + api->GetBufferPointerv = loadProc("glGetBufferPointerv"); + api->DrawBuffers = loadProc("glDrawBuffers"); + api->UniformMatrix2x3fv = loadProc("glUniformMatrix2x3fv"); + api->UniformMatrix3x2fv = loadProc("glUniformMatrix3x2fv"); + api->UniformMatrix2x4fv = loadProc("glUniformMatrix2x4fv"); + api->UniformMatrix4x2fv = loadProc("glUniformMatrix4x2fv"); + api->UniformMatrix3x4fv = loadProc("glUniformMatrix3x4fv"); + api->UniformMatrix4x3fv = loadProc("glUniformMatrix4x3fv"); + api->BlitFramebuffer = loadProc("glBlitFramebuffer"); + api->RenderbufferStorageMultisample = loadProc("glRenderbufferStorageMultisample"); + api->FramebufferTextureLayer = loadProc("glFramebufferTextureLayer"); + api->MapBufferRange = loadProc("glMapBufferRange"); + api->FlushMappedBufferRange = loadProc("glFlushMappedBufferRange"); + api->BindVertexArray = loadProc("glBindVertexArray"); + api->DeleteVertexArrays = loadProc("glDeleteVertexArrays"); + api->GenVertexArrays = loadProc("glGenVertexArrays"); + api->IsVertexArray = loadProc("glIsVertexArray"); + api->GetIntegeri_v = loadProc("glGetIntegeri_v"); + api->BeginTransformFeedback = loadProc("glBeginTransformFeedback"); + api->EndTransformFeedback = loadProc("glEndTransformFeedback"); + api->BindBufferRange = loadProc("glBindBufferRange"); + api->BindBufferBase = loadProc("glBindBufferBase"); + api->TransformFeedbackVaryings = loadProc("glTransformFeedbackVaryings"); + api->GetTransformFeedbackVarying = loadProc("glGetTransformFeedbackVarying"); + api->VertexAttribIPointer = loadProc("glVertexAttribIPointer"); + api->GetVertexAttribIiv = loadProc("glGetVertexAttribIiv"); + api->GetVertexAttribIuiv = loadProc("glGetVertexAttribIuiv"); + api->VertexAttribI4i = loadProc("glVertexAttribI4i"); + api->VertexAttribI4ui = loadProc("glVertexAttribI4ui"); + api->VertexAttribI4iv = loadProc("glVertexAttribI4iv"); + api->VertexAttribI4uiv = loadProc("glVertexAttribI4uiv"); + api->GetUniformuiv = loadProc("glGetUniformuiv"); + api->GetFragDataLocation = loadProc("glGetFragDataLocation"); + api->Uniform1ui = loadProc("glUniform1ui"); + api->Uniform2ui = loadProc("glUniform2ui"); + api->Uniform3ui = loadProc("glUniform3ui"); + api->Uniform4ui = loadProc("glUniform4ui"); + api->Uniform1uiv = loadProc("glUniform1uiv"); + api->Uniform2uiv = loadProc("glUniform2uiv"); + api->Uniform3uiv = loadProc("glUniform3uiv"); + api->Uniform4uiv = loadProc("glUniform4uiv"); + api->ClearBufferiv = loadProc("glClearBufferiv"); + api->ClearBufferuiv = loadProc("glClearBufferuiv"); + api->ClearBufferfv = loadProc("glClearBufferfv"); + api->ClearBufferfi = loadProc("glClearBufferfi"); + api->GetStringi = loadProc("glGetStringi"); + api->CopyBufferSubData = loadProc("glCopyBufferSubData"); + api->GetUniformIndices = loadProc("glGetUniformIndices"); + api->GetActiveUniformsiv = loadProc("glGetActiveUniformsiv"); + api->GetUniformBlockIndex = loadProc("glGetUniformBlockIndex"); + api->GetActiveUniformBlockiv = loadProc("glGetActiveUniformBlockiv"); + api->GetActiveUniformBlockName = loadProc("glGetActiveUniformBlockName"); + api->UniformBlockBinding = loadProc("glUniformBlockBinding"); + api->DrawArraysInstanced = loadProc("glDrawArraysInstanced"); + api->DrawElementsInstanced = loadProc("glDrawElementsInstanced"); + api->FenceSync = loadProc("glFenceSync"); + api->IsSync = loadProc("glIsSync"); + api->DeleteSync = loadProc("glDeleteSync"); + api->ClientWaitSync = loadProc("glClientWaitSync"); + api->WaitSync = loadProc("glWaitSync"); + api->GetInteger64v = loadProc("glGetInteger64v"); + api->GetSynciv = loadProc("glGetSynciv"); + api->GetInteger64i_v = loadProc("glGetInteger64i_v"); + api->GetBufferParameteri64v = loadProc("glGetBufferParameteri64v"); + api->GenSamplers = loadProc("glGenSamplers"); + api->DeleteSamplers = loadProc("glDeleteSamplers"); + api->IsSampler = loadProc("glIsSampler"); + api->BindSampler = loadProc("glBindSampler"); + api->SamplerParameteri = loadProc("glSamplerParameteri"); + api->SamplerParameteriv = loadProc("glSamplerParameteriv"); + api->SamplerParameterf = loadProc("glSamplerParameterf"); + api->SamplerParameterfv = loadProc("glSamplerParameterfv"); + api->GetSamplerParameteriv = loadProc("glGetSamplerParameteriv"); + api->GetSamplerParameterfv = loadProc("glGetSamplerParameterfv"); + api->VertexAttribDivisor = loadProc("glVertexAttribDivisor"); + api->BindTransformFeedback = loadProc("glBindTransformFeedback"); + api->DeleteTransformFeedbacks = loadProc("glDeleteTransformFeedbacks"); + api->GenTransformFeedbacks = loadProc("glGenTransformFeedbacks"); + api->IsTransformFeedback = loadProc("glIsTransformFeedback"); + api->PauseTransformFeedback = loadProc("glPauseTransformFeedback"); + api->ResumeTransformFeedback = loadProc("glResumeTransformFeedback"); + api->GetProgramBinary = loadProc("glGetProgramBinary"); + api->ProgramBinary = loadProc("glProgramBinary"); + api->ProgramParameteri = loadProc("glProgramParameteri"); + api->InvalidateFramebuffer = loadProc("glInvalidateFramebuffer"); + api->InvalidateSubFramebuffer = loadProc("glInvalidateSubFramebuffer"); + api->TexStorage2D = loadProc("glTexStorage2D"); + api->TexStorage3D = loadProc("glTexStorage3D"); + api->GetInternalformativ = loadProc("glGetInternalformativ"); + api->DispatchCompute = loadProc("glDispatchCompute"); + api->DispatchComputeIndirect = loadProc("glDispatchComputeIndirect"); + api->DrawArraysIndirect = loadProc("glDrawArraysIndirect"); + api->DrawElementsIndirect = loadProc("glDrawElementsIndirect"); + api->FramebufferParameteri = loadProc("glFramebufferParameteri"); + api->GetFramebufferParameteriv = loadProc("glGetFramebufferParameteriv"); + api->GetProgramInterfaceiv = loadProc("glGetProgramInterfaceiv"); + api->GetProgramResourceIndex = loadProc("glGetProgramResourceIndex"); + api->GetProgramResourceName = loadProc("glGetProgramResourceName"); + api->GetProgramResourceiv = loadProc("glGetProgramResourceiv"); + api->GetProgramResourceLocation = loadProc("glGetProgramResourceLocation"); + api->UseProgramStages = loadProc("glUseProgramStages"); + api->ActiveShaderProgram = loadProc("glActiveShaderProgram"); + api->CreateShaderProgramv = loadProc("glCreateShaderProgramv"); + api->BindProgramPipeline = loadProc("glBindProgramPipeline"); + api->DeleteProgramPipelines = loadProc("glDeleteProgramPipelines"); + api->GenProgramPipelines = loadProc("glGenProgramPipelines"); + api->IsProgramPipeline = loadProc("glIsProgramPipeline"); + api->GetProgramPipelineiv = loadProc("glGetProgramPipelineiv"); + api->ProgramUniform1i = loadProc("glProgramUniform1i"); + api->ProgramUniform2i = loadProc("glProgramUniform2i"); + api->ProgramUniform3i = loadProc("glProgramUniform3i"); + api->ProgramUniform4i = loadProc("glProgramUniform4i"); + api->ProgramUniform1ui = loadProc("glProgramUniform1ui"); + api->ProgramUniform2ui = loadProc("glProgramUniform2ui"); + api->ProgramUniform3ui = loadProc("glProgramUniform3ui"); + api->ProgramUniform4ui = loadProc("glProgramUniform4ui"); + api->ProgramUniform1f = loadProc("glProgramUniform1f"); + api->ProgramUniform2f = loadProc("glProgramUniform2f"); + api->ProgramUniform3f = loadProc("glProgramUniform3f"); + api->ProgramUniform4f = loadProc("glProgramUniform4f"); + api->ProgramUniform1iv = loadProc("glProgramUniform1iv"); + api->ProgramUniform2iv = loadProc("glProgramUniform2iv"); + api->ProgramUniform3iv = loadProc("glProgramUniform3iv"); + api->ProgramUniform4iv = loadProc("glProgramUniform4iv"); + api->ProgramUniform1uiv = loadProc("glProgramUniform1uiv"); + api->ProgramUniform2uiv = loadProc("glProgramUniform2uiv"); + api->ProgramUniform3uiv = loadProc("glProgramUniform3uiv"); + api->ProgramUniform4uiv = loadProc("glProgramUniform4uiv"); + api->ProgramUniform1fv = loadProc("glProgramUniform1fv"); + api->ProgramUniform2fv = loadProc("glProgramUniform2fv"); + api->ProgramUniform3fv = loadProc("glProgramUniform3fv"); + api->ProgramUniform4fv = loadProc("glProgramUniform4fv"); + api->ProgramUniformMatrix2fv = loadProc("glProgramUniformMatrix2fv"); + api->ProgramUniformMatrix3fv = loadProc("glProgramUniformMatrix3fv"); + api->ProgramUniformMatrix4fv = loadProc("glProgramUniformMatrix4fv"); + api->ProgramUniformMatrix2x3fv = loadProc("glProgramUniformMatrix2x3fv"); + api->ProgramUniformMatrix3x2fv = loadProc("glProgramUniformMatrix3x2fv"); + api->ProgramUniformMatrix2x4fv = loadProc("glProgramUniformMatrix2x4fv"); + api->ProgramUniformMatrix4x2fv = loadProc("glProgramUniformMatrix4x2fv"); + api->ProgramUniformMatrix3x4fv = loadProc("glProgramUniformMatrix3x4fv"); + api->ProgramUniformMatrix4x3fv = loadProc("glProgramUniformMatrix4x3fv"); + api->ValidateProgramPipeline = loadProc("glValidateProgramPipeline"); + api->GetProgramPipelineInfoLog = loadProc("glGetProgramPipelineInfoLog"); + api->BindImageTexture = loadProc("glBindImageTexture"); + api->GetBooleani_v = loadProc("glGetBooleani_v"); + api->MemoryBarrier = loadProc("glMemoryBarrier"); + api->MemoryBarrierByRegion = loadProc("glMemoryBarrierByRegion"); + api->TexStorage2DMultisample = loadProc("glTexStorage2DMultisample"); + api->GetMultisamplefv = loadProc("glGetMultisamplefv"); + api->SampleMaski = loadProc("glSampleMaski"); + api->GetTexLevelParameteriv = loadProc("glGetTexLevelParameteriv"); + api->GetTexLevelParameterfv = loadProc("glGetTexLevelParameterfv"); + api->BindVertexBuffer = loadProc("glBindVertexBuffer"); + api->VertexAttribFormat = loadProc("glVertexAttribFormat"); + api->VertexAttribIFormat = loadProc("glVertexAttribIFormat"); + api->VertexAttribBinding = loadProc("glVertexAttribBinding"); + api->VertexBindingDivisor = loadProc("glVertexBindingDivisor"); + api->BlendBarrier = loadProc("glBlendBarrier"); + api->CopyImageSubData = loadProc("glCopyImageSubData"); + api->DebugMessageControl = loadProc("glDebugMessageControl"); + api->DebugMessageInsert = loadProc("glDebugMessageInsert"); + api->DebugMessageCallback = loadProc("glDebugMessageCallback"); + api->GetDebugMessageLog = loadProc("glGetDebugMessageLog"); + api->PushDebugGroup = loadProc("glPushDebugGroup"); + api->PopDebugGroup = loadProc("glPopDebugGroup"); + api->ObjectLabel = loadProc("glObjectLabel"); + api->GetObjectLabel = loadProc("glGetObjectLabel"); + api->ObjectPtrLabel = loadProc("glObjectPtrLabel"); + api->GetObjectPtrLabel = loadProc("glGetObjectPtrLabel"); + api->GetPointerv = loadProc("glGetPointerv"); + api->Enablei = loadProc("glEnablei"); + api->Disablei = loadProc("glDisablei"); + api->BlendEquationi = loadProc("glBlendEquationi"); + api->BlendEquationSeparatei = loadProc("glBlendEquationSeparatei"); + api->BlendFunci = loadProc("glBlendFunci"); + api->BlendFuncSeparatei = loadProc("glBlendFuncSeparatei"); + api->ColorMaski = loadProc("glColorMaski"); + api->IsEnabledi = loadProc("glIsEnabledi"); + api->DrawElementsBaseVertex = loadProc("glDrawElementsBaseVertex"); + api->DrawRangeElementsBaseVertex = loadProc("glDrawRangeElementsBaseVertex"); + api->DrawElementsInstancedBaseVertex = loadProc("glDrawElementsInstancedBaseVertex"); + api->FramebufferTexture = loadProc("glFramebufferTexture"); + api->PrimitiveBoundingBox = loadProc("glPrimitiveBoundingBox"); + api->GetGraphicsResetStatus = loadProc("glGetGraphicsResetStatus"); + api->ReadnPixels = loadProc("glReadnPixels"); + api->GetnUniformfv = loadProc("glGetnUniformfv"); + api->GetnUniformiv = loadProc("glGetnUniformiv"); + api->GetnUniformuiv = loadProc("glGetnUniformuiv"); + api->MinSampleShading = loadProc("glMinSampleShading"); + api->PatchParameteri = loadProc("glPatchParameteri"); + api->TexParameterIiv = loadProc("glTexParameterIiv"); + api->TexParameterIuiv = loadProc("glTexParameterIuiv"); + api->GetTexParameterIiv = loadProc("glGetTexParameterIiv"); + api->GetTexParameterIuiv = loadProc("glGetTexParameterIuiv"); + api->SamplerParameterIiv = loadProc("glSamplerParameterIiv"); + api->SamplerParameterIuiv = loadProc("glSamplerParameterIuiv"); + api->GetSamplerParameterIiv = loadProc("glGetSamplerParameterIiv"); + api->GetSamplerParameterIuiv = loadProc("glGetSamplerParameterIuiv"); + api->TexBuffer = loadProc("glTexBuffer"); + api->TexBufferRange = loadProc("glTexBufferRange"); + api->TexStorage3DMultisample = loadProc("glTexStorage3DMultisample"); +} + +void mg_gl_select_api(mg_gl_api* api){ __mgGLAPI = api; } +mg_gl_api* mg_gl_get_api(void) { return(__mgGLAPI); } + diff --git a/src/gl_loader.h b/src/gl_loader.h index 97f64dc..882c902 100644 --- a/src/gl_loader.h +++ b/src/gl_loader.h @@ -1,22 +1,23 @@ -/******************************************************** -* -* @file: gl_loader.h -* @note: auto-generated by glapi.py from gl.xml -* @date: 22/022023 -* -*********************************************************/ -#ifndef __GL_LOADER_H__ -#define __GL_LOADER_H__ - -#include"gl_api.h" - -typedef void*(*mg_gl_load_proc)(const char* name); - -void mg_gl_load_gl41(mg_gl_api* api, mg_gl_load_proc loadProc); -void mg_gl_load_gl43(mg_gl_api* api, mg_gl_load_proc loadProc); -void mg_gl_load_gles30(mg_gl_api* api, mg_gl_load_proc loadProc); -void mg_gl_load_gles31(mg_gl_api* api, mg_gl_load_proc loadProc); - -void mg_gl_select_api(mg_gl_api* api); - -#endif // __GL_LOADER_H__ +/******************************************************** +* +* @file: gl_loader.h +* @note: auto-generated by glapi.py from gl.xml +* @date: 12/072023 +* +*********************************************************/ +#ifndef __GL_LOADER_H__ +#define __GL_LOADER_H__ + +#include"gl_api.h" + +typedef void*(*mg_gl_load_proc)(const char* name); + +void mg_gl_load_gl41(mg_gl_api* api, mg_gl_load_proc loadProc); +void mg_gl_load_gl43(mg_gl_api* api, mg_gl_load_proc loadProc); +void mg_gl_load_gl44(mg_gl_api* api, mg_gl_load_proc loadProc); +void mg_gl_load_gles30(mg_gl_api* api, mg_gl_load_proc loadProc); +void mg_gl_load_gles31(mg_gl_api* api, mg_gl_load_proc loadProc); + +void mg_gl_select_api(mg_gl_api* api); + +#endif // __GL_LOADER_H__ diff --git a/src/wgl_surface.c b/src/wgl_surface.c index 0a69191..375b4dd 100644 --- a/src/wgl_surface.c +++ b/src/wgl_surface.c @@ -254,7 +254,7 @@ mg_surface_data* mg_wgl_surface_create_for_window(mp_window window) int contextAttrs[] = { WGL_CONTEXT_MAJOR_VERSION_ARB, 4, - WGL_CONTEXT_MINOR_VERSION_ARB, 3, + WGL_CONTEXT_MINOR_VERSION_ARB, 4, WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB, 0}; @@ -270,7 +270,7 @@ mg_surface_data* mg_wgl_surface_create_for_window(mp_window window) //NOTE: make gl context current and load api wglMakeCurrent(surface->hDC, surface->glContext); wglSwapIntervalEXT(1); - mg_gl_load_gl43(&surface->api, mg_wgl_get_proc); + mg_gl_load_gl44(&surface->api, mg_wgl_get_proc); } } return((mg_surface_data*)surface);