OpenGL2: Add run-time support for unsigned short indexes
OpenGL ES 2 is only required to support unsigned short for indexes.
This commit is contained in:
1 parent
3b984d2b51
commit
b25a3c6e4d
4 files changed
+88
-24
No files matched your search
@@ -45,6 +45,17 @@ void GLimp_InitExtraExtensions(void)
|
||||
if (strstr((char *)qglGetString(GL_RENDERER), "Intel"))
|
||||
glRefConfig.intelGraphics = qtrue;
|
||||
|
||||
if (qglesMajorVersion)
|
||||
{
|
||||
glRefConfig.vaoCacheGlIndexType = GL_UNSIGNED_SHORT;
|
||||
glRefConfig.vaoCacheGlIndexSize = sizeof(unsigned short);
|
||||
}
|
||||
else
|
||||
{
|
||||
glRefConfig.vaoCacheGlIndexType = GL_UNSIGNED_INT;
|
||||
glRefConfig.vaoCacheGlIndexSize = sizeof(unsigned int);
|
||||
}
|
||||
|
||||
// set DSA fallbacks
|
||||
#define GLE(ret, name, ...) qgl##name = GLDSA_##name;
|
||||
QGL_EXT_direct_state_access_PROCS;
|
||||
@@ -124,6 +135,19 @@ void GLimp_InitExtraExtensions(void)
|
||||
ri.Printf(PRINT_ALL, result[2], extension);
|
||||
}
|
||||
|
||||
// GL_OES_element_index_uint
|
||||
extension = "GL_OES_element_index_uint";
|
||||
if (SDL_GL_ExtensionSupported(extension))
|
||||
{
|
||||
glRefConfig.vaoCacheGlIndexType = GL_UNSIGNED_INT;
|
||||
glRefConfig.vaoCacheGlIndexSize = sizeof(unsigned int);
|
||||
ri.Printf(PRINT_ALL, result[1], extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
ri.Printf(PRINT_ALL, result[2], extension);
|
||||
}
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user