renderer_opengl: Add driver class to report info/bugs
This commit is contained in:
		
							
								
								
									
										309
									
								
								externals/glad/include/glad/glad.h
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										309
									
								
								externals/glad/include/glad/glad.h
									
									
									
									
										vendored
									
									
								
							@@ -1,12 +1,14 @@
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
    OpenGL, OpenGL ES loader generated by glad 0.1.36 on Thu Sep  8 23:42:22 2022.
 | 
			
		||||
    OpenGL, OpenGL ES loader generated by glad 0.1.36 on Fri Sep  9 09:22:43 2022.
 | 
			
		||||
 | 
			
		||||
    Language/Generator: C/C++
 | 
			
		||||
    Specification: gl
 | 
			
		||||
    APIs: gl=4.4, gles2=3.2
 | 
			
		||||
    Profile: core
 | 
			
		||||
    Extensions:
 | 
			
		||||
        GL_ARB_buffer_storage,
 | 
			
		||||
        GL_ARB_direct_state_access,
 | 
			
		||||
        GL_EXT_buffer_storage,
 | 
			
		||||
        GL_EXT_clip_cull_distance
 | 
			
		||||
    Loader: True
 | 
			
		||||
@@ -15,9 +17,9 @@
 | 
			
		||||
    Reproducible: False
 | 
			
		||||
 | 
			
		||||
    Commandline:
 | 
			
		||||
        --profile="core" --api="gl=4.4,gles2=3.2" --generator="c" --spec="gl" --extensions="GL_EXT_buffer_storage,GL_EXT_clip_cull_distance"
 | 
			
		||||
        --profile="core" --api="gl=4.4,gles2=3.2" --generator="c" --spec="gl" --extensions="GL_ARB_buffer_storage,GL_ARB_direct_state_access,GL_EXT_buffer_storage,GL_EXT_clip_cull_distance"
 | 
			
		||||
    Online:
 | 
			
		||||
        https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D4.4&api=gles2%3D3.2&extensions=GL_EXT_buffer_storage&extensions=GL_EXT_clip_cull_distance
 | 
			
		||||
        https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D4.4&api=gles2%3D3.2&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_direct_state_access&extensions=GL_EXT_buffer_storage&extensions=GL_EXT_clip_cull_distance
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -3362,6 +3364,8 @@ typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC)(GLuint program, GLint location,
 | 
			
		||||
GLAPI PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv;
 | 
			
		||||
#define glGetnUniformuiv glad_glGetnUniformuiv
 | 
			
		||||
#endif
 | 
			
		||||
#define GL_TEXTURE_TARGET 0x1006
 | 
			
		||||
#define GL_QUERY_TARGET 0x82EA
 | 
			
		||||
#define GL_MAP_PERSISTENT_BIT_EXT 0x0040
 | 
			
		||||
#define GL_MAP_COHERENT_BIT_EXT 0x0080
 | 
			
		||||
#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100
 | 
			
		||||
@@ -3380,6 +3384,305 @@ GLAPI PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv;
 | 
			
		||||
#define GL_CLIP_DISTANCE5_EXT 0x3005
 | 
			
		||||
#define GL_CLIP_DISTANCE6_EXT 0x3006
 | 
			
		||||
#define GL_CLIP_DISTANCE7_EXT 0x3007
 | 
			
		||||
#ifndef GL_ARB_buffer_storage
 | 
			
		||||
#define GL_ARB_buffer_storage 1
 | 
			
		||||
GLAPI int GLAD_GL_ARB_buffer_storage;
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef GL_ARB_direct_state_access
 | 
			
		||||
#define GL_ARB_direct_state_access 1
 | 
			
		||||
GLAPI int GLAD_GL_ARB_direct_state_access;
 | 
			
		||||
typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC)(GLsizei n, GLuint *ids);
 | 
			
		||||
GLAPI PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks;
 | 
			
		||||
#define glCreateTransformFeedbacks glad_glCreateTransformFeedbacks
 | 
			
		||||
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)(GLuint xfb, GLuint index, GLuint buffer);
 | 
			
		||||
GLAPI PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase;
 | 
			
		||||
#define glTransformFeedbackBufferBase glad_glTransformFeedbackBufferBase
 | 
			
		||||
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
 | 
			
		||||
GLAPI PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange;
 | 
			
		||||
#define glTransformFeedbackBufferRange glad_glTransformFeedbackBufferRange
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC)(GLuint xfb, GLenum pname, GLint *param);
 | 
			
		||||
GLAPI PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv;
 | 
			
		||||
#define glGetTransformFeedbackiv glad_glGetTransformFeedbackiv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC)(GLuint xfb, GLenum pname, GLuint index, GLint *param);
 | 
			
		||||
GLAPI PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v;
 | 
			
		||||
#define glGetTransformFeedbacki_v glad_glGetTransformFeedbacki_v
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC)(GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
 | 
			
		||||
GLAPI PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v;
 | 
			
		||||
#define glGetTransformFeedbacki64_v glad_glGetTransformFeedbacki64_v
 | 
			
		||||
typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC)(GLsizei n, GLuint *buffers);
 | 
			
		||||
GLAPI PFNGLCREATEBUFFERSPROC glad_glCreateBuffers;
 | 
			
		||||
#define glCreateBuffers glad_glCreateBuffers
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC)(GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
 | 
			
		||||
GLAPI PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage;
 | 
			
		||||
#define glNamedBufferStorage glad_glNamedBufferStorage
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC)(GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
 | 
			
		||||
GLAPI PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData;
 | 
			
		||||
#define glNamedBufferData glad_glNamedBufferData
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
 | 
			
		||||
GLAPI PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData;
 | 
			
		||||
#define glNamedBufferSubData glad_glNamedBufferSubData
 | 
			
		||||
typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
 | 
			
		||||
GLAPI PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData;
 | 
			
		||||
#define glCopyNamedBufferSubData glad_glCopyNamedBufferSubData
 | 
			
		||||
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
 | 
			
		||||
GLAPI PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData;
 | 
			
		||||
#define glClearNamedBufferData glad_glClearNamedBufferData
 | 
			
		||||
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
 | 
			
		||||
GLAPI PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData;
 | 
			
		||||
#define glClearNamedBufferSubData glad_glClearNamedBufferSubData
 | 
			
		||||
typedef void * (APIENTRYP PFNGLMAPNAMEDBUFFERPROC)(GLuint buffer, GLenum access);
 | 
			
		||||
GLAPI PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer;
 | 
			
		||||
#define glMapNamedBuffer glad_glMapNamedBuffer
 | 
			
		||||
typedef void * (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
 | 
			
		||||
GLAPI PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange;
 | 
			
		||||
#define glMapNamedBufferRange glad_glMapNamedBufferRange
 | 
			
		||||
typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC)(GLuint buffer);
 | 
			
		||||
GLAPI PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer;
 | 
			
		||||
#define glUnmapNamedBuffer glad_glUnmapNamedBuffer
 | 
			
		||||
typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length);
 | 
			
		||||
GLAPI PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange;
 | 
			
		||||
#define glFlushMappedNamedBufferRange glad_glFlushMappedNamedBufferRange
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC)(GLuint buffer, GLenum pname, GLint *params);
 | 
			
		||||
GLAPI PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv;
 | 
			
		||||
#define glGetNamedBufferParameteriv glad_glGetNamedBufferParameteriv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)(GLuint buffer, GLenum pname, GLint64 *params);
 | 
			
		||||
GLAPI PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v;
 | 
			
		||||
#define glGetNamedBufferParameteri64v glad_glGetNamedBufferParameteri64v
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC)(GLuint buffer, GLenum pname, void **params);
 | 
			
		||||
GLAPI PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv;
 | 
			
		||||
#define glGetNamedBufferPointerv glad_glGetNamedBufferPointerv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, void *data);
 | 
			
		||||
GLAPI PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData;
 | 
			
		||||
#define glGetNamedBufferSubData glad_glGetNamedBufferSubData
 | 
			
		||||
typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC)(GLsizei n, GLuint *framebuffers);
 | 
			
		||||
GLAPI PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers;
 | 
			
		||||
#define glCreateFramebuffers glad_glCreateFramebuffers
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
 | 
			
		||||
GLAPI PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer;
 | 
			
		||||
#define glNamedFramebufferRenderbuffer glad_glNamedFramebufferRenderbuffer
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)(GLuint framebuffer, GLenum pname, GLint param);
 | 
			
		||||
GLAPI PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri;
 | 
			
		||||
#define glNamedFramebufferParameteri glad_glNamedFramebufferParameteri
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
 | 
			
		||||
GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture;
 | 
			
		||||
#define glNamedFramebufferTexture glad_glNamedFramebufferTexture
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
 | 
			
		||||
GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer;
 | 
			
		||||
#define glNamedFramebufferTextureLayer glad_glNamedFramebufferTextureLayer
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)(GLuint framebuffer, GLenum buf);
 | 
			
		||||
GLAPI PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer;
 | 
			
		||||
#define glNamedFramebufferDrawBuffer glad_glNamedFramebufferDrawBuffer
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)(GLuint framebuffer, GLsizei n, const GLenum *bufs);
 | 
			
		||||
GLAPI PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers;
 | 
			
		||||
#define glNamedFramebufferDrawBuffers glad_glNamedFramebufferDrawBuffers
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)(GLuint framebuffer, GLenum src);
 | 
			
		||||
GLAPI PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer;
 | 
			
		||||
#define glNamedFramebufferReadBuffer glad_glNamedFramebufferReadBuffer
 | 
			
		||||
typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)(GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments);
 | 
			
		||||
GLAPI PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData;
 | 
			
		||||
#define glInvalidateNamedFramebufferData glad_glInvalidateNamedFramebufferData
 | 
			
		||||
typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)(GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
 | 
			
		||||
GLAPI PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData;
 | 
			
		||||
#define glInvalidateNamedFramebufferSubData glad_glInvalidateNamedFramebufferSubData
 | 
			
		||||
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value);
 | 
			
		||||
