evas gl: distinguish between IMG and EXT MSAA extensions
Summary: For drivers that support IMG_multisampled_render_to_texture, GL_MAX_SAMPLES_IMG should be used to query max supported samples Likewise, for drivers that support EXT_multisampled_render_to_texture, GL_MAX_SAMPLES_EXT should be used to query max supported samples @fix Reviewers: seoz, Hermet, raster, cedric Reviewed By: cedric CC: cedric Differential Revision: https://phab.enlightenment.org/D948
This commit is contained in:
parent
a03952ca0f
commit
acc95afbd8
|
@ -1194,6 +1194,12 @@ typedef signed long int GLsizeiptr; // Changed khronos_ssize_t
|
|||
/* GL_EXT_texture_type_2_10_10_10_REV */
|
||||
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
|
||||
|
||||
/* GL_EXT_multisampled_render_to_texture */
|
||||
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
|
||||
#define GL_MAX_SAMPLES_EXT 0x8D57
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* IMG extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
|
|
|
@ -264,6 +264,14 @@ _EVASGL_EXT_BEGIN(QCOM_extended_get2)
|
|||
_EVASGL_EXT_FUNCTION_END()
|
||||
_EVASGL_EXT_END()
|
||||
|
||||
_EVASGL_EXT_BEGIN(IMG_multisampled_render_to_texture)
|
||||
_EVASGL_EXT_DRVNAME(GL_IMG_multisampled_render_to_texture)
|
||||
_EVASGL_EXT_END()
|
||||
|
||||
_EVASGL_EXT_BEGIN(EXT_multisampled_render_to_texture)
|
||||
_EVASGL_EXT_DRVNAME(GL_EXT_multisampled_render_to_texture)
|
||||
_EVASGL_EXT_END()
|
||||
|
||||
_EVASGL_EXT_BEGIN(multisampled_render_to_texture)
|
||||
_EVASGL_EXT_DRVNAME(GL_IMG_multisampled_render_to_texture)
|
||||
_EVASGL_EXT_DRVNAME(GL_EXT_multisampled_render_to_texture)
|
||||
|
|
|
@ -190,6 +190,9 @@
|
|||
#ifndef GL_MAX_SAMPLES_IMG
|
||||
#define GL_MAX_SAMPLES_IMG 0x9135
|
||||
#endif
|
||||
#ifndef GL_MAX_SAMPLES_EXT
|
||||
#define GL_MAX_SAMPLES_EXT 0x8D57
|
||||
#endif
|
||||
#ifndef GL_WRITE_ONLY
|
||||
#define GL_WRITE_ONLY 0x88B9
|
||||
#endif
|
||||
|
|
|
@ -657,17 +657,21 @@ _surface_cap_init(void *eng_data)
|
|||
#ifdef GL_GLES
|
||||
int max_samples = 0;
|
||||
|
||||
if (EXTENSION_SUPPORT(multisampled_render_to_texture))
|
||||
if (EXTENSION_SUPPORT(IMG_multisampled_render_to_texture))
|
||||
{
|
||||
glGetIntegerv(GL_MAX_SAMPLES_IMG, &max_samples);
|
||||
}
|
||||
else if (EXTENSION_SUPPORT(EXT_multisampled_render_to_texture))
|
||||
{
|
||||
glGetIntegerv(GL_MAX_SAMPLES_EXT, &max_samples);
|
||||
}
|
||||
|
||||
if (max_samples >= 2)
|
||||
{
|
||||
evgl_engine->caps.msaa_samples[0] = 2;
|
||||
evgl_engine->caps.msaa_samples[1] = (max_samples>>1) < 2 ? 2 : (max_samples>>1);
|
||||
evgl_engine->caps.msaa_samples[2] = max_samples;
|
||||
evgl_engine->caps.msaa_supported = 1;
|
||||
}
|
||||
if (max_samples >= 2)
|
||||
{
|
||||
evgl_engine->caps.msaa_samples[0] = 2;
|
||||
evgl_engine->caps.msaa_samples[1] = (max_samples>>1) < 2 ? 2 : (max_samples>>1);
|
||||
evgl_engine->caps.msaa_samples[2] = max_samples;
|
||||
evgl_engine->caps.msaa_supported = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue