mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
OGL: Move primitive restart enable logic to GLUtil
This commit is contained in:
@ -102,4 +102,27 @@ GLuint CompileProgram(const std::string& vertexShader, const std::string& fragme
|
||||
|
||||
return programID;
|
||||
}
|
||||
|
||||
void EnablePrimitiveRestart()
|
||||
{
|
||||
constexpr GLuint PRIMITIVE_RESTART_INDEX = 65535;
|
||||
|
||||
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3)
|
||||
{
|
||||
glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GLExtensions::Version() >= 310)
|
||||
{
|
||||
glEnable(GL_PRIMITIVE_RESTART);
|
||||
glPrimitiveRestartIndex(PRIMITIVE_RESTART_INDEX);
|
||||
}
|
||||
else
|
||||
{
|
||||
glEnableClientState(GL_PRIMITIVE_RESTART_NV);
|
||||
glPrimitiveRestartIndexNV(PRIMITIVE_RESTART_INDEX);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user