GLAPI PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv;
 | 
			
		||||
#define glClearNamedFramebufferiv glad_glClearNamedFramebufferiv
 | 
			
		||||
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value);
 | 
			
		||||
GLAPI PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv;
 | 
			
		||||
#define glClearNamedFramebufferuiv glad_glClearNamedFramebufferuiv
 | 
			
		||||
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value);
 | 
			
		||||
GLAPI PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv;
 | 
			
		||||
#define glClearNamedFramebufferfv glad_glClearNamedFramebufferfv
 | 
			
		||||
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
 | 
			
		||||
GLAPI PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi;
 | 
			
		||||
#define glClearNamedFramebufferfi glad_glClearNamedFramebufferfi
 | 
			
		||||
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);
 | 
			
		||||
GLAPI PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer;
 | 
			
		||||
#define glBlitNamedFramebuffer glad_glBlitNamedFramebuffer
 | 
			
		||||
typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)(GLuint framebuffer, GLenum target);
 | 
			
		||||
GLAPI PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus;
 | 
			
		||||
#define glCheckNamedFramebufferStatus glad_glCheckNamedFramebufferStatus
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)(GLuint framebuffer, GLenum pname, GLint *param);
 | 
			
		||||
GLAPI PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv;
 | 
			
		||||
#define glGetNamedFramebufferParameteriv glad_glGetNamedFramebufferParameteriv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
 | 
			
		||||
GLAPI PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv;
 | 
			
		||||
#define glGetNamedFramebufferAttachmentParameteriv glad_glGetNamedFramebufferAttachmentParameteriv
 | 
			
		||||
typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC)(GLsizei n, GLuint *renderbuffers);
 | 
			
		||||
GLAPI PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers;
 | 
			
		||||
#define glCreateRenderbuffers glad_glCreateRenderbuffers
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
 | 
			
		||||
GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage;
 | 
			
		||||
#define glNamedRenderbufferStorage glad_glNamedRenderbufferStorage
 | 
			
		||||
typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
 | 
			
		||||
GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample;
 | 
			
		||||
#define glNamedRenderbufferStorageMultisample glad_glNamedRenderbufferStorageMultisample
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)(GLuint renderbuffer, GLenum pname, GLint *params);
 | 
			
		||||
GLAPI PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv;
 | 
			
		||||
#define glGetNamedRenderbufferParameteriv glad_glGetNamedRenderbufferParameteriv
 | 
			
		||||
typedef void (APIENTRYP PFNGLCREATETEXTURESPROC)(GLenum target, GLsizei n, GLuint *textures);
 | 
			
		||||
GLAPI PFNGLCREATETEXTURESPROC glad_glCreateTextures;
 | 
			
		||||
#define glCreateTextures glad_glCreateTextures
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC)(GLuint texture, GLenum internalformat, GLuint buffer);
 | 
			
		||||
GLAPI PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer;
 | 
			
		||||
#define glTextureBuffer glad_glTextureBuffer
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC)(GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
 | 
			
		||||
GLAPI PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange;
 | 
			
		||||
#define glTextureBufferRange glad_glTextureBufferRange
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width);
 | 
			
		||||
GLAPI PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D;
 | 
			
		||||
#define glTextureStorage1D glad_glTextureStorage1D
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
 | 
			
		||||
GLAPI PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D;
 | 
			
		||||
#define glTextureStorage2D glad_glTextureStorage2D
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
 | 
			
		||||
GLAPI PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D;
 | 
			
		||||
#define glTextureStorage3D glad_glTextureStorage3D
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
 | 
			
		||||
GLAPI PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample;
 | 
			
		||||
#define glTextureStorage2DMultisample glad_glTextureStorage2DMultisample
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
 | 
			
		||||
GLAPI PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample;
 | 
			
		||||
#define glTextureStorage3DMultisample glad_glTextureStorage3DMultisample
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
 | 
			
		||||
GLAPI PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D;
 | 
			
		||||
#define glTextureSubImage1D glad_glTextureSubImage1D
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
 | 
			
		||||
GLAPI PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D;
 | 
			
		||||
#define glTextureSubImage2D glad_glTextureSubImage2D
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
 | 
			
		||||
GLAPI PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D;
 | 
			
		||||
#define glTextureSubImage3D glad_glTextureSubImage3D
 | 
			
		||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
 | 
			
		||||
GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D;
 | 
			
		||||
#define glCompressedTextureSubImage1D glad_glCompressedTextureSubImage1D
 | 
			
		||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
 | 
			
		||||
GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D;
 | 
			
		||||
#define glCompressedTextureSubImage2D glad_glCompressedTextureSubImage2D
 | 
			
		||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
 | 
			
		||||
GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D;
 | 
			
		||||
#define glCompressedTextureSubImage3D glad_glCompressedTextureSubImage3D
 | 
			
		||||
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
 | 
			
		||||
GLAPI PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D;
 | 
			
		||||
#define glCopyTextureSubImage1D glad_glCopyTextureSubImage1D
 | 
			
		||||
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
 | 
			
		||||
GLAPI PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D;
 | 
			
		||||
#define glCopyTextureSubImage2D glad_glCopyTextureSubImage2D
 | 
			
		||||
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
 | 
			
		||||
GLAPI PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D;
 | 
			
		||||
#define glCopyTextureSubImage3D glad_glCopyTextureSubImage3D
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC)(GLuint texture, GLenum pname, GLfloat param);
 | 
			
		||||
GLAPI PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf;
 | 
			
		||||
#define glTextureParameterf glad_glTextureParameterf
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC)(GLuint texture, GLenum pname, const GLfloat *param);
 | 
			
		||||
GLAPI PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv;
 | 
			
		||||
#define glTextureParameterfv glad_glTextureParameterfv
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC)(GLuint texture, GLenum pname, GLint param);
 | 
			
		||||
GLAPI PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri;
 | 
			
		||||
#define glTextureParameteri glad_glTextureParameteri
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC)(GLuint texture, GLenum pname, const GLint *params);
 | 
			
		||||
GLAPI PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv;
 | 
			
		||||
#define glTextureParameterIiv glad_glTextureParameterIiv
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC)(GLuint texture, GLenum pname, const GLuint *params);
 | 
			
		||||
GLAPI PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv;
 | 
			
		||||
#define glTextureParameterIuiv glad_glTextureParameterIuiv
 | 
			
		||||
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC)(GLuint texture, GLenum pname, const GLint *param);
 | 
			
		||||
GLAPI PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv;
 | 
			
		||||
#define glTextureParameteriv glad_glTextureParameteriv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC)(GLuint texture);
 | 
			
		||||
GLAPI PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap;
 | 
			
		||||
#define glGenerateTextureMipmap glad_glGenerateTextureMipmap
 | 
			
		||||
typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC)(GLuint unit, GLuint texture);
 | 
			
		||||
GLAPI PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit;
 | 
			
		||||
#define glBindTextureUnit glad_glBindTextureUnit
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC)(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
 | 
			
		||||
GLAPI PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage;
 | 
			
		||||
#define glGetTextureImage glad_glGetTextureImage
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)(GLuint texture, GLint level, GLsizei bufSize, void *pixels);
 | 
			
		||||
GLAPI PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage;
 | 
			
		||||
#define glGetCompressedTextureImage glad_glGetCompressedTextureImage
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC)(GLuint texture, GLint level, GLenum pname, GLfloat *params);
 | 
			
		||||
GLAPI PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv;
 | 
			
		||||
#define glGetTextureLevelParameterfv glad_glGetTextureLevelParameterfv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC)(GLuint texture, GLint level, GLenum pname, GLint *params);
 | 
			
		||||
GLAPI PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv;
 | 
			
		||||
#define glGetTextureLevelParameteriv glad_glGetTextureLevelParameteriv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC)(GLuint texture, GLenum pname, GLfloat *params);
 | 
			
		||||
GLAPI PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv;
 | 
			
		||||
#define glGetTextureParameterfv glad_glGetTextureParameterfv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC)(GLuint texture, GLenum pname, GLint *params);
 | 
			
		||||
GLAPI PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv;
 | 
			
		||||
#define glGetTextureParameterIiv glad_glGetTextureParameterIiv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC)(GLuint texture, GLenum pname, GLuint *params);
 | 
			
		||||
GLAPI PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv;
 | 
			
		||||
#define glGetTextureParameterIuiv glad_glGetTextureParameterIuiv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC)(GLuint texture, GLenum pname, GLint *params);
 | 
			
		||||
GLAPI PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv;
 | 
			
		||||
#define glGetTextureParameteriv glad_glGetTextureParameteriv
 | 
			
		||||
typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC)(GLsizei n, GLuint *arrays);
 | 
			
		||||
GLAPI PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays;
 | 
			
		||||
#define glCreateVertexArrays glad_glCreateVertexArrays
 | 
			
		||||
typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC)(GLuint vaobj, GLuint index);
 | 
			
		||||
GLAPI PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib;
 | 
			
		||||
#define glDisableVertexArrayAttrib glad_glDisableVertexArrayAttrib
 | 
			
		||||
typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC)(GLuint vaobj, GLuint index);
 | 
			
		||||
GLAPI PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib;
 | 
			
		||||
#define glEnableVertexArrayAttrib glad_glEnableVertexArrayAttrib
 | 
			
		||||
typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC)(GLuint vaobj, GLuint buffer);
 | 
			
		||||
GLAPI PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer;
 | 
			
		||||
#define glVertexArrayElementBuffer glad_glVertexArrayElementBuffer
 | 
			
		||||
typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
 | 
			
		||||
GLAPI PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer;
 | 
			
		||||
#define glVertexArrayVertexBuffer glad_glVertexArrayVertexBuffer
 | 
			
		||||
typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC)(GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
 | 
			
		||||
GLAPI PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers;
 | 
			
		||||
#define glVertexArrayVertexBuffers glad_glVertexArrayVertexBuffers
 | 
			
		||||
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC)(GLuint vaobj, GLuint attribindex, GLuint bindingindex);
 | 
			
		||||
