mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Fixed GL_ARB_instanced_arrays on MESA.
This commit is contained in:
parent
688f16024c
commit
8f155985b6
3 changed files with 18 additions and 6 deletions
|
@ -160,7 +160,11 @@ GL_IMPORT(true, PFNGLGENVERTEXARRAYSOESPROC, glGenVertexArraysOES);
|
|||
|
||||
#endif // BGFX_CONFIG_RENDERER_
|
||||
|
||||
#if !BGFX_CONFIG_RENDERER_OPENGLES3
|
||||
#if BGFX_CONFIG_RENDERER_OPENGL
|
||||
GL_IMPORT(true, PFNGLVERTEXATTRIBDIVISORBGFXPROC, glVertexAttribDivisorARB);
|
||||
GL_IMPORT(true, PFNGLDRAWARRAYSINSTANCEDBGFXPROC, glDrawArraysInstancedARB);
|
||||
GL_IMPORT(true, PFNGLDRAWELEMENTSINSTANCEDBGFXPROC, glDrawElementsInstancedARB);
|
||||
#elif BGFX_CONFIG_RENDERER_OPENGLES2
|
||||
GL_IMPORT(true, PFNGLVERTEXATTRIBDIVISORBGFXPROC, glVertexAttribDivisor);
|
||||
GL_IMPORT(true, PFNGLDRAWARRAYSINSTANCEDBGFXPROC, glDrawArraysInstanced);
|
||||
GL_IMPORT(true, PFNGLDRAWELEMENTSINSTANCEDBGFXPROC, glDrawElementsInstanced);
|
||||
|
|
|
@ -540,11 +540,7 @@ namespace bgfx
|
|||
{ GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, 32, true },
|
||||
{ GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, 32, true },
|
||||
{ GL_RGBA16, GL_RGBA, GL_UNSIGNED_BYTE, 64, true },
|
||||
#if BGFX_CONFIG_RENDERER_OPENGL
|
||||
{ GL_RGBA16, GL_RGBA, GL_HALF_FLOAT, 64, true },
|
||||
#else
|
||||
{ GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, 64, true },
|
||||
#endif // BGFX_CONFIG_RENDERER_OPENGL
|
||||
{ GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, 64, true },
|
||||
{ GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 16, true },
|
||||
{ GL_RGBA4, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 16, true },
|
||||
{ GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 16, true },
|
||||
|
|
|
@ -54,6 +54,9 @@
|
|||
# define GL_VERSION_4_1
|
||||
# define GL_VERSION_4_2
|
||||
# include <gl/glext.h>
|
||||
# define glVertexAttribDivisor glVertexAttribDivisorARB
|
||||
# define glDrawArraysInstanced glDrawArraysInstancedARB
|
||||
# define glDrawElementsInstanced glDrawElementsInstancedARB
|
||||
|
||||
// http://developer.download.nvidia.com/opengl/specs/GL_NVX_gpu_memory_info.txt
|
||||
# ifndef GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
|
||||
|
@ -111,6 +114,14 @@
|
|||
# define GL_BGRA_EXT 0x80E1
|
||||
# endif // GL_BGRA_EXT
|
||||
|
||||
# ifndef GL_RGBA16
|
||||
# define GL_RGBA16 0x805B
|
||||
# endif // GL_RGBA16
|
||||
|
||||
# ifndef GL_RGBA16F
|
||||
# define GL_RGBA16F 0x881A
|
||||
# endif // GL_RGBA16F
|
||||
|
||||
# ifndef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
|
||||
# define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
# endif // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
|
||||
|
@ -187,6 +198,7 @@ typedef void (*PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)(GLuint shader, GLsizei b
|
|||
|
||||
namespace bgfx
|
||||
{
|
||||
// Both GL_ARB_instanced_arrays and GL_ANGLE_instanced_arrays use the same function signature.
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORBGFXPROC)(GLuint _index, GLuint _divisor);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDBGFXPROC)(GLenum _mode, GLint _first, GLsizei _count, GLsizei _primcount);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBGFXPROC)(GLenum _mode, GLsizei _count, GLenum _type, const GLvoid* _indices, GLsizei _primcount);
|
||||
|
|
Loading…
Reference in a new issue