GL/Program: Use glBindFragDataLocationIndexedEXT for GLES

This commit is contained in:
Connor McLaughlin 2020-12-31 13:29:38 +10:00
parent 5690aef057
commit 6d501bff56
1 changed files with 12 additions and 0 deletions

View File

@ -192,6 +192,18 @@ void Program::BindFragData(GLuint index /*= 0*/, const char* name /*= "o_col0"*/
void Program::BindFragDataIndexed(GLuint color_number /*= 0*/, const char* name /*= "o_col0"*/)
{
if (GLAD_GL_VERSION_3_3 || GLAD_GL_ARB_blend_func_extended)
{
glBindFragDataLocationIndexed(m_program_id, color_number, 0, name);
return;
}
else if (GLAD_GL_EXT_blend_func_extended)
{
glBindFragDataLocationIndexedEXT(m_program_id, color_number, 0, name);
return;
}
Log_ErrorPrintf("BindFragDataIndexed() called without ARB or EXT extension, we'll probably crash.");
glBindFragDataLocationIndexed(m_program_id, color_number, 0, name);
}