GLAPI PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding;
 | 
			
		||||
#define glVertexArrayAttribBinding glad_glVertexArrayAttribBinding
 | 
			
		||||
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
 | 
			
		||||
GLAPI PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat;
 | 
			
		||||
#define glVertexArrayAttribFormat glad_glVertexArrayAttribFormat
 | 
			
		||||
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
 | 
			
		||||
GLAPI PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat;
 | 
			
		||||
#define glVertexArrayAttribIFormat glad_glVertexArrayAttribIFormat
 | 
			
		||||
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
 | 
			
		||||
GLAPI PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat;
 | 
			
		||||
#define glVertexArrayAttribLFormat glad_glVertexArrayAttribLFormat
 | 
			
		||||
typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC)(GLuint vaobj, GLuint bindingindex, GLuint divisor);
 | 
			
		||||
GLAPI PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor;
 | 
			
		||||
#define glVertexArrayBindingDivisor glad_glVertexArrayBindingDivisor
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC)(GLuint vaobj, GLenum pname, GLint *param);
 | 
			
		||||
GLAPI PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv;
 | 
			
		||||
#define glGetVertexArrayiv glad_glGetVertexArrayiv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint *param);
 | 
			
		||||
GLAPI PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv;
 | 
			
		||||
#define glGetVertexArrayIndexediv glad_glGetVertexArrayIndexediv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint64 *param);
 | 
			
		||||
GLAPI PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv;
 | 
			
		||||
#define glGetVertexArrayIndexed64iv glad_glGetVertexArrayIndexed64iv
 | 
			
		||||
typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC)(GLsizei n, GLuint *samplers);
 | 
			
		||||
GLAPI PFNGLCREATESAMPLERSPROC glad_glCreateSamplers;
 | 
			
		||||
#define glCreateSamplers glad_glCreateSamplers
 | 
			
		||||
typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC)(GLsizei n, GLuint *pipelines);
 | 
			
		||||
GLAPI PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines;
 | 
			
		||||
#define glCreateProgramPipelines glad_glCreateProgramPipelines
 | 
			
		||||
typedef void (APIENTRYP PFNGLCREATEQUERIESPROC)(GLenum target, GLsizei n, GLuint *ids);
 | 
			
		||||
GLAPI PFNGLCREATEQUERIESPROC glad_glCreateQueries;
 | 
			
		||||
#define glCreateQueries glad_glCreateQueries
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTI64VPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset);
 | 
			
		||||
GLAPI PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v;
 | 
			
		||||
#define glGetQueryBufferObjecti64v glad_glGetQueryBufferObjecti64v
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTIVPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset);
 | 
			
		||||
GLAPI PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv;
 | 
			
		||||
#define glGetQueryBufferObjectiv glad_glGetQueryBufferObjectiv
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUI64VPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset);
 | 
			
		||||
GLAPI PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v;
 | 
			
		||||
#define glGetQueryBufferObjectui64v glad_glGetQueryBufferObjectui64v
 | 
			
		||||
typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUIVPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset);
 | 
			
		||||
GLAPI PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv;
 | 
			
		||||
#define glGetQueryBufferObjectuiv glad_glGetQueryBufferObjectuiv
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef GL_EXT_buffer_storage
 | 
			
		||||
#define GL_EXT_buffer_storage 1
 | 
			
		||||
GLAPI int GLAD_GL_EXT_buffer_storage;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										216
									
								
								externals/glad/src/glad.c
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										216
									
								
								externals/glad/src/glad.c
									
									
									
									
										vendored
									
									
								
							@@ -1,12 +1,14 @@
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
    OpenGL, OpenGL ES loader generated by glad 0.1.36 on Thu Sep  8 23:42:22 2022.
 | 
			
		||||
    OpenGL, OpenGL ES loader generated by glad 0.1.36 on Fri Sep  9 09:22:43 2022.
 | 
			
		||||
 | 
			
		||||
    Language/Generator: C/C++
 | 
			
		||||
    Specification: gl
 | 
			
		||||
    APIs: gl=4.4, gles2=3.2
 | 
			
		||||
    Profile: core
 | 
			
		||||
    Extensions:
 | 
			
		||||
        GL_ARB_buffer_storage,
 | 
			
		||||
        GL_ARB_direct_state_access,
 | 
			
		||||
        GL_EXT_buffer_storage,
 | 
			
		||||
        GL_EXT_clip_cull_distance
 | 
			
		||||
    Loader: True
 | 
			
		||||
@@ -15,9 +17,9 @@
 | 
			
		||||
    Reproducible: False
 | 
			
		||||
 | 
			
		||||
    Commandline:
 | 
			
		||||
        --profile="core" --api="gl=4.4,gles2=3.2" --generator="c" --spec="gl" --extensions="GL_EXT_buffer_storage,GL_EXT_clip_cull_distance"
 | 
			
		||||
        --profile="core" --api="gl=4.4,gles2=3.2" --generator="c" --spec="gl" --extensions="GL_ARB_buffer_storage,GL_ARB_direct_state_access,GL_EXT_buffer_storage,GL_EXT_clip_cull_distance"
 | 
			
		||||
    Online:
 | 
			
		||||
        https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D4.4&api=gles2%3D3.2&extensions=GL_EXT_buffer_storage&extensions=GL_EXT_clip_cull_distance
 | 
			
		||||
        https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D4.4&api=gles2%3D3.2&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_direct_state_access&extensions=GL_EXT_buffer_storage&extensions=GL_EXT_clip_cull_distance
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
@@ -858,8 +860,107 @@ PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv = NULL;
 | 
			
		||||
PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf = NULL;
 | 
			
		||||
PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv = NULL;
 | 
			
		||||
PFNGLWAITSYNCPROC glad_glWaitSync = NULL;
 | 
			
		||||
int GLAD_GL_ARB_buffer_storage = 0;
 | 
			
		||||
int GLAD_GL_ARB_direct_state_access = 0;
 | 
			
		||||
int GLAD_GL_EXT_buffer_storage = 0;
 | 
			
		||||
int GLAD_GL_EXT_clip_cull_distance = 0;
 | 
			
		||||
PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks = NULL;
 | 
			
		||||
PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase = NULL;
 | 
			
		||||
PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange = NULL;
 | 
			
		||||
PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv = NULL;
 | 
			
		||||
PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v = NULL;
 | 
			
		||||
PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v = NULL;
 | 
			
		||||
PFNGLCREATEBUFFERSPROC glad_glCreateBuffers = NULL;
 | 
			
		||||
PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage = NULL;
 | 
			
		||||
PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData = NULL;
 | 
			
		||||
PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData = NULL;
 | 
			
		||||
PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData = NULL;
 | 
			
		||||
PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData = NULL;
 | 
			
		||||
PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData = NULL;
 | 
			
		||||
PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer = NULL;
 | 
			
		||||
PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange = NULL;
 | 
			
		||||
PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer = NULL;
 | 
			
		||||
PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange = NULL;
 | 
			
		||||
PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv = NULL;
 | 
			
		||||
PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v = NULL;
 | 
			
		||||
PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv = NULL;
 | 
			
		||||
PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData = NULL;
 | 
			
		||||
PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers = NULL;
 | 
			
		||||
PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer = NULL;
 | 
			
		||||
PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri = NULL;
 | 
			
		||||
PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture = NULL;
 | 
			
		||||
PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer = NULL;
 | 
			
		||||
PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer = NULL;
 | 
			
		||||
PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers = NULL;
 | 
			
		||||
PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer = NULL;
 | 
			
		||||
PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData = NULL;
 | 
			
		||||
PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData = NULL;
 | 
			
		||||
PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv = NULL;
 | 
			
		||||
PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv = NULL;
 | 
			
		||||
PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv = NULL;
 | 
			
		||||
PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi = NULL;
 | 
			
		||||
PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer = NULL;
 | 
			
		||||
PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus = NULL;
 | 
			
		||||
PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv = NULL;
 | 
			
		||||
PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv = NULL;
 | 
			
		||||
PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers = NULL;
 | 
			
		||||
PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage = NULL;
 | 
			
		||||
PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample = NULL;
 | 
			
		||||
PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv = NULL;
 | 
			
		||||
PFNGLCREATETEXTURESPROC glad_glCreateTextures = NULL;
 | 
			
		||||
PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer = NULL;
 | 
			
		||||
PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange = NULL;
 | 
			
		||||
PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D = NULL;
 | 
			
		||||
PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D = NULL;
 | 
			
		||||
PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D = NULL;
 | 
			
		||||
PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample = NULL;
 | 
			
		||||
PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample = NULL;
 | 
			
		||||
PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D = NULL;
 | 
			
		||||
PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D = NULL;
 | 
			
		||||
PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D = NULL;
 | 
			
		||||
PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D = NULL;
 | 
			
		||||
PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D = NULL;
 | 
			
		||||
PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D = NULL;
 | 
			
		||||
PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D = NULL;
 | 
			
		||||
PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D = NULL;
 | 
			
		||||
PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D = NULL;
 | 
			
		||||
PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf = NULL;
 | 
			
		||||
PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv = NULL;
 | 
			
		||||
PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri = NULL;
 | 
			
		||||
PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv = NULL;
 | 
			
		||||
PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv = NULL;
 | 
			
		||||
PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv = NULL;
 | 
			
		||||
PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap = NULL;
 | 
			
		||||
PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit = NULL;
 | 
			
		||||
PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage = NULL;
 | 
			
		||||
PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage = NULL;
 | 
			
		||||
PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv = NULL;
 | 
			
		||||
PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv = NULL;
 | 
			
		||||
PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv = NULL;
 | 
			
		||||
PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv = NULL;
 | 
			
		||||
PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv = NULL;
 | 
			
		||||
PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv = NULL;
 | 
			
		||||
PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays = NULL;
 | 
			
		||||
PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib = NULL;
 | 
			
		||||
PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib = NULL;
 | 
			
		||||
PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer = NULL;
 | 
			
		||||
PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer = NULL;
 | 
			
		||||
PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers = NULL;
 | 
			
		||||
PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding = NULL;
 | 
			
		||||
PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat = NULL;
 | 
			
		||||
PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat = NULL;
 | 
			
		||||
PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat = NULL;
 | 
			
		||||
PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor = NULL;
 | 
			
		||||
PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv = NULL;
 | 
			
		||||
PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv = NULL;
 | 
			
		||||
PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv = NULL;
 | 
			
		||||
PFNGLCREATESAMPLERSPROC glad_glCreateSamplers = NULL;
 | 
			
		||||
PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines = NULL;
 | 
			
		||||
PFNGLCREATEQUERIESPROC glad_glCreateQueries = NULL;
 | 
			
		||||
PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v = NULL;
 | 
			
		||||
PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv = NULL;
 | 
			
		||||
PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v = NULL;
 | 
			
		||||
PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv = NULL;
 | 
			
		||||
PFNGLBUFFERSTORAGEEXTPROC glad_glBufferStorageEXT = NULL;
 | 
			
		||||
static void load_GL_VERSION_1_0(GLADloadproc load) {
 | 
			
		||||
	if(!GLAD_GL_VERSION_1_0) return;
 | 
			
		||||
@@ -1489,9 +1590,114 @@ static void load_GL_VERSION_4_4(GLADloadproc load) {
 | 
			
		||||
	glad_glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)load("glBindImageTextures");
 | 
			
		||||
	glad_glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)load("glBindVertexBuffers");
 | 
			
		||||
}
 | 
			
		||||
static void load_GL_ARB_buffer_storage(GLADloadproc load) {
 | 
			
		||||
	if(!GLAD_GL_ARB_buffer_storage) return;
 | 
			
		||||
	glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage");
 | 
			
		||||
}
 | 
			
		||||
static void load_GL_ARB_direct_state_access(GLADloadproc load) {
 | 
			
		||||
	if(!GLAD_GL_ARB_direct_state_access) return;
 | 
			
		||||
	glad_glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)load("glCreateTransformFeedbacks");
 | 
			
		||||
	glad_glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)load("glTransformFeedbackBufferBase");
 | 
			
		||||
	glad_glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)load("glTransformFeedbackBufferRange");
 | 
			
		||||
	glad_glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)load("glGetTransformFeedbackiv");
 | 
			
		||||
	glad_glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)load("glGetTransformFeedbacki_v");
 | 
			
		||||
	glad_glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)load("glGetTransformFeedbacki64_v");
 | 
			
		||||
	glad_glCreateBuffers = (PFNGLCREATEBUFFERSPROC)load("glCreateBuffers");
 | 
			
		||||
	glad_glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)load("glNamedBufferStorage");
 | 
			
		||||
	glad_glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)load("glNamedBufferData");
 | 
			
		||||
	glad_glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)load("glNamedBufferSubData");
 | 
			
		||||
	glad_glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)load("glCopyNamedBufferSubData");
 | 
			
		||||
	glad_glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)load("glClearNamedBufferData");
 | 
			
		||||
	glad_glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)load("glClearNamedBufferSubData");
 | 
			
		||||
	glad_glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)load("glMapNamedBuffer");
 | 
			
		||||
	glad_glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)load("glMapNamedBufferRange");
 | 
			
		||||
	glad_glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)load("glUnmapNamedBuffer");
 | 
			
		||||
	glad_glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)load("glFlushMappedNamedBufferRange");
 | 
			
		||||
	glad_glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)load("glGetNamedBufferParameteriv");
 | 
			
		||||
	glad_glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)load("glGetNamedBufferParameteri64v");
 | 
			
		||||
	glad_glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)load("glGetNamedBufferPointerv");
 | 
			
		||||
	glad_glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)load("glGetNamedBufferSubData");
 | 
			
		||||
	glad_glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)load("glCreateFramebuffers");
 | 
			
		||||
	glad_glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)load("glNamedFramebufferRenderbuffer");
 | 
			
		||||
	glad_glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)load("glNamedFramebufferParameteri");
 | 
			
		||||
	glad_glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)load("glNamedFramebufferTexture");
 | 
			
		||||
	glad_glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)load("glNamedFramebufferTextureLayer");
 | 
			
		||||
	glad_glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)load("glNamedFramebufferDrawBuffer");
 | 
			
		||||
	glad_glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)load("glNamedFramebufferDrawBuffers");
 | 
			
		||||
	glad_glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)load("glNamedFramebufferReadBuffer");
 | 
			
		||||
	glad_glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)load("glInvalidateNamedFramebufferData");
 | 
			
		||||
	glad_glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)load("glInvalidateNamedFramebufferSubData");
 | 
			
		||||
	glad_glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)load("glClearNamedFramebufferiv");
 | 
			
		||||
	glad_glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)load("glClearNamedFramebufferuiv");
 | 
			
		||||
	glad_glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)load("glClearNamedFramebufferfv");
 | 
			
		||||
	glad_glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)load("glClearNamedFramebufferfi");
 | 
			
		||||
	glad_glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)load("glBlitNamedFramebuffer");
 | 
			
		||||
	glad_glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)load("glCheckNamedFramebufferStatus");
 | 
			
		||||
	glad_glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)load("glGetNamedFramebufferParameteriv");
 | 
			
		||||
	glad_glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetNamedFramebufferAttachmentParameteriv");
 | 
			
		||||
	glad_glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)load("glCreateRenderbuffers");
 | 
			
		||||
	glad_glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)load("glNamedRenderbufferStorage");
 | 
			
		||||
	glad_glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glNamedRenderbufferStorageMultisample");
 | 
			
		||||
	glad_glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)load("glGetNamedRenderbufferParameteriv");
 | 
			
		||||
	glad_glCreateTextures = (PFNGLCREATETEXTURESPROC)load("glCreateTextures");
 | 
			
		||||
	glad_glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)load("glTextureBuffer");
 | 
			
		||||
	glad_glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)load("glTextureBufferRange");
 | 
			
		||||
	glad_glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)load("glTextureStorage1D");
 | 
			
		||||
	glad_glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)load("glTextureStorage2D");
 | 
			
		||||
	glad_glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)load("glTextureStorage3D");
 | 
			
		||||
	glad_glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)load("glTextureStorage2DMultisample");
 | 
			
		||||
	glad_glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)load("glTextureStorage3DMultisample");
 | 
			
		||||
	glad_glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)load("glTextureSubImage1D");
 | 
			
		||||
	glad_glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)load("glTextureSubImage2D");
 | 
			
		||||
	glad_glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)load("glTextureSubImage3D");
 | 
			
		||||
	glad_glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)load("glCompressedTextureSubImage1D");
 | 
			
		||||
	glad_glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)load("glCompressedTextureSubImage2D");
 | 
			
		||||
	glad_glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)load("glCompressedTextureSubImage3D");
 | 
			
		||||
	glad_glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)load("glCopyTextureSubImage1D");
 | 
			
		||||
	glad_glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)load("glCopyTextureSubImage2D");
 | 
			
		||||
	glad_glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)load("glCopyTextureSubImage3D");
 | 
			
		||||
	glad_glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)load("glTextureParameterf");
 | 
			
		||||
	glad_glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)load("glTextureParameterfv");
 | 
			
		||||
	glad_glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)load("glTextureParameteri");
 | 
			
		||||
	glad_glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)load("glTextureParameterIiv");
 | 
			
		||||
	glad_glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)load("glTextureParameterIuiv");
 | 
			
		||||
	glad_glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)load("glTextureParameteriv");
 | 
			
		||||
	glad_glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)load("glGenerateTextureMipmap");
 | 
			
		||||
	glad_glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)load("glBindTextureUnit");
 | 
			
		||||
	glad_glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)load("glGetTextureImage");
 | 
			
		||||
	glad_glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)load("glGetCompressedTextureImage");
 | 
			
		||||
	glad_glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)load("glGetTextureLevelParameterfv");
 | 
			
		||||
	glad_glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)load("glGetTextureLevelParameteriv");
 | 
			
		||||
	glad_glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)load("glGetTextureParameterfv");
 | 
			
		||||
	glad_glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)load("glGetTextureParameterIiv");
 | 
			
		||||
	glad_glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)load("glGetTextureParameterIuiv");
 | 
			
		||||
	glad_glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)load("glGetTextureParameteriv");
 | 
			
		||||
	glad_glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)load("glCreateVertexArrays");
 | 
			
		||||
	glad_glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)load("glDisableVertexArrayAttrib");
 | 
			
		||||
	glad_glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)load("glEnableVertexArrayAttrib");
 | 
			
		||||
	glad_glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)load("glVertexArrayElementBuffer");
 | 
			
		||||
	glad_glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)load("glVertexArrayVertexBuffer");
 | 
			
		||||
	glad_glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)load("glVertexArrayVertexBuffers");
 | 
			
		||||
	glad_glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)load("glVertexArrayAttribBinding");
 | 
			
		||||
	glad_glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)load("glVertexArrayAttribFormat");
 | 
			
		||||
	glad_glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)load("glVertexArrayAttribIFormat");
 | 
			
		||||
	glad_glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)load("glVertexArrayAttribLFormat");
 | 
			
		||||
	glad_glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)load("glVertexArrayBindingDivisor");
 | 
			
		||||
	glad_glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)load("glGetVertexArrayiv");
 | 
			
		||||
	glad_glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)load("glGetVertexArrayIndexediv");
 | 
			
		||||
	glad_glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)load("glGetVertexArrayIndexed64iv");
 | 
			
		||||
	glad_glCreateSamplers = (PFNGLCREATESAMPLERSPROC)load("glCreateSamplers");
 | 
			
		||||
	glad_glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)load("glCreateProgramPipelines");
 | 
			
		||||
	glad_glCreateQueries = (PFNGLCREATEQUERIESPROC)load("glCreateQueries");
 | 
			
		||||
	glad_glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)load("glGetQueryBufferObjecti64v");
 | 
			
		||||
	glad_glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)load("glGetQueryBufferObjectiv");
 | 
			
		||||
	glad_glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)load("glGetQueryBufferObjectui64v");
 | 
			
		||||
	glad_glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)load("glGetQueryBufferObjectuiv");
 | 
			
		||||
}
 | 
			
		||||
