REVIEWED: RPI instancing checks #1679
This commit is contained in:
parent
b5aaf33058
commit
98a2e16d4d
1 changed files with 17 additions and 1 deletions
18
src/rlgl.h
18
src/rlgl.h
|
@ -892,11 +892,15 @@ static PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays = NULL;
|
|||
static PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray = NULL;
|
||||
static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays = NULL;
|
||||
|
||||
// It seems OpenGL ES 2.0 instancing entry points are not defined
|
||||
// in Raspberry Pi provided headers (despite being defined in official Khronos GLES2 headers)
|
||||
#if !defined(PLATFORM_RPI) && !defined(PLATFORM_DRM)
|
||||
// NOTE: Instancing functionality could also be available through extension
|
||||
static PFNGLDRAWARRAYSINSTANCEDEXTPROC glDrawArraysInstanced = NULL;
|
||||
static PFNGLDRAWELEMENTSINSTANCEDEXTPROC glDrawElementsInstanced = NULL;
|
||||
static PFNGLVERTEXATTRIBDIVISOREXTPROC glVertexAttribDivisor = NULL;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module specific Functions Declaration
|
||||
|
@ -1722,7 +1726,7 @@ void rlglInit(int width, int height)
|
|||
}
|
||||
|
||||
// Check instanced rendering support
|
||||
if (strcmp(extList[i], (const char *)"GL_ANGLE_instanced_arrays") == 0)
|
||||
if (strcmp(extList[i], (const char *)"GL_ANGLE_instanced_arrays") == 0) // Web ANGLE
|
||||
{
|
||||
glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)eglGetProcAddress("glDrawArraysInstancedANGLE");
|
||||
glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)eglGetProcAddress("glDrawElementsInstancedANGLE");
|
||||
|
@ -1730,6 +1734,18 @@ void rlglInit(int width, int height)
|
|||
|
||||
if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((strcmp(extList[i], (const char *)"GL_EXT_draw_instanced") == 0) && // Standard EXT
|
||||
(strcmp(extList[i], (const char *)"GL_EXT_instanced_arrays") == 0))
|
||||
{
|
||||
glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)eglGetProcAddress("glDrawArraysInstancedEXT");
|
||||
glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)eglGetProcAddress("glDrawElementsInstancedEXT");
|
||||
glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOREXTPROC)eglGetProcAddress("glVertexAttribDivisorEXT");
|
||||
|
||||
if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check NPOT textures support
|
||||
// NOTE: Only check on OpenGL ES, OpenGL 3.3 has NPOT textures full support as core feature
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue