GPU: Remove GPU_INDEX_U8
This type of indices is not natively supported on modern GPU and gives warning on some implementation. The memory savings it provides is also quite minimal and unlikely to be visible on nowadays hardware. This remove some uneeded struct members and makes primitive restart always enabled by default. This can be broken by addons if they are not careful enough but many other states have this problem. Also leverage GL_PRIMITIVE_RESTART_FIXED_INDEX if ARB_ES3_compatibility is supported. This removes all API calls to change restart index depending on indices length.
This commit is contained in:
@@ -1372,6 +1372,16 @@ void GPU_state_init(void)
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
gpu_disable_multisample();
|
||||
|
||||
/* This is a bit dangerous since addons could change this. */
|
||||
glEnable(GL_PRIMITIVE_RESTART);
|
||||
glPrimitiveRestartIndex((GLuint)0xFFFFFFFF);
|
||||
|
||||
/* TODO: Should become default. But needs at least GL 4.3 */
|
||||
if (GLEW_ARB_ES3_compatibility) {
|
||||
/* Takes predecence over GL_PRIMITIVE_RESTART */
|
||||
glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
|
||||
}
|
||||
}
|
||||
|
||||
/** \name Framebuffer color depth, for selection codes
|
||||
|
||||
Reference in New Issue
Block a user