search GLSL extensions

This commit is contained in:
2019-07-29 13:35:54 +02:00
parent 563b4ff86f
commit 73485cde01
4 changed files with 24 additions and 12 deletions

View File

@@ -15,20 +15,27 @@ void App::initShaders()
for (int i = 0; i < n_exts; i++)
{
std::string ext = (const char*)glGetStringi(GL_EXTENSIONS, i);
if (GLAD_GL_EXT_shader_framebuffer_fetch || GLAD_GL_EXT_shader_framebuffer_fetch_non_coherent)
{
if (ext.find("shader_framebuffer_fetch") != std::string::npos)
ShaderManager::ext_framebuffer_fetch = true;
}
else if (GLAD_GL_ARB_texture_float || GLAD_GL_ATI_texture_float)
{
#if __GLES__
if (ext.find("texture_float") != std::string::npos)
ShaderManager::ext_texture_float = true;
}
else if (GLAD_GL_NV_half_float || GLAD_GL_ARB_half_float_pixel)
{
if (ext.find("color_buffer_float") != std::string::npos)
ShaderManager::ext_texture_float = true;
if (ext.find("texture__half_float") != std::string::npos)
ShaderManager::ext_half_float_pixel = true;
}
if (ext.find("color_buffer_half_float") != std::string::npos)
ShaderManager::ext_half_float_pixel = true;
#endif
LOG("EXT: %s", ext.c_str());
}
});
#if __GL__
// In OpenGL 3.3 these should be already available
ShaderManager::ext_texture_float = true;
ShaderManager::ext_half_float_pixel = true;
#endif
LOG("Shader Extension shader_framebuffer_fetch: %s", ShaderManager::ext_framebuffer_fetch ? "enabled" : "disabled");