gsdx-ogl: gl4.5: add plumbering to support direct_state_access and clip_control

This commit is contained in:
Gregory Hainaut 2014-09-07 17:27:49 +02:00
parent 0118d578a2
commit d720cc16a6
3 changed files with 307 additions and 91 deletions

View File

@ -1,5 +1,4 @@
/*
* Copyright (C) 2011-2013 Gregory hainaut
/* * Copyright (C) 2011-2014 Gregory hainaut
* Copyright (C) 2007-2009 Gabest
*
* This Program is free software; you can redistribute it and/or modify
@ -24,102 +23,133 @@
#include "GSdx.h"
#ifndef ENABLE_GLES
PFNGLACTIVETEXTUREPROC gl_ActiveTexture = NULL;
PFNGLBLENDCOLORPROC gl_BlendColor = NULL;
PFNGLATTACHSHADERPROC gl_AttachShader = NULL;
PFNGLBINDBUFFERPROC gl_BindBuffer = NULL;
PFNGLBINDBUFFERBASEPROC gl_BindBufferBase = NULL;
PFNGLBINDFRAMEBUFFERPROC gl_BindFramebuffer = NULL;
PFNGLBINDSAMPLERPROC gl_BindSampler = NULL;
PFNGLBINDVERTEXARRAYPROC gl_BindVertexArray = NULL;
PFNGLBLENDEQUATIONSEPARATEIARBPROC gl_BlendEquationSeparateiARB = NULL;
PFNGLBLENDFUNCSEPARATEIARBPROC gl_BlendFuncSeparateiARB = NULL;
PFNGLBLITFRAMEBUFFERPROC gl_BlitFramebuffer = NULL;
PFNGLBUFFERDATAPROC gl_BufferData = NULL;
PFNGLCHECKFRAMEBUFFERSTATUSPROC gl_CheckFramebufferStatus = NULL;
PFNGLCLEARBUFFERFVPROC gl_ClearBufferfv = NULL;
PFNGLCLEARBUFFERIVPROC gl_ClearBufferiv = NULL;
PFNGLCLEARBUFFERUIVPROC gl_ClearBufferuiv = NULL;
PFNGLCOLORMASKIPROC gl_ColorMaski = NULL;
PFNGLCOMPILESHADERPROC gl_CompileShader = NULL;
PFNGLCREATEPROGRAMPROC gl_CreateProgram = NULL;
PFNGLCREATESHADERPROC gl_CreateShader = NULL;
PFNGLCREATESHADERPROGRAMVPROC gl_CreateShaderProgramv = NULL;
PFNGLDELETEBUFFERSPROC gl_DeleteBuffers = NULL;
PFNGLDELETEFRAMEBUFFERSPROC gl_DeleteFramebuffers = NULL;
PFNGLDELETEPROGRAMPROC gl_DeleteProgram = NULL;
PFNGLDELETESAMPLERSPROC gl_DeleteSamplers = NULL;
PFNGLDELETESHADERPROC gl_DeleteShader = NULL;
PFNGLDELETEVERTEXARRAYSPROC gl_DeleteVertexArrays = NULL;
PFNGLDETACHSHADERPROC gl_DetachShader = NULL;
PFNGLDRAWBUFFERSPROC gl_DrawBuffers = NULL;
PFNGLDRAWELEMENTSBASEVERTEXPROC gl_DrawElementsBaseVertex = NULL;
PFNGLENABLEVERTEXATTRIBARRAYPROC gl_EnableVertexAttribArray = NULL;
PFNGLFRAMEBUFFERRENDERBUFFERPROC gl_FramebufferRenderbuffer = NULL;
PFNGLFRAMEBUFFERTEXTURE2DPROC gl_FramebufferTexture2D = NULL;
PFNGLGENBUFFERSPROC gl_GenBuffers = NULL;
PFNGLGENFRAMEBUFFERSPROC gl_GenFramebuffers = NULL;
PFNGLGENSAMPLERSPROC gl_GenSamplers = NULL;
PFNGLGENVERTEXARRAYSPROC gl_GenVertexArrays = NULL;
PFNGLGETBUFFERPARAMETERIVPROC gl_GetBufferParameteriv = NULL;
PFNGLGETDEBUGMESSAGELOGARBPROC gl_GetDebugMessageLogARB = NULL;
PFNGLGETPROGRAMINFOLOGPROC gl_GetProgramInfoLog = NULL;
PFNGLGETPROGRAMIVPROC gl_GetProgramiv = NULL;
PFNGLGETSHADERIVPROC gl_GetShaderiv = NULL;
PFNGLGETSTRINGIPROC gl_GetStringi = NULL;
PFNGLISFRAMEBUFFERPROC gl_IsFramebuffer = NULL;
PFNGLLINKPROGRAMPROC gl_LinkProgram = NULL;
PFNGLMAPBUFFERPROC gl_MapBuffer = NULL;
PFNGLMAPBUFFERRANGEPROC gl_MapBufferRange = NULL;
PFNGLPROGRAMPARAMETERIPROC gl_ProgramParameteri = NULL;
PFNGLSAMPLERPARAMETERFPROC gl_SamplerParameterf = NULL;
PFNGLSAMPLERPARAMETERIPROC gl_SamplerParameteri = NULL;
PFNGLSHADERSOURCEPROC gl_ShaderSource = NULL;
PFNGLUNIFORM1IPROC gl_Uniform1i = NULL;
PFNGLUNMAPBUFFERPROC gl_UnmapBuffer = NULL;
PFNGLUSEPROGRAMSTAGESPROC gl_UseProgramStages = NULL;
PFNGLVERTEXATTRIBIPOINTERPROC gl_VertexAttribIPointer = NULL;
PFNGLVERTEXATTRIBPOINTERPROC gl_VertexAttribPointer = NULL;
PFNGLBUFFERSUBDATAPROC gl_BufferSubData = NULL;
PFNGLFENCESYNCPROC gl_FenceSync = NULL;
PFNGLDELETESYNCPROC gl_DeleteSync = NULL;
PFNGLCLIENTWAITSYNCPROC gl_ClientWaitSync = NULL;
PFNGLFLUSHMAPPEDBUFFERRANGEPROC gl_FlushMappedBufferRange = NULL;
PFNGLACTIVETEXTUREPROC gl_ActiveTexture = NULL;
PFNGLBLENDCOLORPROC gl_BlendColor = NULL;
PFNGLATTACHSHADERPROC gl_AttachShader = NULL;
PFNGLBINDBUFFERPROC gl_BindBuffer = NULL;
PFNGLBINDBUFFERBASEPROC gl_BindBufferBase = NULL;
PFNGLBINDFRAMEBUFFERPROC gl_BindFramebuffer = NULL;
PFNGLBINDSAMPLERPROC gl_BindSampler = NULL;
PFNGLBINDVERTEXARRAYPROC gl_BindVertexArray = NULL;
PFNGLBLENDEQUATIONSEPARATEIARBPROC gl_BlendEquationSeparateiARB = NULL;
PFNGLBLENDFUNCSEPARATEIARBPROC gl_BlendFuncSeparateiARB = NULL;
PFNGLBLITFRAMEBUFFERPROC gl_BlitFramebuffer = NULL;
PFNGLBUFFERDATAPROC gl_BufferData = NULL;
PFNGLCHECKFRAMEBUFFERSTATUSPROC gl_CheckFramebufferStatus = NULL;
PFNGLCLEARBUFFERFVPROC gl_ClearBufferfv = NULL;
PFNGLCLEARBUFFERIVPROC gl_ClearBufferiv = NULL;
PFNGLCLEARBUFFERUIVPROC gl_ClearBufferuiv = NULL;
PFNGLCOLORMASKIPROC gl_ColorMaski = NULL;
PFNGLCOMPILESHADERPROC gl_CompileShader = NULL;
PFNGLCREATEPROGRAMPROC gl_CreateProgram = NULL;
PFNGLCREATESHADERPROC gl_CreateShader = NULL;
PFNGLCREATESHADERPROGRAMVPROC gl_CreateShaderProgramv = NULL;
PFNGLDELETEBUFFERSPROC gl_DeleteBuffers = NULL;
PFNGLDELETEFRAMEBUFFERSPROC gl_DeleteFramebuffers = NULL;
PFNGLDELETEPROGRAMPROC gl_DeleteProgram = NULL;
PFNGLDELETESAMPLERSPROC gl_DeleteSamplers = NULL;
PFNGLDELETESHADERPROC gl_DeleteShader = NULL;
PFNGLDELETEVERTEXARRAYSPROC gl_DeleteVertexArrays = NULL;
PFNGLDETACHSHADERPROC gl_DetachShader = NULL;
PFNGLDRAWBUFFERSPROC gl_DrawBuffers = NULL;
PFNGLDRAWELEMENTSBASEVERTEXPROC gl_DrawElementsBaseVertex = NULL;
PFNGLENABLEVERTEXATTRIBARRAYPROC gl_EnableVertexAttribArray = NULL;
PFNGLFRAMEBUFFERRENDERBUFFERPROC gl_FramebufferRenderbuffer = NULL;
PFNGLFRAMEBUFFERTEXTURE2DPROC gl_FramebufferTexture2D = NULL;
PFNGLGENBUFFERSPROC gl_GenBuffers = NULL;
PFNGLGENFRAMEBUFFERSPROC gl_GenFramebuffers = NULL;
PFNGLGENSAMPLERSPROC gl_GenSamplers = NULL;
PFNGLGENVERTEXARRAYSPROC gl_GenVertexArrays = NULL;
PFNGLGETBUFFERPARAMETERIVPROC gl_GetBufferParameteriv = NULL;
PFNGLGETDEBUGMESSAGELOGARBPROC gl_GetDebugMessageLogARB = NULL;
PFNGLGETPROGRAMINFOLOGPROC gl_GetProgramInfoLog = NULL;
PFNGLGETPROGRAMIVPROC gl_GetProgramiv = NULL;
PFNGLGETSHADERIVPROC gl_GetShaderiv = NULL;
PFNGLGETSTRINGIPROC gl_GetStringi = NULL;
PFNGLISFRAMEBUFFERPROC gl_IsFramebuffer = NULL;
PFNGLLINKPROGRAMPROC gl_LinkProgram = NULL;
PFNGLMAPBUFFERPROC gl_MapBuffer = NULL;
PFNGLMAPBUFFERRANGEPROC gl_MapBufferRange = NULL;
PFNGLPROGRAMPARAMETERIPROC gl_ProgramParameteri = NULL;
PFNGLSAMPLERPARAMETERFPROC gl_SamplerParameterf = NULL;
PFNGLSAMPLERPARAMETERIPROC gl_SamplerParameteri = NULL;
PFNGLSHADERSOURCEPROC gl_ShaderSource = NULL;
PFNGLUNIFORM1IPROC gl_Uniform1i = NULL;
PFNGLUNMAPBUFFERPROC gl_UnmapBuffer = NULL;
PFNGLUSEPROGRAMSTAGESPROC gl_UseProgramStages = NULL;
PFNGLVERTEXATTRIBIPOINTERPROC gl_VertexAttribIPointer = NULL;
PFNGLVERTEXATTRIBPOINTERPROC gl_VertexAttribPointer = NULL;
PFNGLBUFFERSUBDATAPROC gl_BufferSubData = NULL;
PFNGLFENCESYNCPROC gl_FenceSync = NULL;
PFNGLDELETESYNCPROC gl_DeleteSync = NULL;
PFNGLCLIENTWAITSYNCPROC gl_ClientWaitSync = NULL;
PFNGLFLUSHMAPPEDBUFFERRANGEPROC gl_FlushMappedBufferRange = NULL;
// GL4.0
PFNGLUNIFORMSUBROUTINESUIVPROC gl_UniformSubroutinesuiv = NULL;
PFNGLUNIFORMSUBROUTINESUIVPROC gl_UniformSubroutinesuiv = NULL;
// GL4.1
PFNGLBINDPROGRAMPIPELINEPROC gl_BindProgramPipeline = NULL;
PFNGLGENPROGRAMPIPELINESPROC gl_GenProgramPipelines = NULL;
PFNGLDELETEPROGRAMPIPELINESPROC gl_DeleteProgramPipelines = NULL;
PFNGLGETPROGRAMPIPELINEIVPROC gl_GetProgramPipelineiv = NULL;
PFNGLVALIDATEPROGRAMPIPELINEPROC gl_ValidateProgramPipeline = NULL;
PFNGLGETPROGRAMPIPELINEINFOLOGPROC gl_GetProgramPipelineInfoLog = NULL;
PFNGLBINDPROGRAMPIPELINEPROC gl_BindProgramPipeline = NULL;
PFNGLGENPROGRAMPIPELINESPROC gl_GenProgramPipelines = NULL;
PFNGLDELETEPROGRAMPIPELINESPROC gl_DeleteProgramPipelines = NULL;
PFNGLGETPROGRAMPIPELINEIVPROC gl_GetProgramPipelineiv = NULL;
PFNGLVALIDATEPROGRAMPIPELINEPROC gl_ValidateProgramPipeline = NULL;
PFNGLGETPROGRAMPIPELINEINFOLOGPROC gl_GetProgramPipelineInfoLog = NULL;
// NO GL4.1
PFNGLUSEPROGRAMPROC gl_UseProgram = NULL;
PFNGLGETSHADERINFOLOGPROC gl_GetShaderInfoLog = NULL;
PFNGLPROGRAMUNIFORM1IPROC gl_ProgramUniform1i = NULL;
PFNGLUSEPROGRAMPROC gl_UseProgram = NULL;
PFNGLGETSHADERINFOLOGPROC gl_GetShaderInfoLog = NULL;
PFNGLPROGRAMUNIFORM1IPROC gl_ProgramUniform1i = NULL;
// NO GL4.2
PFNGLGETUNIFORMBLOCKINDEXPROC gl_GetUniformBlockIndex = NULL;
PFNGLUNIFORMBLOCKBINDINGPROC gl_UniformBlockBinding = NULL;
PFNGLGETUNIFORMLOCATIONPROC gl_GetUniformLocation = NULL;
PFNGLGETUNIFORMBLOCKINDEXPROC gl_GetUniformBlockIndex = NULL;
PFNGLUNIFORMBLOCKBINDINGPROC gl_UniformBlockBinding = NULL;
PFNGLGETUNIFORMLOCATIONPROC gl_GetUniformLocation = NULL;
// GL4.3
PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData = NULL;
PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData = NULL;
// GL4.2
PFNGLBINDIMAGETEXTUREPROC gl_BindImageTexture = NULL;
PFNGLMEMORYBARRIERPROC gl_MemoryBarrier = NULL;
PFNGLTEXSTORAGE2DPROC gl_TexStorage2D = NULL;
PFNGLBINDIMAGETEXTUREPROC gl_BindImageTexture = NULL;
PFNGLMEMORYBARRIERPROC gl_MemoryBarrier = NULL;
PFNGLTEXSTORAGE2DPROC gl_TexStorage2D = NULL;
// GL4.4
PFNGLCLEARTEXIMAGEPROC gl_ClearTexImage = NULL;
PFNGLBINDTEXTURESPROC gl_BindTextures = NULL;
PFNGLBUFFERSTORAGEPROC gl_BufferStorage = NULL;
PFNGLCLEARTEXIMAGEPROC gl_ClearTexImage = NULL;
PFNGLBINDTEXTURESPROC gl_BindTextures = NULL;
PFNGLBUFFERSTORAGEPROC gl_BufferStorage = NULL;
// GL_ARB_bindless_texture (GL5?)
PFNGLGETTEXTURESAMPLERHANDLEARBPROC gl_GetTextureSamplerHandleARB = NULL;
PFNGLMAKETEXTUREHANDLERESIDENTARBPROC gl_MakeTextureHandleResidentARB = NULL;
PFNGLGETTEXTURESAMPLERHANDLEARBPROC gl_GetTextureSamplerHandleARB = NULL;
PFNGLMAKETEXTUREHANDLERESIDENTARBPROC gl_MakeTextureHandleResidentARB = NULL;
PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC gl_MakeTextureHandleNonResidentARB = NULL;
PFNGLUNIFORMHANDLEUI64VARBPROC gl_UniformHandleui64vARB = NULL;
PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC gl_ProgramUniformHandleui64vARB = NULL;
PFNGLUNIFORMHANDLEUI64VARBPROC gl_UniformHandleui64vARB = NULL;
PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC gl_ProgramUniformHandleui64vARB = NULL;
PFNGLDEPTHRANGEDNVPROC gl_DepthRangedNV = NULL;
// GL4.5
PFNGLCREATETEXTURESPROC gl_CreateTextures = NULL;
PFNGLTEXTURESTORAGE2DPROC gl_TextureStorage2D = NULL;
PFNGLTEXTURESUBIMAGE2DPROC gl_TextureSubImage2D = NULL;
PFNGLCOPYTEXTURESUBIMAGE2DPROC gl_CopyTextureSubImage2D = NULL;
PFNGLBINDTEXTUREUNITPROC gl_BindTextureUnit = NULL;
PFNGLGETTEXTUREIMAGEPROC gl_GetTextureImage = NULL;
PFNGLCREATEFRAMEBUFFERSPROC gl_CreateFramebuffers = NULL;
PFNGLCLEARNAMEDFRAMEBUFFERFVPROC gl_ClearNamedFramebufferfv = NULL;
PFNGLCLEARNAMEDFRAMEBUFFERIVPROC gl_ClearNamedFramebufferiv = NULL;
PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC gl_ClearNamedFramebufferuiv = NULL;
PFNGLNAMEDFRAMEBUFFERTEXTUREPROC gl_NamedFramebufferTexture = NULL;
PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC gl_NamedFramebufferDrawBuffers = NULL;
PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC gl_NamedFramebufferReadBuffer = NULL;
PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC gl_CheckNamedFramebufferStatus = NULL;
PFNGLCREATEBUFFERSPROC gl_CreateBuffers = NULL;
PFNGLNAMEDBUFFERSTORAGEPROC gl_NamedBufferStorage = NULL;
PFNGLNAMEDBUFFERDATAPROC gl_NamedBufferData = NULL;
PFNGLNAMEDBUFFERSUBDATAPROC gl_NamedBufferSubData = NULL;
PFNGLMAPNAMEDBUFFERPROC gl_MapNamedBuffer = NULL;
PFNGLMAPNAMEDBUFFERRANGEPROC gl_MapNamedBufferRange = NULL;
PFNGLUNMAPNAMEDBUFFERPROC gl_UnmapNamedBuffer = NULL;
PFNGLCREATESAMPLERSPROC gl_CreateSamplers = NULL;
PFNGLCREATEPROGRAMPIPELINESPROC gl_CreateProgramPipelines = NULL;
PFNGLCLIPCONTROLPROC gl_ClipControl = NULL;
PFNGLDEPTHRANGEDNVPROC gl_DepthRangedNV = NULL;
#endif
namespace GLLoader {
@ -146,6 +176,11 @@ namespace GLLoader {
// Surely recent hardware
bool found_GL_NV_depth_buffer_float = false;
// GL4.5 for the future (dx10/dx11 compatibility)
bool found_GL_ARB_clip_control = false;
bool found_GL_ARB_direct_state_access = false;
// Mandatory for FULL GL (but optional for GLES)
bool found_GL_ARB_multi_bind = false; // Not yet. Wait Mesa & AMD drivers.
bool found_GL_ARB_shading_language_420pack = false; // GLES 3.1 ???
@ -156,10 +191,10 @@ namespace GLLoader {
static bool status_and_override(bool& found, const std::string& name, bool mandatory = false)
{
if (!found) {
fprintf(stderr, "INFO: %s is not supported\n", name.c_str());
fprintf(stderr, "INFO: %s is NOT SUPPORTED\n", name.c_str());
if(mandatory) return false;
} else {
fprintf(stderr, "INFO: %s is supported\n", name.c_str());
fprintf(stderr, "INFO: %s is available\n", name.c_str());
}
std::string opt("override_");
@ -282,6 +317,10 @@ namespace GLLoader {
#ifdef ENABLE_GLES
fprintf(stderr, "DEBUG ext: %s\n", ext.c_str());
#endif
#ifdef GL45 // need to code it first :p
if (ext.compare("GL_ARB_clip_control") == 0) found_GL_ARB_clip_control = true;
#endif
if (ext.compare("GL_ARB_direct_state_access") == 0) found_GL_ARB_direct_state_access = true;
}
}
#endif
@ -306,6 +345,11 @@ namespace GLLoader {
status &= status_and_override(found_GL_NV_depth_buffer_float,"GL_NV_depth_buffer_float");
status &= status_and_override(found_GL_ARB_clip_control, "GL_ARB_clip_control");
// Mandatory extension in DSA mode
status &= status_and_override(found_GL_ARB_direct_state_access, "GL_ARB_direct_state_access", false);
status &= status_and_override(found_GL_ARB_copy_image, "GL_ARB_copy_image");
fprintf(stderr, "\n");
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2013 Gregory hainaut
* Copyright (C) 2011-2014 Gregory hainaut
* Copyright (C) 2007-2009 Gabest
*
* This Program is free software; you can redistribute it and/or modify
@ -21,6 +21,11 @@
#pragma once
#define GL_TEX_LEVEL_0 (0)
#define GL_TEX_LEVEL_1 (1)
#define GL_FB_DEFAULT (0)
#define GL_BUFFER_0 (0)
#ifndef ENABLE_GLES
// FIX compilation issue with Mesa 10
// Note it might be possible to do better with the right include
@ -94,6 +99,110 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GL
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
#endif /* GL_ARB_bindless_texture */
// Note: trim it
#ifndef GL_VERSION_4_5
#define GL_VERSION_4_5 1
#define GL_CONTEXT_LOST 0x0507
#define GL_NEGATIVE_ONE_TO_ONE 0x935E
#define GL_ZERO_TO_ONE 0x935F
#define GL_CLIP_ORIGIN 0x935C
#define GL_CLIP_DEPTH_MODE 0x935D
#define GL_QUERY_WAIT_INVERTED 0x8E17
#define GL_QUERY_NO_WAIT_INVERTED 0x8E18
#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19
#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A
#define GL_MAX_CULL_DISTANCES 0x82F9
#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA
#define GL_TEXTURE_TARGET 0x1006
#define GL_QUERY_TARGET 0x82EA
#define GL_TEXTURE_BINDING 0x82EB
#define GL_GUILTY_CONTEXT_RESET 0x8253
#define GL_INNOCENT_CONTEXT_RESET 0x8254
#define GL_UNKNOWN_CONTEXT_RESET 0x8255
#define GL_RESET_NOTIFICATION_STRATEGY 0x8256
#define GL_LOSE_CONTEXT_ON_RESET 0x8252
#define GL_NO_RESET_NOTIFICATION 0x8261
#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004
#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC
typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth);
typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint *buffers);
typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizei size, const void *data, GLbitfield flags);
typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizei size, const void *data, GLenum usage);
typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizei size, const void *data);
typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size);
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data);
typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access);
typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access);
typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer);
typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizei length);
typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum buf);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum src);
typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments);
typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil);
typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target);
typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint *textures);
typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer);
typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizei size);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat *param);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint *params);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint *param);
typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture);
typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture);
typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index);
typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index);
typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer);
typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor);
typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint *param);
typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param);
typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param);
typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint *samplers);
typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
typedef void (APIENTRYP PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint *ids);
typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers);
typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels);
typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC) (void);
typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, void *pixels);
typedef void (APIENTRYP PFNGLGETNTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
typedef void (APIENTRYP PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
typedef void (APIENTRYP PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void);
typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
#endif /* GL_VERSION_4_5 */
#endif
@ -195,6 +304,36 @@ extern PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC gl_ProgramUniformHandleui64vARB;
extern PFNGLDEPTHRANGEDNVPROC gl_DepthRangedNV;
// GL4.5
extern PFNGLCREATETEXTURESPROC gl_CreateTextures;
extern PFNGLTEXTURESTORAGE2DPROC gl_TextureStorage2D;
extern PFNGLTEXTURESUBIMAGE2DPROC gl_TextureSubImage2D;
extern PFNGLCOPYTEXTURESUBIMAGE2DPROC gl_CopyTextureSubImage2D;
extern PFNGLBINDTEXTUREUNITPROC gl_BindTextureUnit;
extern PFNGLGETTEXTUREIMAGEPROC gl_GetTextureImage;
extern PFNGLCREATEFRAMEBUFFERSPROC gl_CreateFramebuffers;
extern PFNGLCLEARNAMEDFRAMEBUFFERFVPROC gl_ClearNamedFramebufferfv;
extern PFNGLCLEARNAMEDFRAMEBUFFERIVPROC gl_ClearNamedFramebufferiv;
extern PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC gl_ClearNamedFramebufferuiv;
extern PFNGLNAMEDFRAMEBUFFERTEXTUREPROC gl_NamedFramebufferTexture;
extern PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC gl_NamedFramebufferDrawBuffers;
extern PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC gl_NamedFramebufferReadBuffer;
extern PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC gl_CheckNamedFramebufferStatus;
extern PFNGLCREATEBUFFERSPROC gl_CreateBuffers;
extern PFNGLNAMEDBUFFERSTORAGEPROC gl_NamedBufferStorage;
extern PFNGLNAMEDBUFFERDATAPROC gl_NamedBufferData;
extern PFNGLNAMEDBUFFERSUBDATAPROC gl_NamedBufferSubData;
extern PFNGLMAPNAMEDBUFFERPROC gl_MapNamedBuffer;
extern PFNGLMAPNAMEDBUFFERRANGEPROC gl_MapNamedBufferRange;
extern PFNGLUNMAPNAMEDBUFFERPROC gl_UnmapNamedBuffer;
extern PFNGLCREATESAMPLERSPROC gl_CreateSamplers;
extern PFNGLCREATEPROGRAMPIPELINESPROC gl_CreateProgramPipelines;
extern PFNGLCLIPCONTROLPROC gl_ClipControl;
#else
#define gl_ActiveTexture glActiveTexture
#define gl_BlendColor glBlendColor
@ -297,4 +436,6 @@ namespace GLLoader {
extern bool found_GL_ARB_bindless_texture;
extern bool found_GL_ARB_explicit_uniform_location;
extern bool found_GL_NV_depth_buffer_float;
extern bool found_GL_ARB_clip_control;
extern bool found_GL_ARB_direct_state_access;
}

View File

@ -1,4 +1,5 @@
/*
* Copyright (C) 2011-2014 Gregory hainaut
* Copyright (C) 2007-2009 Gabest
* http://www.gabest.org
*
@ -122,5 +123,35 @@ void GSWndGL::PopulateGlFunction()
*(void**)&(gl_DepthRangedNV) = GetProcAddress("glDepthRangedNV", true);
// GL4.5
*(void**)&(gl_CreateTextures) = GetProcAddress("glCreateTextures", true);
*(void**)&(gl_TextureStorage2D) = GetProcAddress("glTextureStorage2D", true);
*(void**)&(gl_TextureSubImage2D) = GetProcAddress("glTextureSubImage2D", true);
*(void**)&(gl_CopyTextureSubImage2D) = GetProcAddress("glCopyTextureSubImage2D", true);
*(void**)&(gl_BindTextureUnit) = GetProcAddress("glBindTextureUnit", true);
*(void**)&(gl_GetTextureImage) = GetProcAddress("glGetTextureImage", true);
*(void**)&(gl_CreateFramebuffers) = GetProcAddress("glCreateFramebuffers", true);
*(void**)&(gl_ClearNamedFramebufferfv) = GetProcAddress("glClearNamedFramebufferfv", true);
*(void**)&(gl_ClearNamedFramebufferuiv) = GetProcAddress("glClearNamedFramebufferuiv", true);
*(void**)&(gl_ClearNamedFramebufferiv) = GetProcAddress("glClearNamedFramebufferiv", true);
*(void**)&(gl_NamedFramebufferTexture) = GetProcAddress("glNamedFramebufferTexture", true);
*(void**)&(gl_NamedFramebufferDrawBuffers) = GetProcAddress("glNamedFramebufferDrawBuffers", true);
*(void**)&(gl_NamedFramebufferReadBuffer) = GetProcAddress("glNamedFramebufferReadBuffer", true);
*(void**)&(gl_CheckNamedFramebufferStatus) = GetProcAddress("glCheckNamedFramebufferStatus", true);
*(void**)&(gl_CreateBuffers) = GetProcAddress("glCreateBuffers", true);
*(void**)&(gl_NamedBufferStorage) = GetProcAddress("glNamedBufferStorage", true);
*(void**)&(gl_NamedBufferData) = GetProcAddress("glNamedBufferData", true);
*(void**)&(gl_NamedBufferSubData) = GetProcAddress("glNamedBufferSubData", true);
*(void**)&(gl_MapNamedBuffer) = GetProcAddress("glMapNamedBuffer", true);
*(void**)&(gl_MapNamedBufferRange) = GetProcAddress("glMapNamedBufferRange", true);
*(void**)&(gl_UnmapNamedBuffer) = GetProcAddress("glUnmapNamedBuffer", true);
*(void**)&(gl_CreateSamplers) = GetProcAddress("glCreateSamplers", true);
*(void**)&(gl_CreateProgramPipelines) = GetProcAddress("glCreateProgramPipelines", true);
*(void**)&(gl_ClipControl) = GetProcAddress("glClipControl", true);
#endif
}