static int find_extensionsGL(void) {
 | 
			
		||||
	if (!get_exts()) return 0;
 | 
			
		||||
	(void)&has_ext;
 | 
			
		||||
	GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage");
 | 
			
		||||
	GLAD_GL_ARB_direct_state_access = has_ext("GL_ARB_direct_state_access");
 | 
			
		||||
	free_exts();
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
@@ -1580,6 +1786,8 @@ int gladLoadGLLoader(GLADloadproc load) {
 | 
			
		||||
	load_GL_VERSION_4_4(load);
 | 
			
		||||
 | 
			
		||||
	if (!find_extensionsGL()) return 0;
 | 
			
		||||
	load_GL_ARB_buffer_storage(load);
 | 
			
		||||
	load_GL_ARB_direct_state_access(load);
 | 
			
		||||
	return GLVersion.major != 0 || GLVersion.minor != 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -59,6 +59,60 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
 | 
			
		||||
 | 
			
		||||
#endif // _MSC_VER ndef
 | 
			
		||||
 | 
			
		||||
#define DECLARE_ENUM_FLAG_OPERATORS(type)                                                          \
 | 
			
		||||
    [[nodiscard]] constexpr type operator|(type a, type b) noexcept {                              \
 | 
			
		||||
        using T = std::underlying_type_t<type>;                                                    \
 | 
			
		||||
        return static_cast<type>(static_cast<T>(a) | static_cast<T>(b));                           \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    [[nodiscard]] constexpr type operator&(type a, type b) noexcept {                              \
 | 
			
		||||
        using T = std::underlying_type_t<type>;                                                    \
 | 
			
		||||
        return static_cast<type>(static_cast<T>(a) & static_cast<T>(b));                           \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    [[nodiscard]] constexpr type operator^(type a, type b) noexcept {                              \
 | 
			
		||||
        using T = std::underlying_type_t<type>;                                                    \
 | 
			
		||||
        return static_cast<type>(static_cast<T>(a) ^ static_cast<T>(b));                           \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    [[nodiscard]] constexpr type operator<<(type a, type b) noexcept {                             \
 | 
			
		||||
        using T = std::underlying_type_t<type>;                                                    \
 | 
			
		||||
        return static_cast<type>(static_cast<T>(a) << static_cast<T>(b));                          \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    [[nodiscard]] constexpr type operator>>(type a, type b) noexcept {                             \
 | 
			
		||||
        using T = std::underlying_type_t<type>;                                                    \
 | 
			
		||||
        return static_cast<type>(static_cast<T>(a) >> static_cast<T>(b));                          \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    constexpr type& operator|=(type& a, type b) noexcept {                                         \
 | 
			
		||||
        a = a | b;                                                                                 \
 | 
			
		||||
        return a;                                                                                  \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    constexpr type& operator&=(type& a, type b) noexcept {                                         \
 | 
			
		||||
        a = a & b;                                                                                 \
 | 
			
		||||
        return a;                                                                                  \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    constexpr type& operator^=(type& a, type b) noexcept {                                         \
 | 
			
		||||
        a = a ^ b;                                                                                 \
 | 
			
		||||
        return a;                                                                                  \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    constexpr type& operator<<=(type& a, type b) noexcept {                                        \
 | 
			
		||||
        a = a << b;                                                                                \
 | 
			
		||||
        return a;                                                                                  \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    constexpr type& operator>>=(type& a, type b) noexcept {                                        \
 | 
			
		||||
        a = a >> b;                                                                                \
 | 
			
		||||
        return a;                                                                                  \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    [[nodiscard]] constexpr type operator~(type key) noexcept {                                    \
 | 
			
		||||
        using T = std::underlying_type_t<type>;                                                    \
 | 
			
		||||
        return static_cast<type>(~static_cast<T>(key));                                            \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    [[nodiscard]] constexpr bool True(type key) noexcept {                                         \
 | 
			
		||||
        using T = std::underlying_type_t<type>;                                                    \
 | 
			
		||||
        return static_cast<T>(key) != 0;                                                           \
 | 
			
		||||
    }                                                                                              \
 | 
			
		||||
    [[nodiscard]] constexpr bool False(type key) noexcept {                                        \
 | 
			
		||||
        using T = std::underlying_type_t<type>;                                                    \
 | 
			
		||||
        return static_cast<T>(key) == 0;                                                           \
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
// Generic function to get last error message.
 | 
			
		||||
// Call directly after the command or use the error num.
 | 
			
		||||
// This function might change the error code.
 | 
			
		||||
 
 | 
			
		||||
@@ -41,6 +41,8 @@ add_library(video_core STATIC
 | 
			
		||||
    rasterizer_cache/texture_runtime.h
 | 
			
		||||
    renderer_opengl/frame_dumper_opengl.cpp
 | 
			
		||||
    renderer_opengl/frame_dumper_opengl.h
 | 
			
		||||
    renderer_opengl/gl_driver.cpp
 | 
			
		||||
    renderer_opengl/gl_driver.h
 | 
			
		||||
    renderer_opengl/gl_rasterizer.cpp
 | 
			
		||||
    renderer_opengl/gl_rasterizer.h
 | 
			
		||||
    renderer_opengl/gl_resource_manager.cpp
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,6 @@
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
#include <list>
 | 
			
		||||
#include "common/assert.h"
 | 
			
		||||
#include "core/custom_tex_cache.h"
 | 
			
		||||
#include "video_core/rasterizer_cache/surface_params.h"
 | 
			
		||||
@@ -78,7 +77,7 @@ public:
 | 
			
		||||
 | 
			
		||||
    std::shared_ptr<SurfaceWatcher> CreateWatcher() {
 | 
			
		||||
        auto watcher = std::make_shared<SurfaceWatcher>(weak_from_this());
 | 
			
		||||
        watchers.push_front(watcher);
 | 
			
		||||
        watchers[watcher_count++] = watcher;
 | 
			
		||||
        return watcher;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -98,7 +97,8 @@ public:
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        watchers.clear();
 | 
			
		||||
        watchers = {};
 | 
			
		||||
        watcher_count = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
@@ -111,7 +111,6 @@ public:
 | 
			
		||||
    std::array<u8, 4> fill_data;
 | 
			
		||||
    OGLTexture texture;
 | 
			
		||||
 | 
			
		||||
    // level_watchers[i] watches the (i+1)-th level mipmap source surface
 | 
			
		||||
    std::array<std::shared_ptr<SurfaceWatcher>, 7> level_watchers;
 | 
			
		||||
    u32 max_level = 0;
 | 
			
		||||
 | 
			
		||||
@@ -122,7 +121,8 @@ public:
 | 
			
		||||
private:
 | 
			
		||||
    RasterizerCache& owner;
 | 
			
		||||
    TextureRuntime& runtime;
 | 
			
		||||
    std::list<std::weak_ptr<SurfaceWatcher>> watchers;
 | 
			
		||||
    u32 watcher_count = 0;
 | 
			
		||||
    std::array<std::weak_ptr<SurfaceWatcher>, 8> watchers;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct CachedTextureCube {
 | 
			
		||||
 
 | 
			
		||||
@@ -203,8 +203,8 @@ static Surface FindMatch(const SurfaceCache& surface_cache, const SurfaceParams&
 | 
			
		||||
    return match_surface;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
RasterizerCache::RasterizerCache(VideoCore::RasterizerAccelerated& rasterizer)
 | 
			
		||||
    : rasterizer(rasterizer) {
 | 
			
		||||
RasterizerCache::RasterizerCache(VideoCore::RasterizerAccelerated& rasterizer, Driver& driver)
 | 
			
		||||
    : rasterizer(rasterizer), runtime(driver) {
 | 
			
		||||
    resolution_scale_factor = VideoCore::GetResolutionScaleFactor();
 | 
			
		||||
    texture_filterer = std::make_unique<TextureFilterer>(
 | 
			
		||||
        Settings::values.texture_filter_name.GetValue(), resolution_scale_factor);
 | 
			
		||||
 
 | 
			
		||||
@@ -38,13 +38,14 @@ enum class ScaleMatch {
 | 
			
		||||
    Ignore   // Accept every scaled res
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class Driver;
 | 
			
		||||
class TextureDownloaderES;
 | 
			
		||||
class TextureFilterer;
 | 
			
		||||
class FormatReinterpreterOpenGL;
 | 
			
		||||
 | 
			
		||||
class RasterizerCache : NonCopyable {
 | 
			
		||||
public:
 | 
			
		||||
    RasterizerCache(VideoCore::RasterizerAccelerated& rasterizer);
 | 
			
		||||
    RasterizerCache(VideoCore::RasterizerAccelerated& rasterizer, Driver& driver);
 | 
			
		||||
    ~RasterizerCache();
 | 
			
		||||
 | 
			
		||||
    /// Blit one surface's texture to another
 | 
			
		||||
 
 | 
			
		||||
@@ -5,8 +5,8 @@
 | 
			
		||||
#include "common/scope_exit.h"
 | 
			
		||||
#include "video_core/rasterizer_cache/utils.h"
 | 
			
		||||
#include "video_core/rasterizer_cache/texture_runtime.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_driver.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_state.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_vars.h"
 | 
			
		||||
 | 
			
		||||
namespace OpenGL {
 | 
			
		||||
 | 
			
		||||
@@ -27,7 +27,7 @@ GLbitfield MakeBufferMask(SurfaceType type) {
 | 
			
		||||
    return GL_COLOR_BUFFER_BIT;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TextureRuntime::TextureRuntime() {
 | 
			
		||||
TextureRuntime::TextureRuntime(Driver& driver) : driver(driver) {
 | 
			
		||||
    read_fbo.Create();
 | 
			
		||||
    draw_fbo.Create();
 | 
			
		||||
}
 | 
			
		||||
@@ -225,18 +225,20 @@ const StagingBuffer& TextureRuntime::FindStaging(u32 size, bool upload) {
 | 
			
		||||
 | 
			
		||||
    // Allocate a new buffer and map the data to the host
 | 
			
		||||
    void* data = nullptr;
 | 
			
		||||
    if (GLES) {
 | 
			
		||||
    if (driver.IsOpenGLES() && driver.HasExtBufferStorage()) {
 | 
			
		||||
        const GLbitfield storage = upload ? GL_MAP_WRITE_BIT : GL_MAP_READ_BIT | GL_CLIENT_STORAGE_BIT_EXT;
 | 
			
		||||
        glBufferStorageEXT(GL_PIXEL_UNPACK_BUFFER, size, nullptr, storage | GL_MAP_PERSISTENT_BIT_EXT |
 | 
			
		||||
                                                                         GL_MAP_COHERENT_BIT_EXT);
 | 
			
		||||
        data = glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, size, access | GL_MAP_PERSISTENT_BIT_EXT |
 | 
			
		||||
                                                                                GL_MAP_COHERENT_BIT_EXT);
 | 
			
		||||
    } else {
 | 
			
		||||
    } else if (driver.HasArbBufferStorage()) {
 | 
			
		||||
        const GLbitfield storage = upload ? GL_MAP_WRITE_BIT : GL_MAP_READ_BIT | GL_CLIENT_STORAGE_BIT;
 | 
			
		||||
        glBufferStorage(GL_PIXEL_UNPACK_BUFFER, size, nullptr, storage | GL_MAP_PERSISTENT_BIT |
 | 
			
		||||
                                                                         GL_MAP_COHERENT_BIT);
 | 
			
		||||
        data = glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, size, access | GL_MAP_PERSISTENT_BIT |
 | 
			
		||||
                                                                          GL_MAP_COHERENT_BIT);
 | 
			
		||||
    } else {
 | 
			
		||||
        UNIMPLEMENTED();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Insert it to the cache and return the memory
 | 
			
		||||
 
 | 
			
		||||
@@ -22,13 +22,15 @@ struct StagingBuffer {
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class Driver;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Provides texture manipulation functions to the rasterizer cache
 | 
			
		||||
 * Separating this into a class makes it easier to abstract graphics API code
 | 
			
		||||
 */
 | 
			
		||||
class TextureRuntime {
 | 
			
		||||
public:
 | 
			
		||||
    TextureRuntime();
 | 
			
		||||
    TextureRuntime(Driver& driver);
 | 
			
		||||
    ~TextureRuntime() = default;
 | 
			
		||||
 | 
			
		||||
    /// Copies the GPU pixel data to the provided pixels buffer
 | 
			
		||||
@@ -51,6 +53,7 @@ public:
 | 
			
		||||
    const StagingBuffer& FindStaging(u32 size, bool upload);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    Driver& driver;
 | 
			
		||||
    OGLFramebuffer read_fbo, draw_fbo;
 | 
			
		||||
    std::set<StagingBuffer> upload_buffers;
 | 
			
		||||
    std::set<StagingBuffer> download_buffers;
 | 
			
		||||
 
 | 
			
		||||
@@ -5,9 +5,6 @@
 | 
			
		||||
#include <memory>
 | 
			
		||||
#include "core/frontend/emu_window.h"
 | 
			
		||||
#include "video_core/renderer_base.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_rasterizer.h"
 | 
			
		||||
#include "video_core/swrasterizer/swrasterizer.h"
 | 
			
		||||
#include "video_core/video_core.h"
 | 
			
		||||
 | 
			
		||||
RendererBase::RendererBase(Frontend::EmuWindow& window, Frontend::EmuWindow* secondary_window_)
 | 
			
		||||
    : render_window{window}, secondary_window{secondary_window_} {}
 | 
			
		||||
@@ -25,19 +22,6 @@ void RendererBase::UpdateCurrentFramebufferLayout(bool is_portrait_mode) {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void RendererBase::RefreshRasterizerSetting() {
 | 
			
		||||
    bool hw_renderer_enabled = VideoCore::g_hw_renderer_enabled;
 | 
			
		||||
    if (rasterizer == nullptr || opengl_rasterizer_active != hw_renderer_enabled) {
 | 
			
		||||
        opengl_rasterizer_active = hw_renderer_enabled;
 | 
			
		||||
 | 
			
		||||
        if (hw_renderer_enabled) {
 | 
			
		||||
            rasterizer = std::make_unique<OpenGL::RasterizerOpenGL>(render_window);
 | 
			
		||||
        } else {
 | 
			
		||||
            rasterizer = std::make_unique<VideoCore::SWRasterizer>();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void RendererBase::Sync() {
 | 
			
		||||
    rasterizer->SyncEntireState();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,6 @@ public:
 | 
			
		||||
        return render_window;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void RefreshRasterizerSetting();
 | 
			
		||||
    void Sync();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
@@ -75,7 +74,4 @@ protected:
 | 
			
		||||
    std::unique_ptr<VideoCore::RasterizerInterface> rasterizer;
 | 
			
		||||
    f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer
 | 
			
		||||
    int m_current_frame = 0;  ///< Current frame, should be set by the renderer
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    bool opengl_rasterizer_active = false;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										152
									
								
								src/video_core/renderer_opengl/gl_driver.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										152
									
								
								src/video_core/renderer_opengl/gl_driver.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,152 @@
 | 
			
		||||
// Copyright 2022 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include <glad/glad.h>
 | 
			
		||||
#include "common/assert.h"
 | 
			
		||||
#include "core/core.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_driver.h"
 | 
			
		||||
 | 
			
		||||
namespace OpenGL {
 | 
			
		||||
 | 
			
		||||
DECLARE_ENUM_FLAG_OPERATORS(DriverBug);
 | 
			
		||||
 | 
			
		||||
inline std::string_view GetSource(GLenum source) {
 | 
			
		||||
#define RET(s)                                                                                     \
 | 
			
		||||
    case GL_DEBUG_SOURCE_##s:                                                                      \
 | 
			
		||||
        return #s
 | 
			
		||||
    switch (source) {
 | 
			
		||||
        RET(API);
 | 
			
		||||
        RET(WINDOW_SYSTEM);
 | 
			
		||||
        RET(SHADER_COMPILER);
 | 
			
		||||
        RET(THIRD_PARTY);
 | 
			
		||||
        RET(APPLICATION);
 | 
			
		||||
        RET(OTHER);
 | 
			
		||||
    default:
 | 
			
		||||
        UNREACHABLE();
 | 
			
		||||
    }
 | 
			
		||||
#undef RET
 | 
			
		||||
 | 
			
		||||
    return std::string_view{};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
inline std::string_view GetType(GLenum type) {
 | 
			
		||||
#define RET(t)                                                                                     \
 | 
			
		||||
    case GL_DEBUG_TYPE_##t:                                                                        \
 | 
			
		||||
        return #t
 | 
			
		||||
    switch (type) {
 | 
			
		||||
        RET(ERROR);
 | 
			
		||||
        RET(DEPRECATED_BEHAVIOR);
 | 
			
		||||
        RET(UNDEFINED_BEHAVIOR);
 | 
			
		||||
        RET(PORTABILITY);
 | 
			
		||||
        RET(PERFORMANCE);
 | 
			
		||||
        RET(OTHER);
 | 
			
		||||
        RET(MARKER);
 | 
			
		||||
    default:
 | 
			
		||||
        UNREACHABLE();
 | 
			
		||||
    }
 | 
			
		||||
#undef RET
 | 
			
		||||
 | 
			
		||||
    return std::string_view{};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum severity,
 | 
			
		||||
                                  GLsizei length, const GLchar* message, const void* user_param) {
 | 
			
		||||
    Log::Level level = Log::Level::Info;
 | 
			
		||||
    switch (severity) {
 | 
			
		||||
    case GL_DEBUG_SEVERITY_HIGH:
 | 
			
		||||
        level = Log::Level::Critical;
 | 
			
		||||
        break;
 | 
			
		||||
    case GL_DEBUG_SEVERITY_MEDIUM:
 | 
			
		||||
        level = Log::Level::Warning;
 | 
			
		||||
        break;
 | 
			
		||||
    case GL_DEBUG_SEVERITY_NOTIFICATION:
 | 
			
		||||
    case GL_DEBUG_SEVERITY_LOW:
 | 
			
		||||
        level = Log::Level::Debug;
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
    LOG_GENERIC(Log::Class::Render_OpenGL, level, "{} {} {}: {}", GetSource(source), GetType(type),
 | 
			
		||||
                id, message);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Driver::Driver(bool gles) : is_gles{gles} {
 | 
			
		||||
#ifndef ANDROID
 | 
			
		||||
    if (!gladLoadGL()) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Qualcomm has some spammy info messages that are marked as errors but not important
 | 
			
		||||
     * https://developer.qualcomm.com/comment/11845
 | 
			
		||||
     */
 | 
			
		||||
    glEnable(GL_DEBUG_OUTPUT);
 | 
			
		||||
    glDebugMessageCallback(DebugHandler, nullptr);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    ReportDriverInfo();
 | 
			
		||||
    DeduceVendor();
 | 
			
		||||
    CheckExtensionSupport();
 | 
			
		||||
    FindBugs();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool Driver::HasBug(DriverBug bug) const {
 | 
			
		||||
    return True(bugs & bug);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Driver::ReportDriverInfo() {
 | 
			
		||||
    // Report the context version and the vendor string
 | 
			
		||||
    gl_version = std::string_view{reinterpret_cast<const char*>(glGetString(GL_VERSION))};
 | 
			
		||||
    gpu_vendor = std::string_view{reinterpret_cast<const char*>(glGetString(GL_VENDOR))};
 | 
			
		||||
    gpu_model = std::string_view{reinterpret_cast<const char*>(glGetString(GL_RENDERER))};
 | 
			
		||||
 | 
			
		||||
    LOG_INFO(Render_OpenGL, "GL_VERSION: {}", gl_version);
 | 
			
		||||
    LOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor);
 | 
			
		||||
    LOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model);
 | 
			
		||||
 | 
			
		||||
    // Add the information to the telemetry system
 | 
			
		||||
    auto& telemetry_session = Core::System::GetInstance().TelemetrySession();
 | 
			
		||||
    constexpr auto user_system = Common::Telemetry::FieldType::UserSystem;
 | 
			
		||||
    telemetry_session.AddField(user_system, "GPU_Vendor", std::string{gpu_vendor});
 | 
			
		||||
    telemetry_session.AddField(user_system, "GPU_Model", std::string{gpu_model});
 | 
			
		||||
    telemetry_session.AddField(user_system, "GPU_OpenGL_Version", std::string{gl_version});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Driver::DeduceVendor() {
 | 
			
		||||
    if (gpu_vendor.contains("NVIDIA")) {
 | 
			
		||||
        vendor = Vendor::Nvidia;
 | 
			
		||||
    } else if (gpu_vendor.contains("ATI") ||
 | 
			
		||||
               gpu_vendor.contains("Advanced Micro Devices")) {
 | 
			
		||||
        vendor = Vendor::AMD;
 | 
			
		||||
    } else if (gpu_vendor.contains("Intel")) {
 | 
			
		||||
        vendor = Vendor::Intel;
 | 
			
		||||
    } else if (gpu_vendor.contains("GDI Generic")) {
 | 
			
		||||
        vendor = Vendor::Generic;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Driver::CheckExtensionSupport() {
 | 
			
		||||
    ext_buffer_storage = GLAD_GL_EXT_buffer_storage;
 | 
			
		||||
    arb_buffer_storage = GLAD_GL_ARB_buffer_storage;
 | 
			
		||||
    ext_clip_cull_distance = GLAD_GL_EXT_clip_cull_distance;
 | 
			
		||||
    arb_direct_state_access = GLAD_GL_ARB_direct_state_access;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Driver::FindBugs() {
 | 
			
		||||
#ifdef __unix__
 | 
			
		||||
    const bool is_linux = true;
 | 
			
		||||
#else
 | 
			
		||||
    const bool is_linux = false;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // TODO: Check if these have been fixed in the newer driver
 | 
			
		||||
    if (vendor == Vendor::AMD) {
 | 
			
		||||
        bugs |= DriverBug::ShaderStageChangeFreeze | DriverBug::VertexArrayOutOfBound;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (vendor == Vendor::AMD || (vendor == Vendor::Intel && !is_linux)) {
 | 
			
		||||
        bugs |= DriverBug::BrokenTextureView;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace OpenGL
 | 
			
		||||
							
								
								
									
										86
									
								
								src/video_core/renderer_opengl/gl_driver.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								src/video_core/renderer_opengl/gl_driver.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,86 @@
 | 
			
		||||
// Copyright 2022 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
#include <string_view>
 | 
			
		||||
 | 
			
		||||
namespace OpenGL {
 | 
			
		||||
 | 
			
		||||
enum class Vendor {
 | 
			
		||||
    Unknown = 0,
 | 
			
		||||
    AMD = 1,
 | 
			
		||||
    Nvidia = 2,
 | 
			
		||||
    Intel = 3,
 | 
			
		||||
    Generic = 4
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum class DriverBug {
 | 
			
		||||
    // AMD drivers sometimes freeze when one shader stage is changed but not the others.
 | 
			
		||||
    ShaderStageChangeFreeze = 1 << 0,
 | 
			
		||||
    // On AMD drivers there is a strange crash in indexed drawing. The crash happens when the buffer
 | 
			
		||||
    // read position is near the end and is an out-of-bound access to the vertex buffer. This is
 | 
			
		||||
    // probably a bug in the driver and is related to the usage of vec3<byte> attributes in the
 | 
			
		||||
    // vertex array. Doubling the allocation size for the vertex buffer seems to avoid the crash.
 | 
			
		||||
    VertexArrayOutOfBound = 1 << 1,
 | 
			
		||||
    // On AMD and Intel drivers on Windows glTextureView produces incorrect results
 | 
			
		||||
    BrokenTextureView = 1 << 2,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Utility class that loads the OpenGL function pointers and reports
 | 
			
		||||
 * information about the graphics device and driver used
 | 
			
		||||
 */
 | 
			
		||||
class Driver {
 | 
			
		||||
public:
 | 
			
		||||
    Driver(bool gles);
 | 
			
		||||
 | 
			
		||||
    /// Returns true of the driver has a particular bug stated in the DriverBug enum
 | 
			
		||||
    bool HasBug(DriverBug bug) const;
 | 
			
		||||
 | 
			
		||||
    Vendor GetVendor() const {
 | 
			
		||||
        return vendor;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool IsOpenGLES() const {
 | 
			
		||||
        return is_gles;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool HasArbBufferStorage() const {
 | 
			
		||||
        return arb_buffer_storage;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool HasExtBufferStorage() const {
 | 
			
		||||
        return ext_buffer_storage;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool HasExtClipCullDistance() const {
 | 
			
		||||
        return ext_clip_cull_distance;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool HasArbDirectStateAccess() const {
 | 
			
		||||
        return arb_direct_state_access;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    void ReportDriverInfo();
 | 
			
		||||
    void DeduceVendor();
 | 
			
		||||
    void CheckExtensionSupport();
 | 
			
		||||
    void FindBugs();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    Vendor vendor = Vendor::Unknown;
 | 
			
		||||
    DriverBug bugs{};
 | 
			
		||||
 | 
			
		||||
    bool is_gles{};
 | 
			
		||||
    bool ext_buffer_storage{};
 | 
			
		||||
    bool arb_buffer_storage{};
 | 
			
		||||
    bool ext_clip_cull_distance{};
 | 
			
		||||
    bool arb_direct_state_access{};
 | 
			
		||||
 | 
			
		||||
    std::string_view gl_version{};
 | 
			
		||||
    std::string_view gpu_vendor{};
 | 
			
		||||
    std::string_view gpu_model{};
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace OpenGL
 | 
			
		||||
@@ -10,6 +10,7 @@
 | 
			
		||||
#include "video_core/pica_state.h"
 | 
			
		||||
#include "video_core/regs_framebuffer.h"
 | 
			
		||||
#include "video_core/regs_rasterizer.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_driver.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_rasterizer.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_shader_gen.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_vars.h"
 | 
			
		||||
@@ -37,8 +38,8 @@ static bool IsVendorIntel() {
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
RasterizerOpenGL::RasterizerOpenGL(Frontend::EmuWindow& emu_window)
 | 
			
		||||
    : is_amd(IsVendorAmd()), vertex_buffer(GL_ARRAY_BUFFER, VERTEX_BUFFER_SIZE, is_amd),
 | 
			
		||||
RasterizerOpenGL::RasterizerOpenGL(Frontend::EmuWindow& emu_window, Driver& driver)
 | 
			
		||||
    : driver(driver), is_amd(IsVendorAmd()), vertex_buffer(GL_ARRAY_BUFFER, VERTEX_BUFFER_SIZE, is_amd),
 | 
			
		||||
      uniform_buffer(GL_UNIFORM_BUFFER, UNIFORM_BUFFER_SIZE, false),
 | 
			
		||||
      index_buffer(GL_ELEMENT_ARRAY_BUFFER, INDEX_BUFFER_SIZE, false),
 | 
			
		||||
      texture_buffer(GL_TEXTURE_BUFFER, TEXTURE_BUFFER_SIZE, false),
 | 
			
		||||
 
 | 
			
		||||
@@ -20,11 +20,12 @@ class EmuWindow;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
namespace OpenGL {
 | 
			
		||||
class Driver;
 | 
			
		||||
class ShaderProgramManager;
 | 
			
		||||
 | 
			
		||||
class RasterizerOpenGL : public VideoCore::RasterizerAccelerated {
 | 
			
		||||
public:
 | 
			
		||||
    explicit RasterizerOpenGL(Frontend::EmuWindow& emu_window);
 | 
			
		||||
    explicit RasterizerOpenGL(Frontend::EmuWindow& emu_window, Driver& driver);
 | 
			
		||||
    ~RasterizerOpenGL() override;
 | 
			
		||||
 | 
			
		||||
    void LoadDiskResources(const std::atomic_bool& stop_loading,
 | 
			
		||||
@@ -247,8 +248,8 @@ private:
 | 
			
		||||
    /// Setup geometry shader for AccelerateDrawBatch
 | 
			
		||||
    bool SetupGeometryShader();
 | 
			
		||||
 | 
			
		||||
    bool is_amd;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    Driver& driver;
 | 
			
		||||
    OpenGLState state;
 | 
			
		||||
    GLuint default_texture;
 | 
			
		||||
 | 
			
		||||
@@ -256,6 +257,7 @@ private:
 | 
			
		||||
 | 
			
		||||
    std::vector<HardwareVertex> vertex_batch;
 | 
			
		||||
 | 
			
		||||
    bool is_amd;
 | 
			
		||||
    bool shader_dirty = true;
 | 
			
		||||
 | 
			
		||||
    struct {
 | 
			
		||||
 
 | 
			
		||||
@@ -16,6 +16,7 @@
 | 
			
		||||
#include "core/tracer/recorder.h"
 | 
			
		||||
#include "video_core/debug_utils/debug_utils.h"
 | 
			
		||||
#include "video_core/rasterizer_interface.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_rasterizer.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_shader_util.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_state.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_vars.h"
 | 
			
		||||
@@ -353,7 +354,7 @@ static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, cons
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
RendererOpenGL::RendererOpenGL(Frontend::EmuWindow& window, Frontend::EmuWindow* secondary_window)
 | 
			
		||||
    : RendererBase{window, secondary_window},
 | 
			
		||||
    : RendererBase{window, secondary_window}, driver{Settings::values.graphics_api == Settings::GraphicsAPI::OpenGLES},
 | 
			
		||||
      frame_dumper(Core::System::GetInstance().VideoDumper(), window) {
 | 
			
		||||
    window.mailbox = std::make_unique<OGLTextureMailbox>();
 | 
			
		||||
    if (secondary_window) {
 | 
			
		||||
@@ -364,6 +365,27 @@ RendererOpenGL::RendererOpenGL(Frontend::EmuWindow& window, Frontend::EmuWindow*
 | 
			
		||||
 | 
			
		||||
RendererOpenGL::~RendererOpenGL() = default;
 | 
			
		||||
 | 
			
		||||
/// Initialize the renderer
 | 
			
		||||
VideoCore::ResultStatus RendererOpenGL::Init() {
 | 
			
		||||
    const Vendor vendor = driver.GetVendor();
 | 
			
		||||
    switch (vendor) {
 | 
			
		||||
    case Vendor::Generic:
 | 
			
		||||
        return VideoCore::ResultStatus::ErrorGenericDrivers;
 | 
			
		||||
    case Vendor::Unknown:
 | 
			
		||||
        return VideoCore::ResultStatus::ErrorRendererInit;
 | 
			
		||||
    default:
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    InitOpenGLObjects();
 | 
			
		||||
    rasterizer = std::make_unique<RasterizerOpenGL>(render_window, driver);
 | 
			
		||||
 | 
			
		||||
    return VideoCore::ResultStatus::Success;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Shutdown the renderer
 | 
			
		||||
void RendererOpenGL::ShutDown() {}
 | 
			
		||||
 | 
			
		||||
MICROPROFILE_DEFINE(OpenGL_RenderFrame, "OpenGL", "Render Frame", MP_RGB(128, 128, 64));
 | 
			
		||||
MICROPROFILE_DEFINE(OpenGL_WaitPresent, "OpenGL", "Wait For Present", MP_RGB(128, 128, 128));
 | 
			
		||||
 | 
			
		||||
@@ -398,16 +420,15 @@ void RendererOpenGL::SwapBuffers() {
 | 
			
		||||
 | 
			
		||||
    m_current_frame++;
 | 
			
		||||
 | 
			
		||||
    Core::System::GetInstance().perf_stats->EndSystemFrame();
 | 
			
		||||
    Core::System& system = Core::System::GetInstance();
 | 
			
		||||
    system.perf_stats->EndSystemFrame();
 | 
			
		||||
 | 
			
		||||
    render_window.PollEvents();
 | 
			
		||||
 | 
			
		||||
    Core::System::GetInstance().frame_limiter.DoFrameLimiting(
 | 
			
		||||
        Core::System::GetInstance().CoreTiming().GetGlobalTimeUs());
 | 
			
		||||
    Core::System::GetInstance().perf_stats->BeginSystemFrame();
 | 
			
		||||
    system.frame_limiter.DoFrameLimiting(system.CoreTiming().GetGlobalTimeUs());
 | 
			
		||||
    system.perf_stats->BeginSystemFrame();
 | 
			
		||||
 | 
			
		||||
    prev_state.Apply();
 | 
			
		||||
    RefreshRasterizerSetting();
 | 
			
		||||
 | 
			
		||||
    if (Pica::g_debug_context && Pica::g_debug_context->recorder) {
 | 
			
		||||
        Pica::g_debug_context->recorder->FrameFinished();
 | 
			
		||||
@@ -1193,111 +1214,4 @@ void RendererOpenGL::CleanupVideoDumping() {
 | 
			
		||||
    mailbox->free_cv.notify_one();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const char* GetSource(GLenum source) {
 | 
			
		||||
#define RET(s)                                                                                     \
 | 
			
		||||
    case GL_DEBUG_SOURCE_##s:                                                                      \
 | 
			
		||||
        return #s
 | 
			
		||||
    switch (source) {
 | 
			
		||||
        RET(API);
 | 
			
		||||
        RET(WINDOW_SYSTEM);
 | 
			
		||||
        RET(SHADER_COMPILER);
 | 
			
		||||
        RET(THIRD_PARTY);
 | 
			
		||||
        RET(APPLICATION);
 | 
			
		||||
        RET(OTHER);
 | 
			
		||||
    default:
 | 
			
		||||
        UNREACHABLE();
 | 
			
		||||
    }
 | 
			
		||||
#undef RET
 | 
			
		||||
 | 
			
		||||
    return "";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const char* GetType(GLenum type) {
 | 
			
		||||
#define RET(t)                                                                                     \
 | 
			
		||||
    case GL_DEBUG_TYPE_##t:                                                                        \
 | 
			
		||||
        return #t
 | 
			
		||||
    switch (type) {
 | 
			
		||||
        RET(ERROR);
 | 
			
		||||
        RET(DEPRECATED_BEHAVIOR);
 | 
			
		||||
        RET(UNDEFINED_BEHAVIOR);
 | 
			
		||||
        RET(PORTABILITY);
 | 
			
		||||
        RET(PERFORMANCE);
 | 
			
		||||
        RET(OTHER);
 | 
			
		||||
        RET(MARKER);
 | 
			
		||||
    default:
 | 
			
		||||
        UNREACHABLE();
 | 
			
		||||
    }
 | 
			
		||||
#undef RET
 | 
			
		||||
 | 
			
		||||
    return "";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum severity,
 | 
			
		||||
                                  GLsizei length, const GLchar* message, const void* user_param) {
 | 
			
		||||
    Log::Level level;
 | 
			
		||||
    switch (severity) {
 | 
			
		||||
    case GL_DEBUG_SEVERITY_HIGH:
 | 
			
		||||
        level = Log::Level::Critical;
 | 
			
		||||
        break;
 | 
			
		||||
    case GL_DEBUG_SEVERITY_MEDIUM:
 | 
			
		||||
        level = Log::Level::Warning;
 | 
			
		||||
        break;
 | 
			
		||||
    case GL_DEBUG_SEVERITY_NOTIFICATION:
 | 
			
		||||
    case GL_DEBUG_SEVERITY_LOW:
 | 
			
		||||
        level = Log::Level::Debug;
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
    LOG_GENERIC(Log::Class::Render_OpenGL, level, "{} {} {}: {}", GetSource(source), GetType(type),
 | 
			
		||||
                id, message);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Initialize the renderer
 | 
			
		||||
VideoCore::ResultStatus RendererOpenGL::Init() {
 | 
			
		||||
#ifndef ANDROID
 | 
			
		||||
    if (!gladLoadGL()) {
 | 
			
		||||
        return VideoCore::ResultStatus::ErrorRendererInit;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Qualcomm has some spammy info messages that are marked as errors but not important
 | 
			
		||||
    // https://developer.qualcomm.com/comment/11845
 | 
			
		||||
    glEnable(GL_DEBUG_OUTPUT);
 | 
			
		||||
    glDebugMessageCallback(DebugHandler, nullptr);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    const std::string_view gl_version{reinterpret_cast<char const*>(glGetString(GL_VERSION))};
 | 
			
		||||
    const std::string_view gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))};
 | 
			
		||||
    const std::string_view gpu_model{reinterpret_cast<char const*>(glGetString(GL_RENDERER))};
 | 
			
		||||
 | 
			
		||||
    LOG_INFO(Render_OpenGL, "GL_VERSION: {}", gl_version);
 | 
			
		||||
    LOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor);
 | 
			
		||||
    LOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model);
 | 
			
		||||
 | 
			
		||||
    auto& telemetry_session = Core::System::GetInstance().TelemetrySession();
 | 
			
		||||
    constexpr auto user_system = Common::Telemetry::FieldType::UserSystem;
 | 
			
		||||
    telemetry_session.AddField(user_system, "GPU_Vendor", std::string{gpu_vendor});
 | 
			
		||||
    telemetry_session.AddField(user_system, "GPU_Model", std::string{gpu_model});
 | 
			
		||||
    telemetry_session.AddField(user_system, "GPU_OpenGL_Version", std::string{gl_version});
 | 
			
		||||
 | 
			
		||||
    if (gpu_vendor == "GDI Generic") {
 | 
			
		||||
        return VideoCore::ResultStatus::ErrorGenericDrivers;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!(GLAD_GL_VERSION_4_4 || GLAD_GL_ES_VERSION_3_2)) {
 | 
			
		||||
        return VideoCore::ResultStatus::ErrorRendererInit;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // We require glBufferStorage(EXT)
 | 
			
		||||
    if (GLES && !GLAD_GL_EXT_buffer_storage) {
 | 
			
		||||
        return VideoCore::ResultStatus::ErrorRendererInit;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    InitOpenGLObjects();
 | 
			
		||||
    RefreshRasterizerSetting();
 | 
			
		||||
 | 
			
		||||
    return VideoCore::ResultStatus::Success;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Shutdown the renderer
 | 
			
		||||
void RendererOpenGL::ShutDown() {}
 | 
			
		||||
 | 
			
		||||
} // namespace OpenGL
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@
 | 
			
		||||
#include <array>
 | 
			
		||||
#include "core/hw/gpu.h"
 | 
			
		||||
#include "video_core/renderer_base.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_driver.h"
 | 
			
		||||
#include "video_core/renderer_opengl/frame_dumper_opengl.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_resource_manager.h"
 | 
			
		||||
#include "video_core/renderer_opengl/gl_state.h"
 | 
			
		||||
@@ -104,6 +105,8 @@ private:
 | 
			
		||||
    // Fills active OpenGL texture with the given RGB color.
 | 
			
		||||
    void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, const TextureInfo& texture);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    Driver driver;
 | 
			
		||||
    OpenGLState state;
 | 
			
		||||
 | 
			
		||||
    // OpenGL object IDs
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user